Repository navigation
Load the browser game behind Strata's loading shell - #17
Merged
Merged
Conversation
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
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.
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'sweb/kit/, vendored at 901e6c9 inweb/strata-kit/withPIN,SHA256SUMS,LICENSEandupdate.sh, the same way gardener vendors the kit):https://danielstephenson.dev/trailers/.role=progressbar. The loader streams the.wasmand hands its bytes to the engine, so nothing downloads twice.prefers-reduced-motion, the still is shown instead of the clip.?benchruns.How it is wired
web/strata-boot.jsbridges 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 inModule.instantiateWasmfor the loader's bytes.web/strata_page.cmakeruns 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 noContent-Length.#loadingbox now only shows in-game errors.window.steadingand?benchare unchanged.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.cjspassed on desktop and phone (iPhone 13), including the new shell checks.web/smoke/bench.cjs ?bench=3passed on desktop and phone.ctest(wasm under Node) passed: 5/5.steading.status().tickadvancing, the canvas not blank, and the shell gone.Drafted by Claude on behalf of Daniel Stephenson.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeuo5Ry76i84tz6WXQSE