The current implementation and design of component dependencies doesn't offer much in the way of developing components. It was conceived as a sort-of post development tool that enabled wiring up exports from dependencies to imports in my component. The responsibility of importizing dependencies was delegated to the developer.
The current syntax looks like this:
[dependencies]
"foo:bar@0.1.0" = { path = "path/to/component.wasm" }
The foo:bar@0.1.0 is pattern that says "for any imports in my component that are part of foo:bar@0.1.0 compose with matching exports from path/to/component.wasm".
As a developer what i'd really want to express while developing my application is:
[dependencies]
"bar" = { path = "path/to/component.wasm" }
Where bar here represents a name of my choosing that would appear in my languages bindings. In the case of rust, i'd be able to access the importized exports of my dependency via the bar module, e.g. use bar::....
What's lost here is the expressitivtiy and control on how exactly imports/exports are composed together. With this change we'd simply plug components into the main component in the order listed in the manifest. Having said that, i think plug-style composition is the more intuitive flavor of composition desired at the level of spin.
I'm opening this issue Pre-SIP to gather brainstorming feedback or perhaps alternative designs altogether!
The current implementation and design of component dependencies doesn't offer much in the way of developing components. It was conceived as a sort-of post development tool that enabled wiring up exports from dependencies to imports in my component. The responsibility of importizing dependencies was delegated to the developer.
The current syntax looks like this:
The
foo:bar@0.1.0is pattern that says "for any imports in my component that are part offoo:bar@0.1.0compose with matching exports frompath/to/component.wasm".As a developer what i'd really want to express while developing my application is:
Where
barhere represents a name of my choosing that would appear in my languages bindings. In the case of rust, i'd be able to access the importized exports of my dependency via thebarmodule, e.g.use bar::....What's lost here is the expressitivtiy and control on how exactly imports/exports are composed together. With this change we'd simply plug components into the main component in the order listed in the manifest. Having said that, i think plug-style composition is the more intuitive flavor of composition desired at the level of spin.
I'm opening this issue Pre-SIP to gather brainstorming feedback or perhaps alternative designs altogether!