Skip to content

Load the browser game behind Strata's loading shell - #17

Merged
dmccoystephenson merged 1 commit into
mainfrom
strata-loading-shell
Oct 28, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
strata-loading-shell

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

What changes

The browser page used to show "Loading steading…" on black while the engine downloaded. It now loads behind the Strata web kit's loading shell (strata-loader.js, from Strata's web/kit/, vendored at 901e6c9 in web/strata-kit/ with PIN, SHA256SUMS, LICENSE and update.sh, the same way gardener vendors the kit):

  • Backdrop: the /play trailer's first frame, blurred, from https://danielstephenson.dev/trailers/.
  • Progress: byte-accurate, with the size, and role=progressbar. The loader streams the .wasm and hands its bytes to the engine, so nothing downloads twice.
  • Fallback: when the live view can't run (no WebGL 2, the renderer fails, the engine stops, a lost WebGL context does not come back), the trailer plays with the reason in words and a "More games" link. Under prefers-reduced-motion, the still is shown instead of the clip.
  • Slow devices: a device drawing under 12 frames a second over 8 s is offered the clip without losing the live view. This check is skipped in automated browsers and ?bench runs.

How it is wired

  • web/strata-boot.js bridges this classic (non-MODULARIZE) build to the loader. emcc's {{{ SCRIPT }}} tag sits inert in <template id="strata-glue">. The bridge starts the glue, and the engine waits in Module.instantiateWasm for the loader's bytes.
  • web/strata_page.cmake runs after each link. It puts the loader and the bridge inline in the page, so the site is still the same four files and the workflow is unchanged. It also stamps the download's size on the template, because the arcade compresses on the fly and sends no Content-Length.
  • The #loading box now only shows in-game errors. window.steading and ?bench are unchanged.
  • The smoke test now checks that the shell finishes. It also checks that without WebGL 2 the shell says why and downloads nothing of the engine.

Checked locally

The build used emsdk 6.0.11 and Strata c2d7ee4. It was served by a local server that gzips on the fly with no Content-Length, as the arcade does.

  • web/smoke/smoke.cjs passed on desktop and phone (iPhone 13), including the new shell checks.
  • web/smoke/bench.cjs ?bench=3 passed on desktop and phone.
  • ctest (wasm under Node) passed: 5/5.
  • arcade-watch's strata check, run locally on desktop, passed: wasm instantiated, WebGL 2, frames and draws advancing, steading.status().tick advancing, the canvas not blank, and the shell gone.
  • Screenshots were taken at 390×844 of the loading state, a throttled download part way, and the no-WebGL 2 fallback with and without reduced motion.

Drafted by Claude on behalf of Daniel Stephenson.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeuo5Ry76i84tz6WXQSE

The page used to show "Loading steading..." on black while the engine
downloaded. It now loads behind the Strata web kit's loading shell
(strata-loader.js, vendored at Strata 901e6c9 with its PIN, SHA256SUMS,
LICENSE and update.sh): the /play trailer's first frame as a blurred
backdrop, in the page's colours, and byte-accurate progress with the size.
The loader streams steading.wasm and hands the bytes to the engine, so
nothing downloads twice.

When the game can't run (no WebGL 2, the renderer fails, the engine stops,
a lost WebGL context does not come back) the shell plays the trailer and
says why; under prefers-reduced-motion it shows the still. A device drawing
under 12 frames a second is offered the clip without losing the game; that
watch is skipped in automated browsers and ?bench runs.

web/strata-boot.js bridges this classic (non-MODULARIZE) build to the
loader: emcc's script tag is kept inert in a template, the bridge starts it,
and the engine waits in Module.instantiateWasm for the loader's bytes.
After each link web/strata_page.cmake puts the loader and the bridge inline
in the page, so the site is still the same four files, and stamps the
download's size, since the arcade compresses on the fly with no
Content-Length. The smoke test now checks that the shell finishes, and that
without WebGL 2 it says why and downloads nothing of the engine.

drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeuo5Ry76i84tz6WXQSE
@dmccoystephenson
dmccoystephenson merged commit 1bc2c3b into main Oct 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant