mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-06 05:33:38 -10:00
PA12: runtime/ecs builds as a cdylib for wasm32 (src/wasm.rs; sdk/playable/ecs/build.sh: 253 KB, 105 KB gzipped, no imports) into sdk/playable/src/host/ecs.wasm, with the hash of what it was built from beside it, which apps/playable's test checks. The lint's walk sees a World made; the export carries the module and its entry loads host/ecs.ts before the game, so raea/ecs's calls (native.ts ecsCall: the engine's bridge, else the page's) reach Bevy's tables in the page as they do in the engine. A page that can't make the module keeps raea/ecs's TypeScript tables. World.copy() is a game's next state (copied with its systems, stepped on its own), and a native store nothing holds frees its world, so a game's let-go states don't keep theirs. examples/playables/star-catch.tsx is a game whose rules are three systems on a World; conformance/ecs-wasm.test.ts runs one world's life on the wasm and on the TypeScript tables and finds them equal. The playable guide shows the pattern. Co-authored-by: shinyobjectz <[email protected]>