Commit graph

1766 commits

Author SHA1 Message Date
Leon Zhao
f03b81244a
chore: changeset 2024-12-27 09:42:02 +08:00
Leon Zhao
a98788ab48
fix: move child in current parent 2024-12-27 09:32:05 +08:00
github-actions[bot]
2b7a621744 chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-12-23 14:37:20 +08:00
Zixuan Chen
1ca1275455
chore: add changeset info
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-12-23 11:51:32 +08:00
Zixuan Chen
479c2268f3
feat: UndoManager's onPush now can access the change event (#588)
Include `origin` and `commitMessage` in the UndoManager's onPush and onPop #584
2024-12-23 11:49:35 +08:00
Zixuan Chen
42949c0e24
fix(wasm): ownership of vv (#585)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
* test: add failed test

* fix: ownership issue of version vector in wasm

* chore: fix clippy warning
2024-12-20 02:31:59 +08:00
Zixuan Chen
56216eff55
chore: fix ci release
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-12-17 13:09:15 +08:00
Zixuan Chen
d381a5d741
chore: fix ci release
Reference

https://stackoverflow.com/questions/75766122/whats-the-difference-between-node-auth-token-and-npm-auth-token/75871670#75871670

https://github.com/changesets/action/issues/98#issuecomment-2519457411
2024-12-17 12:58:18 +08:00
github-actions[bot]
f861da45fb chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-12-16 12:03:07 +08:00
Zixuan Chen
3b7a738b0e
chore: update changeset 2024-12-16 11:54:49 +08:00
Zixuan Chen
2693db3e05
feat: implement toJsonWithReplacer method for LoroDoc to customize JSON serialization (#582)
- Added `toJsonWithReplacer` method to `LoroDoc` allowing custom serialization of document values.
- Introduced new type `TreeNodeShallowValue` for tree node representation.
- Enhanced tests to cover various scenarios for the new JSON serialization method, including handling of nested containers and value transformations.
2024-12-16 11:53:08 +08:00
Zixuan Chen
8518e2b0d5
feat: add getShallowValue for each container (#581)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-12-15 13:34:07 +08:00
Zixuan Chen
62ff89fd36
refactor: rename importUpdateBatch into importBatch & refine type (#580) 2024-12-15 12:17:41 +08:00
github-actions[bot]
1275e95479 chore: version packages
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
2024-12-11 17:27:28 +08:00
Zixuan Chen
adb6ab87a7
fix: panic when returned non-boolean value from text.iter(f) (#578)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
* fix: panic when returned non-boolean value from text.iter(f) #577

* test: add related test

* fix: add type for iter function
2024-12-11 15:14:43 +08:00
github-actions[bot]
6e0437e88c chore: version packages
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
2024-12-10 16:36:17 +08:00
Zixuan Chen
d08a865d50
fix: getOrCreateContainer should not throw if value is null (#576)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
* fix: getOrCreateContainer should not throw if value is null

resolve #575

* chore: update changeset release info
2024-12-10 15:01:12 +08:00
Zixuan Chen
01fccc5a7d
feat: return import status in import_batch method (#573)
Some checks are pending
Release WASM / Release (push) Waiting to run
Test All / build (push) Waiting to run
* feat: return import status in import_batch method

* feat(wasm): add importUpdateBatch returned status support

* chore: add changeset update

* chore: update ffi return type
2024-12-09 16:31:21 +08:00
Zixuan Chen
46f578bcd0
chore: fix wasm types (#569)
Some checks failed
Release WASM / Release (push) Has been cancelled
Test All / build (push) Has been cancelled
* chore: fix wasm types

* fix: type err
2024-11-29 15:53:53 +08:00
github-actions[bot]
d54ad80bb6 chore: version packages 2024-11-29 14:24:59 +08:00
Zixuan Chen
0325061476
fix: dead loop when importing updates (#570)
Fix the dead loop issue here: https://gist.github.com/sunflowerdeath/c0e2b46b6f5d2e32d368f8e04f730237

# Reason for the Dead Loop in `find_common_ancestor`

### Original Assumptions

1. **Dependency Assumption**

   If a DagNode is depended upon by other nodes, the direction of this dependency will only point to before the end of the node. This assumption is used in system design.

2. **Node Overlap Assumption**

   DagNodes do not overlap with each other. When retrieving DagNodes from two different positions:
   - They are either completely identical
   - Or they do not overlap at all
   - If there is overlap, it means they are the same node

### Current Issues

1. **Issues Caused by Lazy Loading**

   Due to the use of lazy loading, new situations have arisen. Initially:
   - A certain DagNode is not depended upon by other DagNodes
   - Therefore, the initially retrieved form is complete

2. **Impact of Subsequent Loading**

   After loading additional DagNodes:
   - The newly loaded DagNode may depend on the internal position of the previously complete DagNode
   - This causes the originally complete DagNode to be split into multiple smaller DagNodes

3. **Violation of Original Assumptions**

   In this case, when retrieving the content of the original DagNode again:
   - Other DagNode dependencies may appear in the middle
   - There may be overlaps on the DagNode
   - This violates the original design assumptions

# Fix Approach

Remove the assumption in the original implementation that "overlapping DagNodes will not occur." When overlapping DagNodes are found, retain the shorter one and remove the longer one.
2024-11-29 13:01:15 +08:00
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
9f5df5a4fc
docs: update readme 2024-11-10 00:19:13 +08:00
Zixuan Chen
eac754016e
docs: update readme 2024-11-10 00:16:56 +08:00
Zixuan Chen
1dee85123f
chore: Release 2024-11-09 23:37:44 +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
Kursat Aktas
9e2d848485
Introducing Loro Guru on Gurubase.io (#539)
* Introducing Loro Guru on Gurubase.io

Signed-off-by: Kursat Aktas <kursat.ce@gmail.com>

* fix guru badge style

---------

Signed-off-by: Kursat Aktas <kursat.ce@gmail.com>
2024-11-09 19:12:12 +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