Repository navigation
perf(site): compile the engine from its sources and drop the directory facade chunk - #1450
Merged
Merged
Conversation
apresmoi
force-pushed
the
untangle7/s6a-size
branch
from
October 6, 2026 17:56
c3fc5be to
3df0452
Compare
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.
Change
Plan 7 step S6a, size tuning. Plan 7 itself cost almost nothing in client JS: its own modules add about +220 minified bytes across the S3 changes (each changed module minified on its own), and the +11%
scene-routergrowth from #1350 was a move out ofscene-datasets(both load on every page). The client JS growth since the plan 7 starting point (7c3bbfd79a, before #1350) is feature data, mostly the prepared dataset, moon-label and universe banks.Two structural changes recover more than plan 7 cost:
site/build/package-sources.mts). The engine shipped as one tsup bundle, so the startup cover's singlesmoothstepimport put the whole engine (29.6 KB raw) into every object page's first view. Its modules now split per module; the engine code the lazy chunks need moves into them.With the duplicate chunk boundaries gone, the bundler also merges
planetary-system-membersintoobject-directory,object-entriesintostartup-world, and the core chunk intoopacity-clock.Size
Client JS from
measure.mts; first view is the static closure of the page's scripts; total is first view plus every lazy chunk.7c3bbfd79ab85b8784ef/earth/,/itokawa/first view raw/earth/,/itokawa/first view gzip/earth/,/itokawa/first-view chunks/lmc/and the 11 other system routes measured)/,/earth/,/dione/,/itokawa/)Every route's first view, total and chunk count is at or below main and at or below the plan 7 start. Client JS total stays above the plan 7 start only by the feature data merged since.
What the per-leaf guard flags. L7 in strict mode lists failures that come from the merge itself, not from added work: the five lazy import targets (
dynamic.*) carry +1.9% raw / +2.1% gzip because the engine code left the first view for them; merged chunks (startup-world,object-directory,opacity-clock,camera-layout) grow by what they absorbed; andobject-directorynow lists the Node-onlyprepared-world-context-node-sourceimport thatplanetary-system-membersused to list (an order finding; a real browser never takes that branch). No route total, first view, chunk count or round-trip count grows.Evidence and limits
Proves the change: the local comparison lane (
ci.mts --head <this branch> --base <main>), report mode:_astro/<name>.<hash>.jsreferences are normalized; no page added or removed.ipad-slow-start.mts --target <preview> /earth/ /itokawa/, world summary held 1,200 ms): 4 of 4 cold loads reacheddata-ready.Clean:
pnpm typecheck,pnpm check:architecture(0 cycles), eslint on the changed files, site scene, directory, startup and build tests (112 pass).Timing was not measured to the 2% band: the iPad gate checks that startup completes, not how fast.
PR rules