Skip to content

component dependencies 2.0 #3421

@fibonacci1729

Description

@fibonacci1729

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!

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