-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Note: This issue is related to #53 which is a more general issue for implementing many common composition scenarios.
The most simple composition scenario is to "plug" the exports of one composition into the imports of another.
There's many different developer experiences for how this could work. The wasm-tools compose -d approach is to treat the component with imports as the "main" component while the component with the exports is the "dependency". This certainly is one way to think about such a composition, but I believe there's a more intuitive way: to treat both components as inputs into a "plug" operation that explicitly labels what type of connector type the component is (in a similar fashion to male/female connector types in electrical or networking contexts).
I'd therefore propose the following wac plug subcomand:
wac plug --plug $COMPONENT_WITH_EXPORTS --into $COMPONENT_WITH_IMPORTS
We'd likely want to support the following features:
- The ability to specify multiple plugs
- The ability to select only certain exports from a plug (e.g.,
--plug my_component.wasm[example:example/my-interface])