Cargo Features

NLCEP has no features set by default.

[dependencies]
nlcep = { version = "0.7.0", features = ["wasm", "console_error_panic_hook"] }
wasm = js-sys, tsify, wasm-bindgen

Enables js of jiff

jiff:

This enables bindings to web browser APIs for retrieving the current time and configured time zone. This ONLY applies on wasm32-unknown-unknown and wasm64-unknown-unknown targets. Specifically, not on wasm32-wasi or wasm32-unknown-emscripten targets.

This is an "ecosystem" compromise due to the fact that there is no general way to determine at compile time whether a wasm target is intended for use on the "web." In practice, only wasm{32,64}-unknown-unknown targets are used on the web, but wasm{32,64}-unknown-unknown targets can be used in non-web contexts as well. Thus, the js feature should be enabled only by binaries, tests or benchmarks when it is known that the application will be used in a web context.

Libraries that depend on Jiff should not need to define their own js feature just to forward it to Jiff. Instead, application authors can depend on Jiff directly and enable the js feature themselves.

(This is the same dependency setup that the getrandom crate uses.)

Affects nlcep::wasm

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

console_error_panic_hook implicit feature

Enables console_error_panic_hook

console_error_panic_hook:

A panic hook for wasm32-unknown-unknown that logs panics to console.error

js-sys wasm?
tsify wasm?
wasm-bindgen wasm?