Add wasm-bindgen to instant crate for wasm.

This commit is contained in:
Stephen Chung 2020-06-18 09:37:44 +08:00
parent 2a73841549
commit 2f815e277d
2 changed files with 7 additions and 3 deletions

View File

@ -65,4 +65,4 @@ features = ["compile-time-rng"]
optional = true
[target.'cfg(target_arch = "wasm32")'.dependencies]
instant= "0.1.4" # WASM implementation of std::time::Instant
instant= { version = "0.1.4", features = ["wasm-bindgen"] } # WASM implementation of std::time::Instant

View File

@ -14,7 +14,9 @@ to add scripting to any application.
Supported targets
-----------------
* All common targets, including [WASM] and `no-std`.
* All common CPU targets for Windows, Linux and MacOS.
* [WASM]
* `no-std`
Features
--------
@ -185,9 +187,11 @@ When building for WASM, certain features will not be available, such as the scri
from external script files.
Also look into [minimal builds] to reduce generated WASM size. As of this version, a typical, full-featured
Rhai scripting engine compiles to a single WASM file around 200KB gzipped. When excluding features that are
Rhai scripting engine compiles to a single WASM file less than 200KB gzipped. When excluding features that are
marginal in WASM environment, the gzipped payload can be further shrunk to 160KB.
In benchmark tests, a WASM build runs scripts roughly 1.7-2.2x slower than a native optimized release build.
Related Resources
-----------------