Skip to main content
Version: 1.0

Linking Components

Components include defined imports and exports which are facilitated by links.

  • Imports are the functions a component requires to run, and must be linked for a component to start successfully.
  • Exports are the functions exposed on the component, which may be called by other components, providers, or the host runtime. At least one export must be linked in order to run a component.

In wasmCloud, links may be satisfied by...

1. The wasmCloud host

For example, the wasmCloud host's built-in logging functionality could satisfy a component's logging import.

2. Build-time composition

At build-time, WebAssembly components may be composed, meaning they will be packaged together as a single component and linked internally. The WebAssembly runtime (in our case, wasmtime) will handle links when it runs the component. You can learn more about composing components in the Component Model documentation.

3. Providers (on the same host)

Links can be satisfied by providers on the lattice, which themselves may facilitate connections to external resources. Learn more about providers on the Providers page.

4. Distributed components called over the network

Links to components or providers on another wasmCloud host may be made over the lattice at runtime. Learn more about this linking approach on the Runtime Linking page.

Four ways to link components

In practice, wasmCloud's multiple approaches to linking components means the capabilities of the wasmCloud host are pluggable and extensible at runtime—you do not need to ship a new host to update or extend capabilities. Developers can design and ship custom interfaces easily, and platform operators enjoy a convenient workflow for updating capabilities.