| feat(scene): spawn the Rust renderer as a child process (#960)
JS-side plumbing for the REASONIX_RENDERER=rust runtime switch.
spawnRenderer() starts the reasonix-render binary, returns an
emit(frame) that writes one JSONL line to the child's stdin and a
close() that resolves with the child's exit code.
No app integration yet — this is the wire. The flip-the-flag PR
that decides between Ink and the spawned Rust process lands once
Ink can be mounted to a non-stdout backend, which is its own design
problem (Stage 1's mid-cut).
Why the test uses a Node stub:
- The real binary takes over the terminal (alt screen + raw mode).
Running it in a CI process would be hostile to the test runner.
- The contract we want to test is the JS-side plumbing: spawn
succeeds, frames pipe in order as JSONL, stdin closes cleanly,
exit code surfaces, post-close emit is a no-op. None of that
needs a real terminal — a Node script that echoes stdin lines
to a file is sufficient.
- This also keeps tests Rust-toolchain-free. Future CI doesn't
need to build the crate just to run the JS suite.
The DEFAULT_COMMAND points at cargo run --bin reasonix-render so
that future smoke tests / dev usage works without installing the
binary; release tooling will swap that to the installed binary
path when distribution is wired up.
Refs #868 #947
Co-authored-by: reasonix <reasonix@deepseek.com> | 14 天前 |