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
Allow to safely probe external namespaces #3999
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3999 +/- ##
==========================================
+ Coverage 97.22% 97.24% +0.01%
==========================================
Files 191 191
Lines 6745 6741 -4
Branches 1970 1967 -3
==========================================
- Hits 6558 6555 -3
Misses 99 99
+ Partials 88 87 -1
Continue to review full report at Codecov.
|
My pleasure, glad I could help you, and the community! 🎉 Thank you for digging into it. |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3996
Description
It is actually not safe to replace namespace imports with named imports in the case of external dependencies as the behaviour will be different if a named export does not exist: While for the namespace import, a property will just be
undefined
, the missing named import will throw at parse time.This changes the behaviour to always keep external namespaces as objects and keep the property access. This allows to safely probe for the existence of named imports.