Skip to content

enhance tree-shaking for dynamic imports#5954

Merged
lukastaegert merged 4 commits intomasterfrom
feat/enhance-dynamic-imports
May 16, 2025
Merged

enhance tree-shaking for dynamic imports#5954
lukastaegert merged 4 commits intomasterfrom
feat/enhance-dynamic-imports

Conversation

@TrickyPi
Copy link
Member

@TrickyPi TrickyPi commented May 10, 2025

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 PR slightly improves tree-shaking for dynamic imports. For direct calls like module.foo(), it's no longer necessary to consider including all properties of this. It also improves the object tree-shaking for parameters in then callbacks.

@vercel
Copy link

vercel bot commented May 10, 2025

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 May 16, 2025 2:42pm

@github-actions
Copy link

github-actions bot commented May 10, 2025

Thank you for your contribution! ❤️

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

npm install rollup/rollup#feat/enhance-dynamic-imports

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-86fa8tzea-rollup-js.vercel.app/repl/?pr=5954

@github-actions
Copy link

github-actions bot commented May 10, 2025

Performance report

  • BUILD: 7398ms, 746 MB
    • initialize: 0ms, 28.2 MB
    • generate module graph: 2832ms, 561 MB
      • generate ast: 1287ms, 554 MB
    • sort and bind modules: 406ms, 606 MB
    • mark included statements: 4156ms, 746 MB
      • treeshaking pass 1: 2464ms, 747 MB
      • treeshaking pass 2: 478ms, 745 MB
      • treeshaking pass 3: 409ms, 746 MB
      • treeshaking pass 4: 399ms, 748 MB
      • treeshaking pass 5: 398ms, 746 MB
  • GENERATE: 739ms, 988 MB
    • initialize render: 0ms, 884 MB
    • generate chunks: 74ms, 895 MB
      • optimize chunks: 0ms, 889 MB
    • render chunks: 648ms, 962 MB
    • transform chunks: 16ms, 988 MB
    • generate bundle: 0ms, 988 MB

@codecov
Copy link

codecov bot commented May 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.56%. Comparing base (7536ffb) to head (e11c015).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5954      +/-   ##
==========================================
+ Coverage   98.55%   98.56%   +0.01%     
==========================================
  Files         270      270              
  Lines        8718     8726       +8     
  Branches     1495     1504       +9     
==========================================
+ Hits         8592     8601       +9     
+ Misses         93       92       -1     
  Partials       33       33              

☔ 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.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Nice improvement 👍

@lukastaegert lukastaegert force-pushed the feat/enhance-dynamic-imports branch from b3058cc to e11c015 Compare May 16, 2025 14:41
@lukastaegert lukastaegert enabled auto-merge May 16, 2025 14:41
@lukastaegert lukastaegert added this pull request to the merge queue May 16, 2025
Merged via the queue into master with commit fff335f May 16, 2025
42 checks passed
@lukastaegert lukastaegert deleted the feat/enhance-dynamic-imports branch May 16, 2025 15:48
@github-actions
Copy link

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

2 participants