Skip to content

Correct the parent scope for static blocks#6001

Merged
lukastaegert merged 3 commits into
masterfrom
fix/5990
Jul 5, 2025
Merged

Correct the parent scope for static blocks#6001
lukastaegert merged 3 commits into
masterfrom
fix/5990

Conversation

@TrickyPi

@TrickyPi TrickyPi commented Jul 3, 2025

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:
resolves #5990

Description

@vercel

vercel Bot commented Jul 3, 2025

Copy link
Copy Markdown

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 Jul 4, 2025 1:05pm

@github-actions

github-actions Bot commented Jul 3, 2025

Copy link
Copy Markdown

Thank you for your contribution! ❤️

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

npm install rollup/rollup#fix/5990

Notice: Ensure you have installed the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-8n4wjpps8-rollup-js.vercel.app/repl/?pr=6001

@github-actions

github-actions Bot commented Jul 3, 2025

Copy link
Copy Markdown

Performance report

  • BUILD: 7012ms, 823 MB
    • initialize: 0ms, 24.7 MB (+8%)
    • generate module graph: 2631ms, 630 MB
      • generate ast: 1409ms, 619 MB
    • sort and bind modules: 398ms, 690 MB
    • mark included statements: 3981ms, 823 MB
      • treeshaking pass 1: 2330ms, 819 MB
      • treeshaking pass 2: 464ms (-10ms, -2.2%), 826 MB
      • treeshaking pass 3: 400ms, 824 MB
      • treeshaking pass 4: 387ms, 820 MB
      • treeshaking pass 5: 385ms, 823 MB
  • GENERATE: 914ms (+186ms, +25.6%), 911 MB
    • initialize render: 0ms, 903 MB
    • generate chunks: 189ms (+85ms, +81.6%), 865 MB (+4%)
      • optimize chunks: 0ms, 883 MB (-4%)
    • render chunks: 641ms, 900 MB
    • transform chunks: 21ms, 911 MB
    • generate bundle: 0ms, 911 MB

@codecov

codecov Bot commented Jul 3, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.79%. Comparing base (5a7f9e2) to head (d59bae6).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #6001     +/-   ##
=========================================
  Coverage   98.78%   98.79%             
=========================================
  Files         270      270             
  Lines        8745    10559   +1814     
  Branches     1512     2815   +1303     
=========================================
+ Hits         8639    10432   +1793     
- Misses         73       87     +14     
- Partials       33       40      +7     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for analyzing and the quick fix! I took the liberty and push one small change to directly compare the code of the node to avoid a property lookup in the generated code, but in general the fix is correct! Unfortunately, the custom logic here makes it hard to ensure it is always up to date with all possible nodes in ClassBodies.

@TrickyPi

TrickyPi commented Jul 5, 2025

Copy link
Copy Markdown
Member Author

Thanks for the improvement!

Unfortunately, the custom logic here makes it hard to ensure it is always up to date with all possible nodes in ClassBodies.

Yeah! We might need to revisit this logic if more node types show up in ClassBodies in the future.

@lukastaegert lukastaegert added this pull request to the merge queue Jul 5, 2025
Merged via the queue into master with commit 9cebb0b Jul 5, 2025
42 checks passed
@lukastaegert lukastaegert deleted the fix/5990 branch July 5, 2025 04:52
@github-actions

Copy link
Copy Markdown

This PR has been released as part of [email protected]. 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

Development

Successfully merging this pull request may close these issues.

Classes with static init blocks are only removed when treeshake is "smallest"

2 participants