Add R/WebAssembly#37
Conversation
bb64fdc to
40c6a37
Compare
cceddce to
149d466
Compare
|
@k88hudson-cfa - this should be ready for your review again - there are 5 staged commits that I hope will ease review. The largest commit, feat(rwasm): add R browser runtime package, adds the core browser runtime for R models. It introduces @cfasim-ui/rwasm, modeled after the existing Pyodide/WASM runtime package shape: public runtime exports, a worker API, a Vue useModel hook, and a Vite plugin. The Vite plugin builds a static webR bundle: it copies the R model source, builds the bundled cfasim R helper package plus the user model/external R packages into a webR-compatible repository via Docker/rwasm, writes a manifest under public/rwasm/{name}, and hosts matching webR runtime assets locally. It also detects R package metadata from DESCRIPTION, supports multiline Imports/Depends, and caches Docker package builds using content hashes so expensive packages are not rebuilt when inputs have not changed. The worker mirrors the Pyodide request/response pattern: each request has an id, responses are routed back to the correct promise, model/session loads are cached, worker crashes drain pending requests through deadError, and there are no hard runtime timeouts. R model outputs are converted into the shared ModelOutput transfer format used by Python and Rust. The commit also wires the new runtime into the unified cfasim-ui package, docs generation, and package metadata. |
Summary
Adds R/rwasm to existing Python/Pyodide and Rust/WASM flows.
Changes
@cfasim-ui/rwasmruntime support for loading R models in the browser.cfasimR helper package for model output construction.cfasim init --template Rwith a minimal R package model and interactive Vue app.Validation