Commit graph

1624 commits

Author SHA1 Message Date
leeeon233
a6f3ddfcd9
fix: miss an export mode in ffi
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-11-28 15:03:05 +08:00
leeeon233
67f7fa54d2 chore: clean 2024-11-28 14:49:54 +08:00
leeeon233
5855bf0ebc fix: ffi export mode 2024-11-28 14:49:54 +08:00
Leon Zhao
76c630027a feat: update loro-ffi to v1.1.3
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-27 16:35:41 +08:00
github-actions[bot]
eef5a9fa9a chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-11-18 15:25:39 +08:00
Zixuan Chen
d6966aca34
fix: fractional index is enabled by default now (#561)
* fix: tree should use jitter 0 by default

Otherwise, there may be inconsistency between the event and the actual data. But this will increase the cost when the index property is not used.

* chore: add changeset

* chore: fix warning

* refactor: enable tree move by default

* docs: update related docs
2024-11-18 14:32:56 +08:00
github-actions[bot]
c4a9729c9c chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-11-16 19:33:41 +08:00
Zixuan Chen
e7450e21e1
chore: fix build script 2024-11-16 19:30:37 +08:00
Zixuan Chen
70c4942fad
chore: add wasm-base64 build target 2024-11-16 19:18:29 +08:00
Zixuan Chen
35e7ea5f54
fix: calc change count (#556)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
* fix: calc change count

* fix: len ops
2024-11-13 16:52:41 +08:00
Zixuan Chen
4f2bbee2a7
fix: stackoverflow issue when there are lots of empty slots in mem_store (#558) 2024-11-13 16:51:28 +08:00
Zixuan Chen
be2ebfa34a
feat(rs): expose more LoroValue types (#557) 2024-11-13 16:50:08 +08:00
github-actions[bot]
3edae43e7b chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-11-12 23:06:29 +08:00
Zixuan Chen
ee26952fc0
feat: Add isDeleted() method to containers (#555)
* feat: Add isDeleted() method to containers

- Add isDeleted() method to all container types (Text, Map, List, Tree, etc.)
- Fix deletion tracking for containers in tree operations
- Add tests to verify deletion state across different scenarios

* chore: fix redundant field names

---------

Co-authored-by: Leon Zhao <leeeon233@gmail.com>
2024-11-12 21:15:46 +08:00
Zixuan Chen
55e0a4596e
fix: make internal string safer (#554)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-11 22:33:17 +08:00
Zixuan Chen
5fc3458eb7
perf: use simplified internal string (#551)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
* perf: use simplified internal string

* fix: make internal string trait impl more stringish

* perf: reduce InternalString memory cost from 16 bytes to 8 bytes
on 64bit platform

* chore: fix warning

* perf: optimize drop

* test: add init large map example
2024-11-11 15:08:27 +08:00
Zixuan Chen
b1b977cf9e
docs: js container path (#550)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-10 16:36:29 +08:00
Zixuan Chen
9abeb81747
feat(wasm): add methods to modify vv (#552)
* feat(wasm): add methods to modify vv

* test: add js test for updating vv
2024-11-10 16:36:09 +08:00
Zixuan Chen
75f497d8ee
docs: update readme
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-10 00:23:37 +08:00
Zixuan Chen
eac754016e
docs: update readme 2024-11-10 00:16:56 +08:00
Zixuan Chen
cc570d2b80
chore: bump Rust crates to v1.1.0 2024-11-09 23:35:17 +08:00
github-actions[bot]
85b4722a27 chore: version packages
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-09 21:04:10 +08:00
Zixuan Chen
778ca5452d
feat: allow users to query the changed containers in the target id range (#549)
* feat: allow users to query the changed containers in the target id range

* chore: add changeset note

* chore: update cargo toml

* test: add related tests and add a commit before get_changed_container_in
2024-11-09 21:00:07 +08:00
Zixuan Chen
6e878d216a
Feat add API to query creators, the last editors/movers (#548)
* feat: LoroMap::get_last_editor

* feat: get creator/mover/editor of items

* chore: add changeset

* chore: fix warnings
2024-11-09 19:17:56 +08:00
Zixuan Chen
4f0d499d4b
perf: use a priority-queue-based search for updating text (#544)
* perf: use a priority-queue-based search for updating text

It tends to produce diffs with more continuous edits,
which is more efficient when we need to apply them to CRDTs

* fix: use better text diff calc

* refactor: add text update options struct

* chore: update text.update comments

* chore: fix warnings

* fix: rm a dumb optimization
2024-11-09 16:35:15 +08:00
Zixuan Chen
661610165b
perf: import batch optimize - use the largest snapshot first (#547)
* perf: import batch optimize - use the largest snapshot first

* chore: add changeset info
2024-11-09 16:10:13 +08:00
Zixuan Chen
8486234aba
fix: get correct encode blob info (#545)
* fix: get correct encode blob info

* fix: is_snapshot

* test: fix test case

* test: update ts tests

* chore: add change file

* chore: fix warnings
2024-11-09 15:43:11 +08:00
Zixuan Chen
715bf759c3
refactor!: reduce footguns when using for_each(fn) on rust (#540)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-11-09 01:07:38 +08:00
Zixuan Chen
044a1fd31c
fix: avoid creating non-root containers that doesn't exist by get_container api (#541) 2024-11-09 00:51:21 +08:00
Leon Zhao
468a957476
feat: impl toJSON for LoroTreeNode (#538)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
* feat: impl `toJSON` for  `LoroTreeNode`
* test: add snapshot test
2024-11-05 20:11:03 +08:00
github-actions[bot]
67fcc89e58 chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-11-04 22:45:55 +08:00
Zixuan Chen
9b60d01be2
fix: define the fork behavior when the doc is detached (#537)
* fix: define the fork behavior when the doc is detached

* chore: add release note
2024-11-04 22:34:33 +08:00
Zixuan Chen
7bf6db7398
feat: add push/push_container to LoroText/LoroList/LoroMovableList (#534)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
* feat: add push_container and push_str to list/text

* chore: add changeset file
2024-11-04 17:03:24 +08:00
Zixuan Chen
f78e1da8a0
refactor(rust): extract LoroStringValue, LoroMapValue, LoroBinaryValue, LoroListValue (#535)
* refactor: extract LoroStringValue LoroMapValue LoroListValue LoroBinaryValue

* chore: clippy fix

* chore: fix warning
2024-11-04 17:03:14 +08:00
github-actions[bot]
d3cdb20ef8
chore: version packages (#533)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-29 21:54:16 +08:00
Zixuan Chen
62a3a93552
Refactor: merge two js packages (#532)
* feat: make vitest tests pass

* chore: update readme & add deno test for web bundle

* chore: bump version to 1.0.8-alpha.0

* chore: bump loro-crdt version

* fix: build script
export init method from loro-wasm/web

* chore: bump version

* chore: specify which files to include for npm publish

* refactor: rename loro-js to loro-js-test

* refactor: remove the old loro-js folder

* fix: build scripts

* chore: 1.0.8-alpha.3

* chore: add release info
2024-10-29 21:46:56 +08:00
Zixuan Chen
e2be56b0c2
docs: update ts docs (#529)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
* docs: update ts docs

* docs: update rust docs

* test: add js doc tests and fix outdated js docs
2024-10-25 16:35:33 +08:00
Zixuan Chen
19b7ed9186
chore: bump version 2024-10-23 23:42:18 +08:00
Zixuan Chen
520a54dc71
chore: bump version 2024-10-23 23:35:41 +08:00
github-actions[bot]
87157121e4
chore: version packages (#527)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-23 23:19:24 +08:00
Zixuan Chen
c858b616f7
chore: add license file for kv-store
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-10-22 23:14:03 +08:00
Zixuan Chen
9731e6ace2
chore: bump rust crates versions 2024-10-22 23:07:38 +08:00
Zixuan Chen
340f315623
chore: bump version 2024-10-22 22:58:01 +08:00
Zixuan Chen
2622e301d0
fix: subscription convert error (#525)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-10-22 08:06:37 +08:00
Zixuan Chen
484d6db7a1
fix: fork at should restore detached state (#523)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-10-20 00:21:04 +08:00
Zixuan Chen
77024c378f
chore: bump version 2024-10-19 23:22:20 +08:00
Zixuan Chen
efad275e1a
fix: forkAt should inherit the config and auto commit from the original doc 2024-10-19 22:46:41 +08:00
Zixuan Chen
f3a03f83ac
chore: bump version 2024-10-19 17:13:01 +08:00
Leon Zhao
203d82bf3b
feat: wasm api 1.0 (#521)
* feat: new 1.0 api wasm

* test: add new api test
2024-10-19 17:09:03 +08:00
Leon Zhao
3e4005d113
chore: rename tree event (#520) 2024-10-19 11:24:13 +08:00
Leon Zhao
dedc8e087e
chore: rename wasm export from (#519)
* chore: rename wasm export from

* fix: clippy
2024-10-18 19:49:40 +08:00
Zixuan Chen
2110a4e33a
chore: bump to beta.2 2024-10-17 14:16:02 +08:00
Zixuan Chen
0e21977705
chore: update build script 2024-10-17 14:12:21 +08:00
Zixuan Chen
e32fdbf542
feat(wasm): add methods to encode and decode Frontiers (#517) 2024-10-17 13:48:11 +08:00
Zixuan Chen
d872ac6488
fix: avoid auto unsubscribe (due to gc) in js env (#516)
* fix: avoid auto unsubscribe (due to gc) in js env

* fix: drop subscription if the subscriber is dropped

* perf: use manually drop

* fix: rm once_cell dep

* fix: should call unsubscribe
2024-10-17 13:33:29 +08:00
Zixuan Chen
9650c52a30
chore: rm unused deps 2024-10-17 02:01:16 +08:00
Zixuan Chen
00775d3bcd
chore: bump to 1.0.0-beta.1 2024-10-16 16:29:52 +08:00
Zixuan Chen
e0b7280024
perf: use better data structure for frontiers (#515)
* perf: optimize high concurrency performance

* refactor: use new fronteirs impl init

* refactor: fix more type err

* refactor: fix more type err

* fix: fix more type err

* fix: all type errors and warnings

* fix: type error in tests

* fix: Debug impl

* fix: singular value

* fix: err

* fix: avoid potential err of frontiers merging

* fix: a few test issues

* test: add frontiers tests

* fix: all test errors

* chore: fix warnings

* chore: rm testing code

* perf: optimize dag related performance

* chore: rm outdated marks

* refactor: frontiers's map variant should contains at least 2 elements
2024-10-16 16:22:36 +08:00
Zixuan Chen
e14f81aa37
perf: optimize high concurrency performance (#514)
* perf: optimize high concurrency performance

* fix: err

* chore: fix warnings
2024-10-16 12:01:31 +08:00
Zixuan Chen
84fbd6d368
fix: isContainerDeleted cache err (#513) 2024-10-15 11:22:46 +08:00
Zixuan Chen
344613cd76
fix: tracker skip applied deletion error (#512) 2024-10-15 02:18:03 +08:00
Zixuan Chen
13898f0af9
Perf: commit speed & text insert cache (#511)
* perf: reduce the cost of is_deleted check

* perf: speedup get_or_insert container

* perf: reduce the cost of get or insert with

* fix: store len

* perf: cache cursor for text insertions

* chore: fix warnings
2024-10-15 02:09:30 +08:00
Zixuan Chen
40e6c524c7
perf: optimize batch container registrations on arena (#510) 2024-10-14 13:26:58 +08:00
Zixuan Chen
270ee41a5e
docs: refine wasm docs 2024-10-14 09:42:22 +08:00
Zixuan Chen
2b9194cf42
perf: optimize shrink frontiers 2024-10-12 13:54:47 +08:00
Zixuan Chen
f4823191e7
fix: movable list undo del impl 2024-10-12 13:49:36 +08:00
Zixuan Chen
ba7c1b7b94
fix: movable list undo impl (#509) 2024-10-12 11:53:50 +08:00
Zixuan Chen
23a99f53c9
Test fuzz oom (#508)
* test: avoid fuzz oom

* fix: get pending dag node err
2024-10-12 00:49:23 +08:00
Zixuan Chen
b5e153a33d
fix: movable list undo/redo error (#507)
* fix: movable list undo/redo error

* chore: rm log

* chore: rm unused

* chore: use deno 2.x

* ci: remove build step
2024-10-11 23:36:04 +08:00
Leon Zhao
9680be4103
fix: ffi remove try unwrap (#506) 2024-10-10 20:13:59 +08:00
Leon Zhao
5914d32b38
fix: ffi Subscription (#505) 2024-10-10 15:14:39 +08:00
Zixuan Chen
f2365a837b
feat: redact (#504) 2024-10-10 12:47:41 +08:00
Zixuan Chen
cd36b5b656
chore: bump version 2024-10-09 19:30:25 +08:00
Zixuan Chen
66b8a76fdf
test: add compatibility tests (#503) 2024-10-09 17:42:05 +08:00
Zixuan Chen
9bfe97bce4
chore: bump version 2024-10-09 12:01:01 +08:00
Zixuan Chen
59efca6fe5
perf: optimize kv export_all by reusing encoded block (#501)
* perf: optimize kv export_all by reusing encoded block

* chore: fix warnings

* perf: reuse encoded block bytes

* perf: optimize encode/decode speed further

* chore: fix warning
2024-10-09 10:22:17 +08:00
Zixuan Chen
afbcee99b3
perf: avoid memory leak when forking repeatedly (#500)
* perf: avoid memory leak when forking repeatedly

* fix: use the safest way to fork
2024-10-08 17:24:08 +08:00
Zixuan Chen
c8f776f018
Refactor rename trimmed snapshot to shallow snapshot (#499)
* refactor: rename trimmed snapshot to shallow snapshot

* refactor: rename trimmed_vv and trimmed_frontiers

* refactor: rename rest of trimmed* into shallow*

* chore: rename cov message

* chore: fix warnings
2024-10-08 13:15:14 +08:00
Leon Zhao
66ad26aeeb
fix: create event cannot find parent (#498)
* test: add a failed test

* fix: tree parent may be deleted when importGreaterUpdates

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2024-10-06 19:36:56 +08:00
Leon Zhao
f598b0e1e7
fix: ffi new sub import status (#497) 2024-10-06 10:28:55 +08:00
Zixuan Chen
27e3a593a6
Perf: optimize speed of large maps (#496)
* perf: optimize speed of large maps

* chore: record current perf

* chore: throw error when clippy has warnings
2024-10-05 14:35:56 +08:00
Leon Zhao
405cbe047c
feat: add import status (#494) 2024-10-05 08:18:12 +08:00
Zixuan Chen
e1bf4a858d
test: bench large folder with 1M files & 100M ops (#495)
* test: bench large folder with 1M files & 100M ops

* test: update task

* test: display trimmed snapshot size

* chore: record current test result

* perf: optimize the speed of ensure_vv
2024-10-05 01:10:54 +08:00
Zixuan Chen
b117880fed
fix: type err 2024-10-04 09:55:49 +08:00
Zixuan Chen
e3a7757610
refactor: change the first param of travel change from id to ids (#492)
* refactor: change the first param of travel change from id to ids

* fix: fix all warnings and refine the impl of subscription

* chore: use pnpm
2024-10-03 21:09:18 +08:00
Zixuan Chen
51c9b40022
fix: fork error (#493)
* fix: fork error
fixed #490

* chore: fix warnings
2024-10-03 21:08:05 +08:00
Leon Zhao
b1e03d914e
fix: do not set peer id with max (#491) 2024-10-03 21:07:11 +08:00
Zixuan Chen
a93efd5f51
refactor!: better event api (#489)
- (js) Refactor subscription mechanism to return unsubscribe function
- (rust) Implement must-use struct for subscriptions in Rust
- Enhance API ergonomics for JavaScript-like environments
- Improve resource cleanup and prevent potential memory leaks
2024-10-03 15:14:21 +08:00
Zixuan Chen
de93d34a9c
fix: return err if snapshot container has unknown container (#488) 2024-10-02 14:24:57 +08:00
Zixuan Chen
09a004e365
refactor: Loro import function should return LoroEncodeError (#487)
* refactor: Loro import function should return LoroEncodeError

- Change return type
- Add support for handling potential errors:
  - Invalid or non-existent frontiers
  - Exporting old snapshot format from trimmed snapshot doc
- Improve compatibility with trimmed docs

* fix: add tests and fix a few places that need to return err
2024-10-02 11:11:08 +08:00
Zixuan Chen
31bc451fbf
Refactor rename new snapshot mode (#486)
* refactor: rename gc snapshot to trimmed snapshot

* refactor: mv
2024-10-01 16:49:38 +08:00
Zixuan Chen
c8a60977c1
Refactor!: List state snapshot schema for v1.0 (#485)
* refactor!: change how we encode list state for fast-snapshot

* perf: speedup tree decode

* test: add movable list state snapshot test

* chore: add state encoding overhead test

* fix: error about invalid tree node creation

* chore: update example

---------

Co-authored-by: Leon Zhao <leeeon233@gmail.com>
2024-10-01 16:11:53 +08:00
Zixuan Chen
6d04066cd0
refactor: avoid footgun of impl ord for cid 2024-09-30 18:09:49 +08:00
Zixuan Chen
37ed452bc5
fix: checkout diff-calc cache issue 2024-09-30 16:39:27 +08:00
Zixuan Chen
5688a017d6
Fix warnings (#484)
* fix: warnings

* fix: warnings
2024-09-29 21:15:19 +08:00
东灯
df0e061dbf
feat: add dag allocation tree algorithm (#415)
* feat: add allocation algorithm

* test: add test

* perf: split struct for effective multiplex

* perf: code style

* test: add dfs check

* fix: rename gen to gen_graph

* fix: problem of multiple starting points

* perf: use fast log

* chore: rename `gen` to `generate`

* perf: use fxhash

* feat: lamport split algorithm

* feat: lamport split done

* fix: remove min import

* feat: add dfs test

* feat: dag

* feta: fix fuzz

* feat: add test_alloc_fuzz

* feat: add bfs algorithm

* feat: bfs

* test: add fuzz

* test: chang fuzz rule

* chore: clean up

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2024-09-29 14:19:19 +08:00
Zixuan Chen
a66dbd6fe6
pref: optimize diff calc cache use (#475)
* pref: optimize diff calc cache use

* fix: type err
2024-09-29 14:01:27 +08:00
Leon Zhao
4414053a82
feat: add FFI for Loro (#420)
* chore: init ffi

* feat: impl doc and LoroList

* feat: impl containers

* feat: unknown container

* feat: event ffi

* chore: clean

* feat: ffi undo manager

* chore: cargo fix

* chore: cargo fix

* fix: ffi value or container

* fix: ffi arc

* fix: is attached for movable list

* bk

* feat: all LoroDoc func

* feat: refine vv

* feat: ffi frontiers

* feat: ffi awareness

* fix: merge
2024-09-29 07:41:59 +08:00
Zixuan Chen
5e3f269c8c
refactor!: don't wait for commit to update version info 2024-09-27 03:58:06 +08:00
Zixuan Chen
0c8402ed70
refactor: rm compact state store
it may introduce weird bug
2024-09-27 02:44:33 +08:00