An import is an explicitly declared dependency that supplies a function, resource, or interface element from another component or host. In Wasm components, imports define the capabilities a component may use, replacing hidden or unexpected dependencies with a controlled interface. section 3.1.3 section 3.5
Imports also provide the communication boundary in a shared-nothing design. For example, my_app.wasm imports a secret-store interface from my_secret_store.wasm and calls its get method with my-key. The components keep separate memories; arguments are copied across the boundary, while returned resources are represented by handles managed through a resource table. section 3.1.2
This boundary provides practical security and maintenance benefits:
- Limits each component to its specified imports rather than allowing access to arbitrary dependencies. section 3.1.3
- Contains the effect of a vulnerable component because components do not share memory. section 3.1.3
- Allows a patched component to be relinked without recompiling unchanged business logic. section 3.1.3
Figure 3.2 The interaction between two isolated Wasm components starting from a function call to communicating with an adapter component, doing required memory copies, and returning a resource that can be accessed via a resource table
Follow the call from an importing application through isolated component memories, adapters, copied values, and returned resource handles. section 3.1.2
