Repository navigation
Tighten validation to require uniqueness between import and export kebab-names - #164
Merged
Merged
Conversation
alexcrichton
approved these changes
Feb 14, 2023
alexcrichton
left a comment
Collaborator
There was a problem hiding this comment.
This definitely simplifies the bindings generation side of things, but are there use cases that this might otherwise affect such as "I import and export $FOO" where slightly different names now need to be assigned? Those cases can always continue to work with slight renamings which doesn't sound like the end of the world to me, but I haven't thought too far ahead to those cases myself.
Member
Author
|
Ok, async feedback seems positive and no issues raised, so merging. |
alexcrichton
added a commit
to alexcrichton/wasm-tools
that referenced
this pull request
Feb 28, 2023
This commit implements WebAssembly/component-model#164 which moves component imports and exports into the same namespace as opposed to the prior disjoint namespaces. This new restriction is then carried through to WIT parsing as well and all the various tests/resolution.
alexcrichton
added a commit
to bytecodealliance/wasm-tools
that referenced
this pull request
Feb 28, 2023
This commit implements WebAssembly/component-model#164 which moves component imports and exports into the same namespace as opposed to the prior disjoint namespaces. This new restriction is then carried through to WIT parsing as well and all the various tests/resolution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Recently, I've seen a few cases where the possibility of overlap between the kebab-names of imports and exports has led to additional complexity that seems unnecessary given that the whole point of kebab-names is to provide a nice local developer-friendly names that can be renamed in cases of collision without impacting meaning (which is where the
(id <URL>)subfield come in instead). Thus, this PR suggests tightening the validation rules for component-levelexternnames to rule out these cases of overlap. E.g., with this change, the names of imports and exports in a Witworldcan share a single namespace.