Fix resolving @scope/name namespaces#531
Merged
rwjblue merged 2 commits intoember-cli:masterfrom Apr 11, 2020
Merged
Conversation
90831ff to
5509220
Compare
Contributor
Author
|
I seem to have fixed it. 🤔 All existing tests are still passing and the newly added tests pass as well. |
Contributor
Author
|
CI is failing for an unrelated reason: Fixing in #532. |
Merged
Contributor
Author
|
Assuming CI is fixed (#532), would this PR be mergeable? Is there something I need to improve or do we not want to support this in the first place? |
5509220 to
490289f
Compare
Contributor
Author
|
The PR is rebased and CI is passing. ✅ |
Member
|
Thank you @buschtoens! |
Contributor
Author
|
Awesome! Thank you for merging this! 💖 |
@scope/name namespaces@scope/name namespaces
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.
It is possible resolve modules from other packages using namespaces. For instance, the following looks up the
intlservice directly from theember-intlpackage:Notably, this instance is
!==to theappre-export that is merged with the host app:This is expected behavior.
So generalizing, the pattern for looking up something from a foreign package is:
Unfortunately, this does not work for packages that have a scoped name, e.g.
@corp/fancy-addon.The invocation would look like:
parseName(fullNane)does not support this, as it was written before package scopes were introduced and only expected a single@to be present.ember-resolver/addon/resolvers/classic/index.js
Lines 41 to 91 in 59d6e19
This PR, so far, adds failing tests for scoped package names.
Is this something that we would want to fix? I personally have an interest in it and would finish the PR, if so.
Related