Skip to content

Implement a simple composition flow a la wasm-tools compose -d #80

@rylev

Description

@rylev

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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions