Files

42 lines
1.9 KiB
TOML

[package]
name = "improvise-worker-server"
version = "0.1.0-rc2"
edition = "2024"
description = "Worker-hosted improvise server: the authoritative App in a browser Web Worker, over postMessage + OPFS"
license = "Apache-2.0"
repository = "https://github.com/fiddlerwoaroof/improvise"
publish = false
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
improvise-core = { path = "../improvise-core" }
improvise-io = { path = "../improvise-io" }
improvise-protocol = { path = "../improvise-protocol" }
improvise-command = { path = "../improvise-command" }
anyhow = "1"
serde = { version = "1", features = ["derive"] }
# Parses frames, so it must read back the f64 that was written: per crate, because
# the wasm bundle builds alone (improvise-6oy4, context/code/protocol.md).
serde_json = { version = "1", features = ["float_roundtrip"] }
# The browser half. Only the wasm build pulls these in, so `cargo test` on the
# host builds and drives `worker.rs`/`vfs.rs` with no JS anywhere near them —
# which is the whole reason the decisions live there and not in `bindings.rs`.
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
# `#[wasm_bindgen] pub async fn` expands to a `future_to_promise`, so the
# generated code names this crate even though nothing here does.
wasm-bindgen-futures = "0.4"
# The bundled `wasm-opt` predates two features being enabled by default, while
# LLVM emits both regardless, so the validator rejects the module unless each
# is named. `bulk-memory` is the one improvise-wasm-client already needs
# (`memory.copy`). This bundle needs a second: it carries the whole `App`, and
# so chrono's date arithmetic, which compiles to `i64.trunc_sat_f64_u` —
# `nontrapping-float-to-int`. Naming them keeps the optimizer in the loop
# rather than turning it off, which matters here: it is 22% of this bundle.
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-bulk-memory", "--enable-nontrapping-float-to-int"]