diff --git a/CHANGELOG.md b/CHANGELOG.md index f57ffd0..57b0ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ -## wasm-split-cli vfuture +## wasm-split-cli v0.2.5 - Add `Options::cost_model` with a bernoulli model (`--cost-model` in the cli). Shared chunks are merged when that lowers the expected loading time, which weighs the requests saved against the extra bytes loaded. This tends to cut the number of chunks one split module loads from hundreds to tens. The default cost model depends on the target. The web target uses the new cost model, the bundler target keeps the previous output, equivalent to `--cost-model=none`. +- Fix to keep tracing's `log` fallback active when no subscriber is configured. ## wasm-split-cli v0.2.4 diff --git a/Cargo.lock b/Cargo.lock index 58d6575..30d964c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -684,7 +684,7 @@ dependencies = [ [[package]] name = "wasm_split_cli_support" -version = "0.2.4" +version = "0.2.5" dependencies = [ "clap", "eyre", diff --git a/crates/wasm_split_cli/Cargo.toml b/crates/wasm_split_cli/Cargo.toml index 90b353c..670996b 100644 --- a/crates/wasm_split_cli/Cargo.toml +++ b/crates/wasm_split_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasm_split_cli_support" -version = "0.2.4" +version = "0.2.5" authors.workspace = true categories.workspace = true edition.workspace = true diff --git a/integration/runner.sh b/integration/runner.sh index 5eb0f5c..73894d0 100755 --- a/integration/runner.sh +++ b/integration/runner.sh @@ -5,6 +5,7 @@ export XRUSTUP_TOOLCHAIN="$RUSTUP_TOOLCHAIN" export XCARGO_BIN_NAME="$CARGO_BIN_NAME" export XCARGO_MANIFEST_PATH="$CARGO_MANIFEST_PATH" export XCARGO_TARGET_TMPDIR="$CARGO_TARGET_TMPDIR" +export XCARGO_TARGET_DIR="$CARGO_TARGET_DIR" export XCARGO_PKG_NAME="$CARGO_PKG_NAME" -unset RUSTUP_TOOLCHAIN CARGO # make sure the below invocation is done with the toolchain in test-runner +unset RUSTUP_TOOLCHAIN CARGO CARGO_TARGET_DIR OUT_DIR # make sure the below invocation is done with the toolchain in test-runner cargo run --release -p wasm-split-test-runner -- "$@" diff --git a/test-runner/Cargo.lock b/test-runner/Cargo.lock index 4b43e6c..beb8650 100644 --- a/test-runner/Cargo.lock +++ b/test-runner/Cargo.lock @@ -1234,7 +1234,7 @@ dependencies = [ [[package]] name = "wasm_split_cli_support" -version = "0.2.4" +version = "0.2.5" dependencies = [ "eyre", "fixedbitset", diff --git a/test-runner/src/bin/wasm-split-test-runner.rs b/test-runner/src/bin/wasm-split-test-runner.rs index b6929ab..31f493d 100644 --- a/test-runner/src/bin/wasm-split-test-runner.rs +++ b/test-runner/src/bin/wasm-split-test-runner.rs @@ -53,10 +53,24 @@ fn wasm_bindgen_test_runner() -> Command { ) } -#[derive(PartialEq, Eq, Serialize)] +#[derive(PartialEq, Eq)] #[repr(transparent)] -#[serde(transparent)] struct ContentHash([u8; 32]); +impl Serialize for ContentHash { + fn serialize(&self, serializer: S) -> std::prelude::v1::Result + where + S: serde::Serializer, + { + // inline impl of hex::encode + let mut bytes = [0u8; 64]; + for (i, &byte) in self.0.iter().enumerate() { + const TABLE: &[u8; 16] = b"0123456789abcdef"; + bytes[2 * i] = TABLE[((byte & 0xf0) >> 4) as usize]; + bytes[2 * i + 1] = TABLE[(byte & 0x0f) as usize]; + } + serializer.serialize_str(str::from_utf8(&bytes).unwrap()) + } +} impl std::fmt::Debug for ContentHash { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { for d in &self.0 {