loro-crdt 1.14.0 → 1.15.0
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 +99 -0
- package/base64/index.js +155 -127
- package/base64/loro_wasm.d.ts +42 -20
- package/browser/index.js +5 -5
- package/browser/loro_wasm.d.ts +42 -20
- package/browser/loro_wasm.js +15 -15
- package/browser/loro_wasm_bg.js +149 -121
- package/browser/loro_wasm_bg.wasm +0 -0
- package/browser/loro_wasm_bg.wasm.d.ts +6 -3
- package/bundler/index.js +5 -5
- package/bundler/loro_wasm.d.ts +42 -20
- package/bundler/loro_wasm_bg.js +149 -121
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +6 -3
- package/nodejs/loro_wasm.d.ts +42 -20
- package/nodejs/loro_wasm.js +152 -124
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +6 -3
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +48 -23
- package/web/loro_wasm.js +148 -120
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,104 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5ea2e37: Add `pause()`, `resume()`, and `isPaused()` to `UndoManager`. While paused,
|
|
8
|
+
local edits are not recorded as undo steps and checkout events do not clear the
|
|
9
|
+
stacks. Import events (remote changes) are still processed so that the stacks
|
|
10
|
+
remain correctly transformed against concurrent edits. Use this to preserve
|
|
11
|
+
undo/redo history across temporary checkouts such as read-only history previews.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 4d3d3f1: Shallow snapshot export no longer leaks the values of rich-text marks whose
|
|
16
|
+
whole range was deleted before the shallow root.
|
|
17
|
+
|
|
18
|
+
Deleting styled text removes the characters but keeps the style anchors, and the
|
|
19
|
+
shallow-root state encoding shipped each anchor's value verbatim — so a mark
|
|
20
|
+
value (e.g. an inline comment) that every read API already reported as gone
|
|
21
|
+
still appeared in the exported bytes, defeating the documented content-redaction
|
|
22
|
+
use of shallow snapshots. Dead style pairs now have their values nulled during
|
|
23
|
+
export (anchors stay, so positions and replay are unaffected). Styles that only
|
|
24
|
+
become dead after the shallow root keep their values so historical checkouts
|
|
25
|
+
render correctly, and styles configured with `expand: "both"` are kept because
|
|
26
|
+
an empty both-expand pair still applies to future inserts. Re-exporting a
|
|
27
|
+
shallow snapshot produced by an older version also cleans it.
|
|
28
|
+
|
|
29
|
+
- 4837d07: Fix unbounded degradation when re-asserting identical text marks over styled ranges.
|
|
30
|
+
|
|
31
|
+
`mark` already tried to skip no-op marks, but the check used
|
|
32
|
+
`StyleRangeMap::get_styles_of_range`, which returns `None` whenever the marked
|
|
33
|
+
range spans more than one style-range leaf. On any document whose style ranges
|
|
34
|
+
are already fragmented (i.e. any document with styles), re-asserting an
|
|
35
|
+
identical mark recorded a new op every time.
|
|
36
|
+
|
|
37
|
+
Each redundant mark leaves a pair of style anchors in the container state
|
|
38
|
+
forever — they survive snapshots and are never consolidated — and every styled
|
|
39
|
+
read walks all of them. Callers that re-assert marks (for example editor
|
|
40
|
+
bindings syncing mark state) therefore permanently degraded styled reads without
|
|
41
|
+
bound: reading a 724-character paragraph went from ~5µs to ~4ms after 1000
|
|
42
|
+
redundant marks.
|
|
43
|
+
|
|
44
|
+
The skip path now falls back to `StyleRangeMap::range_has_key_value`, which
|
|
45
|
+
scans every style range covering the mark and reports whether each position
|
|
46
|
+
already resolves the key to the given value. Attached and detached texts both
|
|
47
|
+
use the new path when the single-leaf fast path cannot answer.
|
|
48
|
+
|
|
49
|
+
- f4e011f: Fix an O(n^2) slowdown when reading styled text.
|
|
50
|
+
|
|
51
|
+
Building the per-range style metadata for `toDelta` / `getRichtextValue` (and
|
|
52
|
+
the sliced variants used to emit text events) deep-copied the whole `Styles`
|
|
53
|
+
map once per style range. Each key in that map owns the set of _every_ style op
|
|
54
|
+
covering the range, while the resulting `StyleMeta` keeps only the LWW winner,
|
|
55
|
+
so the copy scaled with the number of marks accumulated on the container and
|
|
56
|
+
then discarded all but one element of it — O(marks) per range across O(marks)
|
|
57
|
+
ranges. The conversion now borrows instead of cloning.
|
|
58
|
+
|
|
59
|
+
Style anchors are never consolidated, so marks accumulate in the container
|
|
60
|
+
state and every styled read paid for all of them. On a 724-character paragraph
|
|
61
|
+
carrying 2000 accumulated marks, a styled read drops from ~103ms to ~1ms; a
|
|
62
|
+
simulated editor binding that re-asserts marks on each keystroke drops from
|
|
63
|
+
~5ms to ~200us per read after 500 keystrokes.
|
|
64
|
+
|
|
65
|
+
## 1.14.1
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 76cc0f9: Make `importBatch` atomic and never leave the document detached.
|
|
70
|
+
|
|
71
|
+
`importBatch` force-detaches the document so each blob only touches the OpLog, then
|
|
72
|
+
reattaches with a single checkout at the end. Two exits skipped that reattach and
|
|
73
|
+
stranded the document in detached mode, where later imports stop being reflected in
|
|
74
|
+
the state, local edits branch off a stale version, and every later `attach()` re-runs
|
|
75
|
+
the same failing checkout:
|
|
76
|
+
|
|
77
|
+
- The closing checkout was `expect`ed to succeed. Remote ops that decode fine but are
|
|
78
|
+
rejected by state validation (for example a list insert past the end of the list)
|
|
79
|
+
only reach that validation here, because the blobs were imported while detached, so
|
|
80
|
+
a malformed blob turned into a panic — a `RuntimeError: unreachable` trap in WASM —
|
|
81
|
+
after the document had already been left detached.
|
|
82
|
+
- Any other panic while decoding or applying a blob unwound past the reattach.
|
|
83
|
+
|
|
84
|
+
The batch now runs inside an OpLog rollback scope. If the closing checkout cannot
|
|
85
|
+
apply the accumulated changes, the whole batch is rolled back and `importBatch`
|
|
86
|
+
returns the state-apply error with the document still attached and unchanged, instead
|
|
87
|
+
of trapping. A panic inside the batch reattaches before it is re-raised.
|
|
88
|
+
|
|
89
|
+
The pending-changes rollback journal now snapshots each touched slot as it was when
|
|
90
|
+
the scope began, instead of undoing individual mutations. The previous two-phase undo
|
|
91
|
+
resurrected changes that the same import both parked and unlocked — routine across a
|
|
92
|
+
batch — leaving pending entries that referenced container registrations the rollback
|
|
93
|
+
had already discarded, and pre-batch pending changes unlocked by a rolled-back batch
|
|
94
|
+
are now re-parked instead of silently dropped.
|
|
95
|
+
|
|
96
|
+
`importBatch` of out-of-order updates is also considerably faster: the import preflight
|
|
97
|
+
no longer rescans the whole pending set once per blob, which made such a batch
|
|
98
|
+
quadratic. Draining 12000 out-of-order updates in one `importBatch` goes from ~3.4s to
|
|
99
|
+
~0.45s, with peak memory unchanged. In-order batches and single `import` calls are
|
|
100
|
+
unaffected.
|
|
101
|
+
|
|
3
102
|
## 1.14.0
|
|
4
103
|
|
|
5
104
|
### Minor Changes
|