mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5215] GameNarration.tsx is 300 kB of source and now gates the bundle budget #2885
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2885
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5215
Originally assigned to: @SpicyMarinara on GitHub.
Problem
packages/client/src/components/game/GameNarration.tsxis ~300 kB of source (6,847 lines). It is the single largest component in the client, and it is imported byGameSurface,GameSessionReplayand the storyboard UI.That size is now load-bearing on the build. The bundle budget in
packages/client/vite.config.tshad to be raised from 500 kB to 520 kB in #5209, because:GameSurfacemeasured 499.05 kB on staging before that change — under a kilobyte of headroom. The cap was going to stop whichever feature next touched that area; #5209 happened to be the one.GameNarrationits own manual chunk dropsGameSurfaceto 375 kB but produces a 578 kB narration chunk. Total bytes go slightly down (≈3153 kB → 3111 kB, so it redistributes rather than duplicates), but the largest chunk gets worse. No chunk boundary puts a 300 kB source file under 500 kB.So the only remaining lever is decomposing the component.
What would help
Pull self-contained pieces out of
GameNarration.tsxinto siblings — candidates visible from the outside:lib/tts-dialogue.tsandlib/tts-audio-cache.tsare already narration-exclusive)Once the file is meaningfully smaller, the manual-chunk split becomes worthwhile on its own merits — it also means editing narration stops invalidating the surface chunk in a returning player's cache — and the budget can go back to 500.
Why not just leave the cap at 520
A budget only does its job while it is tight. 520 buys roughly one more feature in this area before the same conversation happens again, and the next person will hit it without the context above. Worth doing properly rather than ratcheting.
Notes
Measurements taken on
feat/5209-collapsible-narrationat Engine 2.4.3, viapackages/client/scripts/build.mjs.@SpicyMarinara commented on GitHub (Aug 18, 2026):
Agreed, needs to be made smaller.
@SpicyMarinara commented on GitHub (Aug 18, 2026):
Implementation is in progress in draft PR #5219. The formatter and narration visuals are being separated into focused chunks, and the 500 KiB budget is restored with measured bundle output.
@SpicyMarinara commented on GitHub (Aug 18, 2026):
Landed on staging via #5219.