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
25 changes: 0 additions & 25 deletions .changeset/text-edit-utf16-quadratic.md

This file was deleted.

23 changes: 23 additions & 0 deletions crates/loro-wasm-map/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# loro-crdt-map

## 1.13.4

### Patch Changes

- 4d577ad: Fix two O(n^2) editing slowdowns.

1. Editing with UTF-16 / UTF-8 (byte) positions (the default in the JS binding)
validated each position by materializing the entire `[0, pos)` prefix string,
making every `insert`/`delete`/`splice`/`mark` O(n) and a run of edits O(n^2)
(regression since 1.12.0). The boundary check now reads the rope's prefix
caches via the cursor (O(log n)). Unicode-indexed editing was unaffected.
2. When a subscriber is attached and many edits land on the same container within
one event batch (e.g. random-position inserts, or many distinct map-key
writes), building the event cloned the growing accumulated diff on every
compose — O(n^2) in the number of fragments. The diffs are now composed in
place. This affected text, map and list events.
3. Converting a UTF-16 / UTF-8 position within a text chunk to a unicode offset
scanned the chunk char-by-char, so editing/slicing a large contiguous chunk
(a big insert, a loaded document, or a long run of typed text that merges into
one chunk) was O(chunk length) per op. Chunks that contain no astral-plane
characters (UTF-16) or are pure ASCII (UTF-8) now convert in O(1), covering
essentially all real-world text (ASCII/Latin/CJK).

## 1.13.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-wasm-map/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loro-crdt-map",
"version": "1.13.3",
"version": "1.13.4",
"description": "Source maps for the loro-crdt WebAssembly bundles.",
"repository": {
"type": "git",
Expand Down
23 changes: 23 additions & 0 deletions crates/loro-wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 1.13.4

### Patch Changes

- 4d577ad: Fix two O(n^2) editing slowdowns.

1. Editing with UTF-16 / UTF-8 (byte) positions (the default in the JS binding)
validated each position by materializing the entire `[0, pos)` prefix string,
making every `insert`/`delete`/`splice`/`mark` O(n) and a run of edits O(n^2)
(regression since 1.12.0). The boundary check now reads the rope's prefix
caches via the cursor (O(log n)). Unicode-indexed editing was unaffected.
2. When a subscriber is attached and many edits land on the same container within
one event batch (e.g. random-position inserts, or many distinct map-key
writes), building the event cloned the growing accumulated diff on every
compose — O(n^2) in the number of fragments. The diffs are now composed in
place. This affected text, map and list events.
3. Converting a UTF-16 / UTF-8 position within a text chunk to a unicode offset
scanned the chunk char-by-char, so editing/slicing a large contiguous chunk
(a big insert, a loaded document, or a long run of typed text that merges into
one chunk) was O(chunk length) per op. Chunks that contain no astral-plane
characters (UTF-16) or are pure ASCII (UTF-8) now convert in O(1), covering
essentially all real-world text (ASCII/Latin/CJK).

## 1.13.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "loro-wasm"
version = "1.13.3"
version = "1.13.4"
edition = "2021"
publish = false
repository = "https://github.com/loro-dev/loro/"
Expand Down
2 changes: 1 addition & 1 deletion crates/loro-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loro-crdt",
"version": "1.13.3",
"version": "1.13.4",
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
"keywords": [
"crdt",
Expand Down