- (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
* 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
* refactor: add detached editing config and prepare the architecture for editing detached doc
* feat: subscribe for peer id change
* fix: undo after checkout & add tests for detached editing
* test: add fuzzer for detached editing
* feat: expose detached editing configure to wasm
* test: add wasm test for detached editing
* feat: add old parent in tree diff
* chore: enable ci
* feat: add old_index to tree diff
* fix: new fractional index config
* fix: cargo fix
* fix: add FractionalIndexNotEnabled error
* fix: move config to tree state
* fix: error string
---------
Co-authored-by: Zixuan Chen <remch183@outlook.com>
This PR includes a BREAKING CHANGE.
It enables you to create containers before attaching them to the document, making the API more intuitive and straightforward.
A container can be either attached to a document or detached. When it's detached, its history/state does not persist. You can attach a container to a document by inserting it into an attached container. Once a container is attached, its state, along with all of its descendants's states, will be recreated in the document. After attaching, the container and its descendants, will each have their corresponding "attached" version of themselves?
When a detached container x is attached to a document, you can use x.getAttached() to obtain the corresponding attached container.
* feat: use resolved diff as event
* feat: wasm ValueOrContainer event
* fix: cargo fix
* fix: avoid state clone
* chore: add resolve event bench
* test: add handler in event test
* refactor: use resolved as external diff
* chore: cargo fix
* fix: typescript loro value type
* fix: use Arc::new_cyclic
* refactor: bring back sub container
* 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
* feat: checkout to frontiers
* feat: record timestamp
* fix: use unicode len by default for text
now "你好" has length of 2 instead of 6
* chore: rm dbg!