Commit graph

1056 commits

Author SHA1 Message Date
Zixuan Chen
c1613ee680
docs: update readme 2023-11-11 11:54:12 +08:00
Zixuan Chen
598d6bccdf
docs: add example gif 2023-11-11 11:20:16 +08:00
Zixuan Chen
0803f31a0d
docs: refine readme 2023-11-11 10:57:47 +08:00
Zixuan Chen
e871a6c438
chore: bump loro-wasm loro-crdt version 2023-11-10 20:41:11 +08:00
Leon zhao
7d2826cfe9
Doc: loro-crdt documents in comments (#165)
* doc: wasm

* doc: add wasm example

* doc: typedoc

* fix: merge

* fix: dep

* fix

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2023-11-10 20:30:54 +08:00
Zixuan Chen
90079b2f1c
test: add more examples 2023-11-10 20:13:01 +08:00
Zixuan Chen
fdd24bd836
feat: add fromCheckout to wasm 2023-11-08 16:22:21 +08:00
Zixuan Chen
08e4ed9d40
feat: add from_checkout mark to event (#164) 2023-11-08 16:15:11 +08:00
Zixuan Chen
116190c817
chore: refine err msg 2023-11-08 14:18:01 +08:00
Zixuan Chen
9b18ff9847
fix: make encoding enhanced simpler 2023-11-08 14:17:43 +08:00
Zixuan Chen
93a52ba55e
fix: commit txn when dropping
it's less confusing
2023-11-08 14:16:10 +08:00
Zixuan Chen
a68482a495
test(js): update signature for map set container 2023-11-08 12:12:04 +08:00
Zixuan Chen
66d74c1e74
feat(wasm): get deep value 2023-11-07 23:59:44 +08:00
Zixuan Chen
7b855c88da
test: add out of bound test 2023-11-07 23:32:07 +08:00
Zixuan Chen
532eee09a4
fix: return Err when index out of bound 2023-11-07 22:48:53 +08:00
Zixuan Chen
cdc084627d
chore: fix example type err 2023-11-07 19:48:43 +08:00
Zixuan Chen
83ae5930bc
Fix list get method (#158) 2023-11-07 19:48:16 +08:00
Zixuan Chen
cb8bbefb08
Fix incorrect deletion of emoji in wasm (#154)
This pull request fixes an issue where the emitted utf16 events were wrong when deleting an emoji in wasm. The problem was caused by incorrect calculation of the event range. This PR updates the code to use the correct range and adds a new test case to ensure the issue is fixed.
2023-11-05 16:13:40 +08:00
Zixuan Chen
7ccfd1e91d
feat: expose version and change inspect api to wasm (#156) 2023-11-05 16:06:34 +08:00
Leon zhao
acafc76aff
Feat: diff calc bring back & tree new event and value (#149)
* feat: new tree state

* fix: emit meta event

* fix: semantic tree event

* fix: diff calc bring_back

* chore: clear comments

* fix: merge

* fix: tree snapshot

* fix: filter empty bring back

* feat: tree add external diff

* fix: imported changes were not mergeable (#147)

* fix: imported changes were not mergeable
now the small encoding size is supported in example

* fix: stupid err in richtext checkout

* fix: rle oplog encode err
- support pending changes
- start counters were wrong

* fix: utf16 query err (#151)

* fix: tree movable node lamport

* fix: merge

* perf: bring back

* doc: add deep value meta doc

* refactor: bring back only when record diff

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2023-11-05 15:53:33 +08:00
Zixuan Chen
8bd953e396
refactor: extract text chunk (#153) 2023-11-04 20:03:43 +08:00
Zixuan Chen
b1895bba26
Update Quill editor to fix consistency issues (#152)
* chore: rm logs

* fix: richtext delta event

* fix(quill): move apply delta to editor part

* fix: consistency issue with Quill
- Quill assumes there is always a \n at the end of the line
- Quill assumes \n does not merge with other delta item
- Quill assumes there is no inline format inside {insert: '\n'} delta
  item
2023-11-04 20:03:15 +08:00
Zixuan Chen
5a9baebba0
fix: utf16 query err (#151) 2023-11-04 12:24:05 +08:00
Zixuan Chen
5b65963104
fix: imported changes were not mergeable (#147)
* fix: imported changes were not mergeable
now the small encoding size is supported in example

* fix: stupid err in richtext checkout

* fix: rle oplog encode err
- support pending changes
- start counters were wrong
2023-11-04 12:23:28 +08:00
Zixuan Chen
200a6dd39a
fix: warnings 2023-11-03 22:26:49 +08:00
Zixuan Chen
5cac1ed092
Refactor: make changes mergeable (#146)
- Allow changes to be merged when possible. This makes realtime collaboration more efficient with Loro.
- Refactor the code to make modifications of changes in oplog in one place
- Optimize the diff calculation so that it doesn't have to go back to the beginning of the change.

Note: we still keep the invariants that dependency pointers in Loro always point to the last op in a change
2023-11-03 21:40:34 +08:00
Zixuan Chen
2a93d82835
docs: update readme 2023-11-03 21:33:36 +08:00
Zixuan Chen
7a19b49acb
Add richtext example using Quill (#145)
* feat: richtext example init

* fix: pass richtext event delta consistency check

* chore: debug history
2023-11-03 16:59:27 +08:00
Zixuan Chen
da16b8a99d
refactor: use better repr for container id (#144) 2023-11-02 17:13:08 +08:00
Zixuan Chen
a40b5c6e4a
feat: support richtext in wasm & mark text with arbitrary value (#142)
- Support mark text with custom value [LORO-299] Allow users to mark text with custom value #139
- Expose richtext in wasm
2023-11-02 14:20:34 +08:00
Zixuan Chen
95e6130d93
Fix: richtext event (#138)
Support rich text event. Now it will emit the delta event correctly in the Quill Delta format.
2023-11-01 20:02:05 +08:00
Zixuan Chen
a52549ea30
fix: g-btree bug, fixed by upgrade dep 2023-10-31 22:04:43 +08:00
Zixuan Chen
bcf81a45eb
fix: g-btree delete leaf err
upgrade generic-btree
2023-10-31 21:08:07 +08:00
Zixuan Chen
e1ab03f30f
feat: create doc from snapshot (#136) 2023-10-31 19:02:52 +08:00
Zixuan Chen
c9cf106338
fix: impl Fugue correctly (#133)
The original content has a reversed comparison for right parents, which causes the interleaving anomalies when inserting text in a backward order.
2023-10-31 17:59:24 +08:00
Zixuan Chen
8235eaaa9b
fix: snapshot encode err (#135)
- allow import snapshot when user has created empty handlers
- fix state snapshot encode err
2023-10-31 17:58:50 +08:00
Zixuan Chen
f72f812086
Refactor: replace collection with single op content in remote op (#132)
* refactor: remove rlevec inside remoteop

* refactor: remove the use of RleVec<[T; 0]> (#131)
2023-10-31 17:58:27 +08:00
Zixuan Chen
74138231aa
refactor: remove the use of RleVec<[T; 0]> (#131) 2023-10-31 17:54:37 +08:00
Zixuan Chen
bf2385efe0
Refactor: remove old encode method (#130)
* refactor: remove old encode method

* chore: rm file

* refactor: mv snapshot encode file
2023-10-31 10:36:21 +08:00
Zixuan Chen
2abc302344
chore: add pending test and new_auto_commit 2023-10-31 10:14:09 +08:00
Zixuan Chen
c1d732b57c
Fix event hint error (#129)
* fix: event hint err

* fix: delete event hint
2023-10-31 10:00:54 +08:00
Zixuan Chen
c4f05ae447
docs: refine readme 2023-10-31 10:00:11 +08:00
Zixuan Chen
d213cbe053
docs: update readme link 2023-10-30 22:00:49 +08:00
Zixuan Chen
45490f3370
Perf: reduce mem usage when transaction is large (#128)
* perf: reduce mem usage when txn is large

* test: add diagnose info for id_to_cursor

* perf: make id span easier to merge
2023-10-30 21:56:33 +08:00
Zixuan Chen
8293347334
Feat: autocommit transaction (#127)
* feat: auto commit

* fix: make recursive single thread event work again
2023-10-30 18:32:36 +08:00
Zixuan Chen
734b832c00
Fix checkout event (#126)
* tests: add checkout err tests

* fix: checkout event err when create child
2023-10-30 14:16:50 +08:00
Leon zhao
e01e98411c
feat: movable tree support (#120)
* feat: tree state

* feat: tree value

* feat: tree handler

* fix: tree diff

* test: fuzz tree

* feat: tree snapshot

* fix: tree default value

* fix: test new node

* fix: tree diff

* fix: tree unresolved value

* fix: tree fuzz

* fix: tree fuzz move

* fix: sort by tree id

* fix: tree diff sorted by lamport

* fix: sort roots before tree converted to string

* fix: rebase main

* fix: tree fuzz

* fix: delete undo

* fix: tree to json children sorted

* fix: diff calculate

* fix: diff cycle move

* fix: tree old parent cache

* feat: cache

* fix: local op add tree cache

* fix: don't add same tree move to cache

* fix: need update cache

* feat: new cache

* bench: add checkout bench

* chore: clean

* fix: apply node uncheck

* perf: lamport bound

* fix: calc old parent

* feat: tree wasm

* fix: change tree diff

* fix: tree diff retreat

* fix: tree diff should not apply when add node

* feat: new tree loro value

* chore: typo

* fix: tree deep value

* fix: snapshot tree index -1

* fix: decode tree snapshot use state

* fix: release state lock when emit event

* fix: tree node meta container

* fix: need set map container when covert to local tree op

* fix: tree value add deleted

* fix: more then one op in a change

* fix: tree fuzz deleted equal

* fix: tree calc min lamport

* feat: tree encoding v2

* doc: movable tree

* fix: test tree meta

* test: remove import bytes check

* refactor: diff of text and map

* refactor: del span

* perf: tree state use deleted cache

* fix: some details

* fix: loro js tree create

* feat: add un exist tree node

* bench:  tree depth

* fix: check out should emit event

* refactor: event

* fix: fuzz err

* fix: pass all tests

* fix: fuzz err

* fix: list child cache err

* chore: rm debug code

* fix: encode enhanced err

* fix: encode enchanced

* fix: fix several richtext issue

* fix: richtext anchor err

* chore: rm debug code

* fix: richtext fuzz err

* feat: speedup text snapshot decode

* perf: optimize snapshot encoding

* perf: speed up decode & insert

* fix: fugue span merge err

* perf: speedup delete & id cursor map

* fix: fugue merge err

* chore: update utils

* fix: fix merge

* fix: return err apply op

* fix: fix merge

* fix: get map container as tree meta
2023-10-30 11:13:52 +08:00
Zixuan Chen
4d87725f32
chore: rm needless package 2023-10-29 22:13:59 +08:00
Zixuan Chen
ce8dc9284d
docs: update readme 2023-10-29 21:37:24 +08:00
Zixuan Chen
d942e3d7a2
Feat: Peritext-like rich text support (#123)
* feat: richtext wip

* feat: add insert to style range map wip

* feat: richtext state

* fix: fix style state inserting and style map

* fix: tiny vec merge err

* fix: comment err

* refactor: use new generic-btree & refine impl

* feat: fugue tracker

* feat: tracker

* feat: tracker

* fix: fix a few err in impl

* feat: init richtext content state

* feat: refactor arena

* feat: extract anchor_type info out of style flag

* refactor: state apply op more efficiently
we can now reuse the repr in state and op

* fix: new clippy errors

* refactor: use state chunk as delta item

* refactor: use two op to insert style start and style end

* feat: diff calc

* feat: handler

* fix: tracker checkout err

* fix: pass basic richtext handler tests

* fix: pass handler basic marking tests

* fix: pass all peritext criteria

* feat: snapshot encoding for richtext init

* refactor: replace Text with Richtext

* refacotr: rm text code

* fix: richtext checkout err

* refactor: diff of text and map

* refactor: del span

* refactor: event

* fix: fuzz err

* fix: pass all tests

* fix: fuzz err

* fix: list child cache err

* chore: rm debug code

* fix: encode enhanced err

* fix: encode enchanced

* fix: fix several richtext issue

* fix: richtext anchor err

* chore: rm debug code

* fix: richtext fuzz err

* feat: speedup text snapshot decode

* perf: optimize snapshot encoding

* perf: speed up decode & insert

* fix: fugue span merge err

* perf: speedup delete & id cursor map

* fix: fugue merge err

* chore: update utils

* perf: speedup text insert / del

* fix: cursor cache

* perf: reduce conversion by introducing InsertText

* perf: speed up by refined cursor cache

* chore: update gbtree dep

* refactor(wasm): use quill delta format

* chore: fix warnings
2023-10-29 14:02:13 +08:00