loro-crdt 1.13.9 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/base64/index.js +353 -143
- package/base64/loro_wasm.d.ts +18 -16
- package/browser/index.js +7 -10
- package/browser/loro_wasm.d.ts +18 -16
- package/browser/loro_wasm.js +27 -34
- package/browser/loro_wasm_bg.js +338 -131
- package/browser/loro_wasm_bg.wasm +0 -0
- package/browser/loro_wasm_bg.wasm.d.ts +22 -22
- package/bundler/index.js +7 -10
- package/bundler/loro_wasm.d.ts +18 -16
- package/bundler/loro_wasm.js +6 -4
- package/bundler/loro_wasm_bg.js +338 -131
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +22 -22
- package/nodejs/loro_wasm.d.ts +18 -16
- package/nodejs/loro_wasm.js +340 -133
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +22 -22
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +40 -38
- package/web/loro_wasm.js +338 -128
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 76cc0f9: Make `importBatch` atomic and never leave the document detached.
|
|
8
|
+
|
|
9
|
+
`importBatch` force-detaches the document so each blob only touches the OpLog, then
|
|
10
|
+
reattaches with a single checkout at the end. Two exits skipped that reattach and
|
|
11
|
+
stranded the document in detached mode, where later imports stop being reflected in
|
|
12
|
+
the state, local edits branch off a stale version, and every later `attach()` re-runs
|
|
13
|
+
the same failing checkout:
|
|
14
|
+
|
|
15
|
+
- The closing checkout was `expect`ed to succeed. Remote ops that decode fine but are
|
|
16
|
+
rejected by state validation (for example a list insert past the end of the list)
|
|
17
|
+
only reach that validation here, because the blobs were imported while detached, so
|
|
18
|
+
a malformed blob turned into a panic — a `RuntimeError: unreachable` trap in WASM —
|
|
19
|
+
after the document had already been left detached.
|
|
20
|
+
- Any other panic while decoding or applying a blob unwound past the reattach.
|
|
21
|
+
|
|
22
|
+
The batch now runs inside an OpLog rollback scope. If the closing checkout cannot
|
|
23
|
+
apply the accumulated changes, the whole batch is rolled back and `importBatch`
|
|
24
|
+
returns the state-apply error with the document still attached and unchanged, instead
|
|
25
|
+
of trapping. A panic inside the batch reattaches before it is re-raised.
|
|
26
|
+
|
|
27
|
+
The pending-changes rollback journal now snapshots each touched slot as it was when
|
|
28
|
+
the scope began, instead of undoing individual mutations. The previous two-phase undo
|
|
29
|
+
resurrected changes that the same import both parked and unlocked — routine across a
|
|
30
|
+
batch — leaving pending entries that referenced container registrations the rollback
|
|
31
|
+
had already discarded, and pre-batch pending changes unlocked by a rolled-back batch
|
|
32
|
+
are now re-parked instead of silently dropped.
|
|
33
|
+
|
|
34
|
+
`importBatch` of out-of-order updates is also considerably faster: the import preflight
|
|
35
|
+
no longer rescans the whole pending set once per blob, which made such a batch
|
|
36
|
+
quadratic. Draining 12000 out-of-order updates in one `importBatch` goes from ~3.4s to
|
|
37
|
+
~0.45s, with peak memory unchanged. In-order batches and single `import` calls are
|
|
38
|
+
unaffected.
|
|
39
|
+
|
|
40
|
+
## 1.14.0
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- bbf21c3: fix: avoid unreadable WASM traps (`RuntimeError: unreachable executed`) on invalid arguments. `getCursor` with an invalid `side`, `getEditorOf` at an out-of-range position, and accessing an unknown container (created by a newer version of loro-crdt) now throw catchable JS errors with readable messages or return `undefined` instead of trapping the WASM instance.
|
|
45
|
+
|
|
46
|
+
feat: on a Rust panic, the full panic info (message, `file:line`, and the complete stack including the Rust call path) is now stored as a JS `Error` on `globalThis.__LORO_WASM_LAST_PANIC__` before the instance traps, so applications can recover readable diagnostics from a caught `RuntimeError`.
|
|
47
|
+
|
|
48
|
+
fix: the WASM start hook was never invoked in the `bundler`/`browser`/`base64` builds (the glue checked the JS namespace instead of the wasm exports for `__wbindgen_start`), so no panic hook was installed there at all. The start hook now runs in every build target.
|
|
49
|
+
|
|
50
|
+
feat: out-of-memory failures are now reported too. Allocation failure in WASM bypasses the panic hook and traps silently; the package now wraps the global allocator so OOM stores `loro-crdt: out of WASM memory: allocation of N bytes failed` on `globalThis.__LORO_WASM_LAST_PANIC__` and prints it to `console.error` before trapping.
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- bbcaef6: Fix a panic on import that could permanently break a document's sync.
|
|
55
|
+
|
|
56
|
+
`import_changes_to_oplog` defers the changes whose deps are not yet in the DAG
|
|
57
|
+
and hands them to `extend_pending_changes_with_unknown_lamport` to be parked.
|
|
58
|
+
`try_apply_pending` runs in between and applies changes parked by earlier
|
|
59
|
+
imports, which advances the oplog version, so a deferred change can become
|
|
60
|
+
applicable — or already applied — by the time it is parked. Both outcomes used
|
|
61
|
+
to hit `unreachable!`, compiling to `RuntimeError: unreachable` in WASM.
|
|
62
|
+
|
|
63
|
+
The re-classification is now handled instead of asserted: a change that became
|
|
64
|
+
applicable is applied and cascaded into whatever it unblocks, an already-applied
|
|
65
|
+
one is skipped, and `ImportStatus` reports only what genuinely stayed pending.
|
|
66
|
+
|
|
67
|
+
This mattered most through `import_batch`, which force-detaches the document for
|
|
68
|
+
the duration of the batch and reattaches after the loop. The panic unwound past
|
|
69
|
+
the reattach and left the document detached, so every later import and export
|
|
70
|
+
failed and the document stopped syncing until the process restarted.
|
|
71
|
+
|
|
3
72
|
## 1.13.9
|
|
4
73
|
|
|
5
74
|
### Patch Changes
|