-
Notifications
You must be signed in to change notification settings - Fork 391
Description
When a project references cosmwasm_std crate as one of the dependencies and is being compiled to wasm32 architecture, the package injects entrypoint exports into the final wasm build
cosmwasm/packages/std/src/lib.rs
Lines 111 to 112 in 888552a
| #[cfg(target_arch = "wasm32")] | |
| pub use crate::exports::{do_execute, do_instantiate, do_migrate, do_query, do_reply, do_sudo}; |
It might not be desirable when developing interfaces and libraries that only need certain types like Binary, Uint128and so on.
It unnecessarily increases the size when building for Javascript environment and causes issues when building for virtual machines with custom constraints
A possible solution would be to only inject the exports when referencing cosmwasm contract specific entities like entrypoint or to provide additional feature flag for the crate (e.g. library) for opting out of injection