Commit graph

1188 commits

Author SHA1 Message Date
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
Zixuan Chen
fa1286af59
docs: diff calc special behavior 2023-09-25 16:49:17 +08:00
Leon zhao
b09fc48115
Merge pull request #113 from loro-dev/refator-delete-map
refactor: map delete value
2023-09-21 15:59:00 +08:00
Leon zhao
74cbd42391
Merge pull request #112 from loro-dev/feat-pending-changes
Feat pending changes
2023-09-21 11:17:18 +08:00
leeeon233
d2b8941f06 fix: SnapshotOp map use u32 2023-09-21 08:26:54 +08:00
leeeon233
524ab9dabd chore: visibility & named 2023-09-21 08:04:22 +08:00
leeeon233
caaaa666ae chore: add pending bench 2023-09-20 09:24:46 +08:00
leeeon233
05dc62a31c fix: revert enhanced encoding 2023-09-18 21:42:42 +08:00
leeeon233
a77bf2fcb3 fix: encode enhanced pending changes 2023-09-18 20:36:24 +08:00
leeeon233
c294c61343 fix: op converter 2023-09-18 15:21:38 +08:00
leeeon233
3f3fcc11f3 refactor: map delete value 2023-09-15 13:53:30 +08:00
leeeon233
7b012dec00 fix: empty doc with pending decode snapshot 2023-09-15 11:30:43 +08:00
leeeon233
4a1f4e8647 fix: decode snapshot after pending 2023-09-13 21:23:38 +08:00
leeeon233
80a9d12ccc feat: pending remote changes, todo snapshot 2023-09-13 15:17:58 +08:00
leeeon233
fdacd62828 feat: pending bk 2023-09-12 21:40:56 +08:00
Leon zhao
fb64ff5422
Merge pull request #111 from loro-dev/feat-binary-loro-value
feat: binary loro value
2023-09-12 16:07:54 +08:00
leeeon233
5c0d8b74f4 fix: nodejs patch 2023-09-12 15:57:06 +08:00
leeeon233
331dc6c994 feat: LoroValue Binary 2023-09-12 15:57:06 +08:00
Leon zhao
76c3e54675
Merge pull request #110 from loro-dev/feat-remove-gc
feat: remove gc & change encode format
2023-09-12 15:55:45 +08:00