Skip to content

A real React game, ingested unmodified

cli tutorial Advanced ⏱ 3 min vgai 0.1.0

Prerequisites: Ingest an unmodified three.js game

What you'll learn

  • Know what "native-React game ingestion" is (and is not), and how to open react-rpg in the editor
  • See the byte-for-byte "zero source diff" proof against the upstream commit

What you'll build: A terminal look at the vendored real React game, its unaltered-source verification, and how to run it live.

The ingest adapter family has a third member beside the three.js and PixiJS routes: native-React DOM games — games whose UI is React components, with no canvas renderer at all. There is nothing to trap or capture; instead the unmodified game’s component tree mounts as a DOM layer in the host stack, its React import deduped onto the editor’s own React 19. The proven game is react-rpg.com (MIT): menu, character creation, and dungeon crawling all run live inside the editor.

# transcript pending capture — run: node site/media/capture-cli.mjs
Terminal — A real React game, ingested unmodified · captured by site/media/capture-cli.mjs
  1. The vendored game. vendor/react-games/react-rpg/ holds the complete upstream tree — 620 tracked files including every sprite/tile PNG and audio file — pinned to one upstream commit by react-rpg.UPSTREAM.lock (repo, commit, license, and a per-file sha256 manifest).

  2. Prove zero source diff. node vendor/react-games/verify-unaltered.mjs checks every tracked file byte-for-byte against the manifest. The same check runs in CI on every PR — a one-byte edit to the vendored game turns the build red.

  3. Run it yourself. No build step: the game’s dependencies are installed at the repo root and its source is tracked, so it mounts straight through the dev server:

    Terminal window
    npm run dev # then open http://localhost:5173/packages/editor/editor.html?ingest=react-rpg

    The game mounts through its manifest (packages/editor/src/ingest/games-react/react-rpg/), whose host shim replicates the page environment the game expects — the editor plays it in the Game tab while the editor’s own panels keep working.

Recap

New functionality

  • Read the upstream pin for the vendored react-rpg
  • Ran the byte-for-byte unaltered-source verification
  • Opened a real React game in the editor with ?ingest=react-rpg

New concepts & skills

  • native-React DOM games mount unmodified as a DOM layer, deduped onto the host React 19
  • there is no renderer to capture — and no authoring: react ingests are embed-only by design
  • the vendored tree is checked byte-for-byte against its upstream commit in CI, on every PR
  • R3F/@pixi/react games are canvas games — they use the three.js/PixiJS routes

Next lesson → Real PixiJS games, ingested unmodified