Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
What ships is what runs, for the shooter too: the committed app bundle boots under the stub page #97
Check · Review · Land · Live done — Landed and live in production.
`src/client/bundle.test.ts` boots `static/app.<hash>.js` — the file a browser actually downloads — instead of the sources: it installs the stub page from `stage.test-helper.ts` as the globals the shipped entry reads for itself (`document`, `window`, `localStorage`, `fetch`) and imports the committed bundle by `file://` URL. Five tests: the import alone finds the page's ids and asks for a frame, up…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/client/bundle.test.tsbootsstatic/app.<hash>.js— the file a browser actually downloads — instead of the sources: it installs the stub page fromstage.test-helper.tsas the globals the shipped entry reads for itself (document,window,localStorage,fetch) and imports the committed bundle byfile://URL. Five tests: the import alone finds the page's ids and asks for a frame, uploads the game's nine 128² atlas layers, and binds the touch buttons; a click on play hides the menu, takes the pointer, shows the phone pad, writes the name to the store, and one frame later has drawn the room through the canvas's own WebGL2 recorder, painted the HUD through the recordingPaint($800,T Vesper (you)), set the fps line and posted once to the stubfetch; a browser with no WebGL2 leaves the sameNo WebGL2sentencemain.test.tspins and starts nothing; a page still parsing is waited for untilDOMContentLoaded; and a last test checks every installed global was handed back.Finding the committed bundle and importing it afresh now lives in
scripts/bundle.test-helper.ts, shared withsrc/range/bundle.test.tsrather than copied —src/independence.test.tslets a range test reach for it besidescripts/build.ts, and a range module still may not. Nothing here rebuilds the bundle; freshness staysscripts/build.test.ts's rule.The one thing the issue did not expect:
src/client/stage.test-helper.tsneeded more than new exports.boot(host)is handed a renderer, but the shipped entry builds its own from the canvas it finds, so the stub scene canvas now answersgetContext("webgl2")with aglRecorder(null underwebgl: false, the same switch as before), the stub document carriesreadyState, andinstall()puts the four globals in place and hands back their undo.main.test.tsis untouched and unaffected.How I checked it bites: truncating the committed bundle to its first 30 KB for one run fails two tests with
error: Unexpected end of file; editing a copy so the entry looks for"touchy"instead of"touch"fails the match test withTypeError: null is not an object (evaluating 'q.hidden = !V'). Both were run against an edited copy and the original restored —static/is unchanged in this branch. No network, no database, noFORGE_APP_*;bun testis 508 pass / 0 fail and goes from ~4.8 s to ~5.2 s.🤖 Generated with Claude Code
Closes #43