-
-
Notifications
You must be signed in to change notification settings - Fork 666
feat: inline const for leaf modules #10451
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #10451 will degrade performances by 13.54%Comparing 🎉 Hooray!
|
Benchmark | BASE |
HEAD |
Change | |
---|---|---|---|---|
❌ | build_chunk_graph_parallel |
70.7 ms | 81.7 ms | -13.54% |
CodSpeed regression is caused by extra |
Summary
Pre-PR for enum inlining
ref: evanw/esbuild@7bf3046
This PR only handle the cross-module part of const inlining, the idea is very similar to mangle exports:
inlinable
onexport_info
, which is similar tocan_mangle
, and addUsedName::Inlined
for inlined value andUsedName::Normal
for maybe mangled namesinline_const
parser plugin to find all the inlinable const variable, and "tag" it to tell theESMExportSpecifierDependency
that this exported value is inlinableInline const for the module that declared the const (in-module inlining) is not implemented yet, which need further discussion to decide:
Checklist
or not requiredupdate in future PR).