Skip to content

Do not handle declarations in modules without side effects as TDZ#5322

Merged
lukastaegert merged 1 commit intomasterfrom
gh-5317-module-side-effects
Dec 30, 2023
Merged

Do not handle declarations in modules without side effects as TDZ#5322
lukastaegert merged 1 commit intomasterfrom
gh-5317-module-side-effects

Conversation

@lukastaegert
Copy link
Copy Markdown
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

This ignores the TDZ detection logic when the variable is inside a module with moduleSideEffects=false as the logic would otgherwise detect false positives.

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 29, 2023

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

Name Status Preview Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview Dec 29, 2023 10:08am

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 29, 2023

Thank you for your contribution! ❤️

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

npm install rollup/rollup#gh-5317-module-side-effects

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-5qvtqcq2h-rollup-js.vercel.app/repl/?pr=5322

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d8b4aa6) 98.82% compared to head (5819722) 98.82%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5322      +/-   ##
==========================================
- Coverage   98.82%   98.82%   -0.01%     
==========================================
  Files         232      232              
  Lines        8974     8973       -1     
  Branches     2338     2338              
==========================================
- Hits         8869     8868       -1     
  Misses         46       46              
  Partials       59       59              

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

@lukastaegert lukastaegert merged commit ba1c2db into master Dec 30, 2023
@lukastaegert lukastaegert deleted the gh-5317-module-side-effects branch December 30, 2023 06:04
@github-actions
Copy link
Copy Markdown

This PR has been released as part of rollup@4.9.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