Skip to content

Commit

Permalink
fix: upgrade wasm-bindgen to fix str free err (#353)
Browse files Browse the repository at this point in the history
* fix: upgrade wasm-bindgen to fix str free err

* chore: fix ci
  • Loading branch information
zxch3n committed May 9, 2024
1 parent 7e20c17 commit 0660b1a
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- run: rustup target add wasm32-unknown-unknown
- uses: jetli/wasm-bindgen-action@v0.2.0
with:
version: "0.2.90"
version: "0.2.92"
- uses: Swatinem/rust-cache@v2
- name: Build WASM release-build
run: pnpm release-wasm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: rustup target add wasm32-unknown-unknown
- uses: jetli/wasm-bindgen-action@v0.2.0
with:
version: "0.2.90"
version: "0.2.92"
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
3. **Node**: Install from the Node.js website.
4. **pnpm**: Run `npm i -g pnpm` for global installation.
5. **Rust Target**: Add with `rustup target add wasm32-unknown-unknown`.
6. **wasm-bindgen-cli**: Install version 0.2.90 via `cargo install wasm-bindgen-cli --version 0.2.90`.
6. **wasm-bindgen-cli**: Install version 0.2.92 via `cargo install wasm-bindgen-cli --version 0.2.92`.
6. **wasm-opt**: Install using `cargo install wasm-opt --locked`.
7. **wasm-snip**: Install using `cargo install wasm-snip`.
8. **cargo-nextest**: Install using `cargo install cargo-nextest --locked`.
Expand Down
20 changes: 10 additions & 10 deletions 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/loro-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ keywords = ["crdt", "local-first"]
rle = { path = "../rle", version = "0.5.1", package = "loro-rle" }
serde = { version = "1", features = ["derive"] }
thiserror = "1.0.43"
wasm-bindgen = { version = "=0.2.90", optional = true }
wasm-bindgen = { version = "=0.2.92", optional = true }
fxhash = "0.2.1"
enum-as-inner = "0.6.0"
string_cache = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ num = "0.4.0"
rand = { version = "0.8.5" }
arbitrary = { version = "1", optional = true }
tabled = { version = "0.10.0", optional = true }
wasm-bindgen = { version = "=0.2.90", optional = true }
wasm-bindgen = { version = "=0.2.92", optional = true }
serde-wasm-bindgen = { version = "0.5.0", optional = true }
js-sys = { version = "0.3.60", optional = true }
serde_json = { version = "1" }
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
js-sys = "0.3.60"
loro-internal = { path = "../loro-internal", features = ["wasm"] }
wasm-bindgen = "=0.2.90"
wasm-bindgen = "=0.2.92"
serde-wasm-bindgen = { version = "0.5.0" }
wasm-bindgen-derive = "0.2.1"
console_error_panic_hook = { version = "0.1.6", optional = true }
Expand Down
6 changes: 6 additions & 0 deletions loro-js/tests/richtext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,10 @@ describe("richtext", () => {
const ans = doc.getCursorPos(pos3!);
expect(ans.offset).toBe(3);
});

it("Insert cursed str", () => {
const doc = new Loro();
const text = doc.getText("text");
text.insert(0, `“aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`);
});
});
Empty file added loro-js/tests/text.ts
Empty file.

0 comments on commit 0660b1a

Please sign in to comment.