Skip to content

fix: tree-shakable module library should align with the allowInlineStartup condition #19714

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

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

hai-x
Copy link
Member

@hai-x hai-x commented Jul 17, 2025

What kind of change does this PR introduce?

Fixes #18272 (comment).

When the ESM entry module is guaranteed to be inlined without being wrapped in an IIFE, we generate export statements at the top level to enhance tree-shaking. Otherwise, we place them within the module factory.

Therefore, we must verify the prerequisites for allowInlineStartup and iife to ensure correct behavior.

Did you add tests for your changes?

Yes. Feel free to more requirement.

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

No

Copy link

codspeed-hq bot commented Jul 17, 2025

CodSpeed Performance Report

Merging #19714 will improve performances by 36.21%

Comparing fix-inline-module (5b14509) with main (5a1834d)

Summary

⚡ 1 improvements
✅ 41 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
benchmark "many-modules-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 125.9 ms 92.4 ms +36.21%

@alexander-akait
Copy link
Member

@hai-x Still WIP?

@hai-x hai-x force-pushed the fix-inline-module branch 2 times, most recently from 7ad493d to f7e6087 Compare July 18, 2025 15:51
@hai-x hai-x marked this pull request as ready for review July 18, 2025 16:17
@alexander-akait
Copy link
Member

@hai-x Can you rebase?

@hai-x hai-x force-pushed the fix-inline-module branch from 3c77576 to d99c1f3 Compare July 26, 2025 15:22
@xiaoxiaojx
Copy link
Member

lgtm

@alexander-akait
Copy link
Member

@hai-x Looks like some tests are failed due snapshots, let's rebase and include these changes in the next release, thank you for your work

@hai-x hai-x force-pushed the fix-inline-module branch from 31f8a84 to 5b14509 Compare July 29, 2025 16:47
@alexander-akait alexander-akait merged commit a018901 into main Aug 4, 2025
81 of 82 checks passed
@alexander-akait alexander-akait deleted the fix-inline-module branch August 4, 2025 15:50
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.

3 participants