Skip to content
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

Ensure reexported namespaces do not prevent creation of default export helpers #5466

Merged
merged 4 commits into from Apr 12, 2024

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

The problem here was an asymmetry between the logic deciding if the external namespace needed to be deconflicted locally in

rollup/src/Chunk.ts

Lines 911 to 916 in eebf061

variable.name === '*' &&
namespaceInteropHelpersByInteropType[interop(module.id)]
) {
deconflictedNamespace.add(chunk);
}
}
and the logic deciding whether to render the helper in
} else if (imported === '*' && reexported !== '*' && !hasNamespace) {
. The latter logic only rendered the namespace helper if the namespace was actually rendered, i.e. it is not just reexported as individual exports. The former, on the other hand, just looked if we imported or reexported a namespace, independent of usage. This is fixed here.

Copy link

vercel bot commented Apr 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 5:17am

Copy link

github-actions bot commented Apr 11, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-5465

Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.

or load it into the REPL:
https://rollup-r1ab2ob7b-rollup-js.vercel.app/repl/?pr=5466

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.81%. Comparing base (2fdfe1c) to head (83ca934).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5466      +/-   ##
==========================================
+ Coverage   98.79%   98.81%   +0.02%     
==========================================
  Files         238      238              
  Lines        9449     9450       +1     
  Branches     2407     2407              
==========================================
+ Hits         9335     9338       +3     
+ Misses         48       47       -1     
+ Partials       66       65       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukastaegert lukastaegert merged commit cfbaaaa into master Apr 12, 2024
30 checks passed
@lukastaegert lukastaegert deleted the gh-5465 branch April 12, 2024 06:10
Copy link

This PR has been released as part of rollup@4.14.2. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant