Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/wasm_split_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion integration/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -- "$@"
2 changes: 1 addition & 1 deletion test-runner/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions test-runner/src/bin/wasm-split-test-runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>(&self, serializer: S) -> std::prelude::v1::Result<S::Ok, S::Error>
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 {
Expand Down
Loading