Repository navigation
v0.1.42
Serve chronos to the browser, wasm included
aurora already serves @c9up/comet automatically so the RPC client's
bare import resolves with no app wiring. chronos needs the same, and
cannot have it the same way.
comet is one directory. chronos's dist/native.js reaches out with
import("../wasm/chronos_engine_wasm.js"), a SIBLING of the dist, and
wasm-bindgen's glue then fetches the binary beside itself -- so serving
the dist alone answers 404 twice. Serving the package root instead
would work and would also publish the five .node binaries, some 13 MB
of server-only code, over HTTP. Two narrow roots keep the relative path
intact and expose nothing else: the importmap points INTO dist, so
../wasm lands on the second route rather than climbing out of the
prefix.
serveAssets also had no .wasm content type, and application/wasm is not
cosmetic: WebAssembly.instantiateStreaming refuses anything else, and
the bindgen glue calls it first. Served as octet-stream the module
compiles nowhere.
Both routes are skipped when chronos is not installed, as comet's is.
Changes since v0.1.41.