-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Prefer locally defined exports and reexports over external namespaces #4064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#gh-4049-namespace-reexport-issue or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #4064 +/- ##
==========================================
+ Coverage 97.43% 97.49% +0.05%
==========================================
Files 192 193 +1
Lines 6794 6821 +27
Branches 1995 2006 +11
==========================================
+ Hits 6620 6650 +30
Misses 84 84
+ Partials 90 87 -3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great. I wish we had had ambiguous errors for the namespace cases. I guess these could be refined over time possibly, but should likely be avoided anyway.
f6d727b
to
01a151c
Compare
01a151c
to
3c031cf
Compare
Wow, that almost seems like parity and the warning is definitely very useful. Strictly speaking un-errored ambiguous properties are still on the namespace just as undefined values. I've posted a spec PR to explicitly define this in tc39/ecma262#2401. |
Turns out they aren't enumerable - should have checked the case more clearly here. So this PR does make RollupJS behaviour fully spec compatible down to the externalization ambiguity that we now have warnings for as well! |
33c1254
to
f2cda99
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #4049
Description
This resolves the scenario in #4049 where you have two competing namespace reexports in a file where the first one reexports the namespace of an external module. When looking for explicit reexports, the logic will first check all namespaces for exports that are not resolved via the external namespace until falling back to that one.