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

Do not expose synthetic namespace export in entries and namespaces #4364

Merged
merged 3 commits into from Jan 25, 2022

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

Previously, the synthetic namespace export (i.e. "foo" when a module has syntheticNamedExports: "foo") was hidden in entry points but exposed if it was not an actual export of the entry but part of an export * from namespace reexport.
This PR fixes this by requiring synthetic named exports to be explicit exports and reexports on the one hand and making sure they are not exposed even in reexport scenarios.
I hope this scenario was sufficiently edge case to not break things, but it is actually a problem when creating proxy modules that expose all exports of another module (but should not expose the synthetic namespace).

@lukastaegert lukastaegert changed the base branch from master to namespace-conflicts January 25, 2022 05:45
Base automatically changed from namespace-conflicts to master January 25, 2022 05:46
@github-actions
Copy link

github-actions bot commented Jan 25, 2022

Thank you for your contribution! ❤️

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

npm install rollup/rollup#hide-synthetic-namespace

or load it into the REPL:
https://rollupjs.org/repl/?pr=4364

@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #4364 (33b5dc9) into master (f30e6f0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4364   +/-   ##
=======================================
  Coverage   98.68%   98.68%           
=======================================
  Files         205      205           
  Lines        7323     7328    +5     
  Branches     2083     2085    +2     
=======================================
+ Hits         7227     7232    +5     
  Misses         36       36           
  Partials       60       60           
Impacted Files Coverage Δ
src/utils/error.ts 100.00% <ø> (ø)
src/Module.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f30e6f0...33b5dc9. Read the comment docs.

@lukastaegert lukastaegert merged commit 79ec55d into master Jan 25, 2022
@lukastaegert lukastaegert deleted the hide-synthetic-namespace branch January 25, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant