Skip to content

Consume comline-simulator as a git dependency - #40

Merged
Kinflou merged 1 commit into
masterfrom
feat/sim-as-git-dep
Sep 3, 2026
Merged

Consume comline-simulator as a git dependency#40
Kinflou merged 1 commit into
masterfrom
feat/sim-as-git-dep

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 3, 2026

Copy link
Copy Markdown
Member

Removes the sim-wasm/ wrapper crate. comline-simulator
(github:ComlineProject/simulator) now builds itself to WASM in its
prepare on npm installpkg/ (lean) + pkg-script/ (Rhai) — so the
playground carries no sim build of its own.

Changes

  • sim-wasm/ deleted. app/package.json: comline-simulator git dep;
    the sim-wasm / sim-wasm:script / wasm:all scripts are gone; dev is
    just npm run wasm && vite (editor WASM only).
  • view.ts / tests import comline-simulator and, lazily,
    comline-simulator/pkg-script/comline_simulator.js. Vite still code-splits
    the ~2 MB scripted wasm — it only downloads when a script behaviour is
    picked.
  • main.ts bug fixenterSimulate() now awaits the sim wasm init
    before new Sim(). It never did; the tests init explicitly, so the
    regression (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.yml drops the two sim wasm-pack steps (npm install builds the
    sim now); keeps the editor wasm-pack step and a cargo cache
    (~/.cargo/bin + key on package-lock.json) for the one-time
    wasm-bindgen-cli compile. Runner has cargo + wasm-opt.
  • .gitignore / README updated.

Checks

npm test (20 view tests, incl. 2f scripted from
node_modules/comline-simulator/pkg-script/) and npm run build pass;
build output keeps comline_simulator as a split async chunk.

Before merging

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.
@Kinflou
Kinflou merged commit a0fbbd7 into master Sep 3, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/sim-as-git-dep branch September 3, 2026 18:25
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