Repository navigation
perf(frontend): split the optional editors into named chunks (WI-1916) - #436
Merged
Merged
Conversation
The build named only milkdown/dnd/xterm, so Excalidraw, mermaid and cytoscape landed in opaque chunk-* files shared with unrelated code. Add explicit groups for the three libraries and extend the entry guard to reject mermaid/cytoscape assets in index.html. includeDependenciesRecursively: false keeps each group to the modules it names; with the default Excalidraw absorbs mermaid and mermaid absorbs cytoscape, producing one multi-megabyte chunk per group. The app locales and shiki grammars stay per-file dynamic imports (one chunk per locale/language) and are deliberately not grouped. Main entry payload: 187.1 KiB before and after (root shell 28.6 KiB raw / 11.6 KiB gzip, under the 50/20 budget). Total JS 19.69 MB -> 19.66 MB.
|
Size Change: 0 B 🆕 Total Size: 0 B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
vite.config.jsnamed onlymilkdown/dnd/xterm, so Excalidraw, mermaid and cytoscape landed in opaquechunk-*files shared with unrelated code. A deploy that touched one of them invalidated the whole shared file, and there was no guard against them leaking into the entry.What
excalidraw,mermaidandcytoscape, each withincludeDependenciesRecursively: false. With the default, Excalidraw absorbs mermaid (a dependency of@excalidraw/mermaid-to-excalidraw) and mermaid absorbs cytoscape, producing one multi-megabyte chunk per group.mermaidandcytoscapeassets inindex.html.Before / after
App-*.js, budget 50/20 KiB)chunk-*(1778 + 522 + 520 KB)excalidraw-*.js(2726 KB)chunk-*(647 + 203 KB)mermaid-*.js(2144 KB)cytoscape.esm-*.js(423 KB)cytoscape-*.js(423 KB)The entry was already small from earlier work (WI-608/610/616); this makes the lazy split explicit and cache-stable. The loaded total is unchanged.
Verification
bun run build:app+check-entry-assets.js— passbun run check,bun run typecheck— pass../core-testsfrontend suite — 437 files, 3270 tests passrun-e2e.sh):pages-excalidraw.spec.ts(Excalidraw + mermaid render, 6 tests),item-description-markdown-view.spec.ts,critical-browser-page.spec.ts— passPairs with Windshiftapp/core-tests-internal#34.