From 27efbe8cd06c766d50d05dd6ea812aa8bbe6ae7f Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sun, 24 Nov 2024 23:15:16 -0500 Subject: [PATCH] fix build details --- Cargo.toml | 3 --- readme.md | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 490c91d..45e6ac5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,3 @@ wasm-bindgen = "0.2" [lib] crate-type = ["cdylib"] -# suppress the lint warning for the #[wasm_bindgen] directive in lib.rs -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['wasm_bindgen']} diff --git a/readme.md b/readme.md index f6d650c..adf7635 100644 --- a/readme.md +++ b/readme.md @@ -2,3 +2,11 @@ A dead-simple, no-bundling, web-servable Rust/WASM/JS template. "Hello, world" style. For use in the Rust Ludus backend. + +### Things to remember +* Use `js_sys` and `web_sys` for general JS and Web bindings. +* Ludus, however, speaks in JSON strings and requires a hand-written JS wrapper, which should make the whole JS interop thing much easier. + - For that, we use `serde_json`. +* The canonical reference for all this is https://rustwasm.github.io/wasm-bindgen/introduction.html. +* Look into what thi.ng does with Zig in its WASM packages: https://github.com/thi-ng/umbrella/tree/develop/packages, especially https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api. + - It's looking like `--target web` is the most appropriate to use in 2024, since they use ES modules and not CommonJS, which is what everything else uses (and necessitates the build step). See https://rustwasm.github.io/wasm-pack/book/commands/build.html.