Implement unlocked-dep imports for component dependencies. #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements outputting a component with
unlocked-dep
imports forany component dependencies specified in
Cargo.toml
.Note that WIT does not support the nesting of interfaces (i.e.
instances), so to properly bind to a component's exports, an instance is
imported for its directly exported functions and then one for every instance
the component exports.
Therefore, depending on a component may result in more than one import
dependency for that package; one of the imports might be for
unlocked-dep=<foo:bar>
, while others might be of the formunlocked-dep=<foo:bar/<export>>
.Additionally, this contains a breaking change to bindings for component dependencies;
component dependencies are now namespaced, so to access function
baz
of packagefoo:bar
goes frombindings::bar::baz
tobindings::foo_bar::baz
. Similarly, interfacesexported by
foo:bar
are go frombindings::bar::<name>
tobindings::foo_bar::<name>
.Dependencies have also been updated to latest, including
0.3.0
of warg.