Browse Source

Make the `wasmbind` feature of the `chrono` crate optional (#2810)

This Pull Request fixes/closes #2475.

It changes the following:

- Do not use the `wasmbind` feature by default in the `chrono` crate. This can be enabled selectively if needed.
- Updated the `boa_wasm` crate to use this new approach.

I'm interested on knowing if this fixes @lastmjs's issue, and on checking with the team if this is the best approach to solve it.
pull/2812/head
Iban Eguia Moraza 2 years ago
parent
commit
6412b30d5d
  1. 1
      Cargo.lock
  2. 2
      boa_engine/Cargo.toml
  3. 1
      boa_wasm/Cargo.toml
  4. 1
      boa_wasm/src/lib.rs

1
Cargo.lock generated

@ -560,6 +560,7 @@ name = "boa_wasm"
version = "0.16.0" version = "0.16.0"
dependencies = [ dependencies = [
"boa_engine", "boa_engine",
"chrono",
"getrandom", "getrandom",
"wasm-bindgen", "wasm-bindgen",
] ]

2
boa_engine/Cargo.toml

@ -60,7 +60,7 @@ num-integer = "0.1.45"
bitflags = "2.1.0" bitflags = "2.1.0"
indexmap = "1.9.3" indexmap = "1.9.3"
ryu-js = "0.2.2" ryu-js = "0.2.2"
chrono = { version = "0.4.24", default-features = false, features = ["clock", "std", "wasmbind"] } chrono = { version = "0.4.24", default-features = false, features = ["clock", "std"] }
fast-float = "0.2.0" fast-float = "0.2.0"
unicode-normalization = "0.1.22" unicode-normalization = "0.1.22"
once_cell = "1.17.1" once_cell = "1.17.1"

1
boa_wasm/Cargo.toml

@ -15,6 +15,7 @@ rust-version.workspace = true
boa_engine = { workspace = true, features = ["console", "annex-b"] } boa_engine = { workspace = true, features = ["console", "annex-b"] }
wasm-bindgen = "0.2.84" wasm-bindgen = "0.2.84"
getrandom = { version = "0.2.9", features = ["js"] } getrandom = { version = "0.2.9", features = ["js"] }
chrono = { version = "0.4.24", features = ["clock", "std", "wasmbind"] }
[lib] [lib]
crate-type = ["cdylib", "lib"] crate-type = ["cdylib", "lib"]

1
boa_wasm/src/lib.rs

@ -58,6 +58,7 @@
)] )]
use boa_engine::{Context, Source}; use boa_engine::{Context, Source};
use chrono as _;
use getrandom as _; use getrandom as _;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;

Loading…
Cancel
Save