feat: add pure TypeScript Loro runtime#1045
Merged
Merged
Conversation
zxch3n
marked this pull request as ready for review
July 18, 2026 07:35
Contributor
WASM Size Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loro-js, a pure TypeScript Loro runtime with Text, Map, List, MovableList, Tree, Counter, events, undo, ephemeral state, JSONPath, and version transitionsWhy
Loro currently requires the WASM package for JavaScript consumers. This adds a portable TypeScript implementation while preserving the existing binary format and public behavior.
The initial implementation also exposed high-priority scaling failures: merged commits repeatedly copied and reduced complete history, concurrent Fugue insertion scanned growing origin chains, bulk List inserts emitted one operation per item, and large snapshots retained uncompressed or allocation-heavy intermediate data. This branch removes those paths and adds focused regressions.
Performance
Using
zxch3n/crdt-benchmarkswith the local build:C1.1 remains a documented JavaScript representation and constant-factor gap rather than a known asymptotic regression.
Validation
pnpm --dir loro-js checkcargo test -p loro --test loro_js_interoppnpm --dir loro-js bench:complexity -- 1000,2000,4000,8000pnpm --dir loro-js bench:b4 -- 259778 3zxch3n/crdt-benchmarksB3.3, B3.5, B4, and C1.1 traces