Consume comline-simulator as a git dependency - #40
Merged
Conversation
Drops the `sim-wasm/` wrapper crate. `comline-simulator` (github:ComlineProject/simulator) builds itself to WASM in its `prepare` on `npm install` — `pkg/` (lean) and `pkg-script/` (Rhai) — so there's nothing to wasm-pack here for the sim. - `app/src/sim/ui/view.ts` / tests import from `comline-simulator` and `comline-simulator/pkg-script/comline_simulator.js`; the lazy scripted import still code-splits. - `app/src/main.ts` now `await`s the sim wasm init before entering the simulate view — it was never initialised, so the deployed view has been broken since the TS engine was removed (#37). Tests init explicitly, which is why it went unnoticed. - `deploy.yml` drops the two sim wasm-pack steps (npm install covers them); keeps the editor wasm-pack + a cargo cache for the one-time wasm-bindgen-cli build. 20 view tests + the build pass. Repin the dep to the simulator#17 merge SHA before this lands.
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.
Removes the
sim-wasm/wrapper crate.comline-simulator(
github:ComlineProject/simulator) now builds itself to WASM in itsprepareonnpm install—pkg/(lean) +pkg-script/(Rhai) — so theplayground carries no sim build of its own.
Changes
sim-wasm/deleted.app/package.json:comline-simulatorgit dep;the
sim-wasm/sim-wasm:script/wasm:allscripts are gone;devisjust
npm run wasm && vite(editor WASM only).view.ts/ tests importcomline-simulatorand, lazily,comline-simulator/pkg-script/comline_simulator.js. Vite still code-splitsthe ~2 MB scripted wasm — it only downloads when a
scriptbehaviour ispicked.
main.tsbug fix —enterSimulate()nowawaits the sim wasm initbefore
new Sim(). It never did; the tests init explicitly, so theregression (since the TS engine was removed in feat: SimView on the wasm engine #37) went unseen. The
deployed simulate view was throwing
__wbindgen_malloc undefined.deploy.ymldrops the two sim wasm-pack steps (npm install builds thesim now); keeps the editor
wasm-packstep and a cargo cache(
~/.cargo/bin+ key onpackage-lock.json) for the one-timewasm-bindgen-clicompile. Runner hascargo+wasm-opt..gitignore/ README updated.Checks
npm test(20 view tests, incl.2fscripted fromnode_modules/comline-simulator/pkg-script/) andnpm run buildpass;build output keeps
comline_simulatoras a split async chunk.Before merging
package-lock.jsonfrom thefeat/prepare-builds-scriptedbranch to the feat(sim): behaviours, session model, engine #17 merge SHA.