refactor(javascript): avoid redundant size-mode mangle export work#13691
refactor(javascript): avoid redundant size-mode mangle export work#13691LingyuCoder wants to merge 1 commit intomainfrom
Conversation
|
⏳ Triggered benchmark: Open |
Deploying rspack with
|
| Latest commit: |
fba13d6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://70382b77.rspack-v2.pages.dev |
| Branch Preview URL: | https://refactor-mangle-exports-size.rspack-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
This pull request refactors the JavaScript mangle-exports implementation to reduce redundant work during size-mode mangling, and it also introduces a new Rstack nine-grid poster asset set plus a design spec.
Changes:
- Cache
UsageStateinExportInfoCacheand refactor size-mode export name assignment to avoid extra lookups and sorting. - Add a unit test ensuring size-mode name assignment respects pre-sorted input order.
- Add a new nine-grid poster SVG and related PNG assets, plus a design spec document.
Reviewed changes
Copilot reviewed 2 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_plugin_javascript/src/plugin/mangle_exports_plugin.rs |
Optimizes size-mode export mangling by caching UsageState, removing redundant get_used(None) calls/sorts, and adds a unit test. |
docs/superpowers/specs/2026-04-13-rstack-nine-grid-poster-design.md |
Adds a design spec for a new nine-grid Rstack ecosystem poster. |
website/docs/assets/blog/rstack-nine-grid-poster.svg |
Adds the new nine-grid poster SVG layout referencing local PNG assets. |
website/docs/assets/blog/rstack-nine-grid-assets/rsbuild.png |
Adds Rsbuild image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rsdoctor.png |
Adds Rsdoctor image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rslib.png |
Adds Rslib image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rslint.png |
Adds Rslint image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rspack.png |
Adds Rspack image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rspress.png |
Adds Rspress image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rspeedy.png |
Adds Rspeedy image asset used by the poster SVG. |
website/docs/assets/blog/rstack-nine-grid-assets/rstest.png |
Adds Rstest image asset used by the poster SVG. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fba13d6 to
c560bc8
Compare
Merging this PR will degrade performance by 1.72%
Performance Changes
Comparing |
|
📝 Benchmark detail: Open
|
Rsdoctor Bundle Diff AnalysisFound 6 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 813.84KB from 49.39MB to 48.60MB (⬇️1.61%) |
|
📝 Benchmark detail: Open
|
450d4cf to
26d3634
Compare
26d3634 to
a82c37e
Compare
Summary
UsageStateinExportInfoCachewhile building the mangle exports cacheget_used(None)lookup and redundant sorting inoptimization.mangleExports = 'size'Related links
Checklist