Releases: loro-dev/loro
Releases · loro-dev/loro
[email protected]
Patch Changes
- 62a3a93: Merge two js packages
v1.0
We are very excited to announce the release of Loro v1.0, a major milestone.
It has a stable encoding format, faster document import and export speed, better version control capabilities, and a shallow snapshot. For more information, please check the blog.
The following are the specific API changes:
New
LoroDoc
getChange(id: ID)
: getChangeMeta
byID
.setDetachedEditing(flag: boolean)
: Enables editing in detached mode, which is disabled by default.isDetachedEditingEnabled()
: Whether the editing is enabled in detached mode.setNextCommitMessage(msg: string)
: Set the commit message of the next commit.shallowSinceVV()
: The doc only contains the history since this version.shallowSinceFrontiers()
: The doc only contains the history since this version.export(mode: ExportMode)
: Export the document based on the specified ExportMode. see more details here.getDeepValueWithID()
: Get deep value of the document with container id.subscribeLocalUpdates(callback:(bytes: Uint8Array) => void)
: Subscribe to updates from local edits.getPathToContainer(id: ContainerID)
: Get the path from the root to the container.JSONPath(jsonPath: string)
: Evaluate JSONPath against a LoroDoc.forkAt(frontiers: Frontiers): LoroDoc
: Creates a new LoroDoc at a specified version (Frontiers)getPendingTxnLength():number
: Get the number of operations in the pending transaction.travelChangeAncestors(ids: ID[], callback: (meta: ChangeMeta)->bool)
: Iterate over all changes including the input id in order, and stop iterating if the callback returns false.
LoroText
updateByLine(text: string)
: Update the current text based on the provided text line by line like git.
LoroList
toArray(): ValueOrContainer[]
: Get elements of the list. If the value is a child container, the correspondingContainer
will be returned.clear()
: Delete all elements in the list.
LoroMovableList
toArray(): ValueOrContainer[]
: Get elements of the list. If the value is a child container, the correspondingContainer
will be returned.clear()
: Delete all elements in the list.
LoroMap
clear()
: Delete all key-value pairs in the map.
LoroTree
enableFractionalIndex(jitter: number)
: Set whether to generate a fractional index for Tree Position.disableFractionalIndex()
: Disable the fractional index generation for Tree Position when
you don't need the Tree's siblings to be sorted. The fractional index will always be the default.isFractionalIndexEnabled()
: Whether the tree enables the fractional index generation.isNodeDeleted(id: TreeID)
: Returnundefined
if the node does not exist; otherwise, returntrue
if the node is deleted.getNodes(prop: getNodesProp): LoroTreeNode[]
: Get the flat array of the forest. Ifwith_deleted
is true, the deleted nodes will be included.
UndoManager
clear()
: Clear the Undo and Redo stack ofUndoManager
Changes
LoroDoc
- Move
setFractionalIndexJitter()
toLoroTree
; you can set whether to enable or disable it for eachTree Container
. import()
,importWith()
, andimportJsonUpdates
will returnImportStatus
, which indicates which ops have been successfully applied and which ops are pending.- New Subscription for events.
- In Loro 1.0,
doc.version()
doc.frontiers()
doc.oplogVersion()
anddoc.oplogFrontiers()
even if ops has not been committed, it indicates the latest version of all operations. - rename
Loro
toLoroDoc
.
LoroTree
contains(id: TreeID)
: Return true even if the node exists in the internal state and has been deleted.nodes()
: deleted nodes will be included now. You can useisDeleted()
to filter.toJSON()
: Now use the hierarchical approach to express the tree structure.
Deprecation
LoroDoc
exportFrom(version)
andexportSnapshot()
are deprecated, useexport(mode: ExportMode)
instead.
[email protected]
Patch Changes
- 46e21fc: Fix tree move issues
[email protected]
[email protected]
Patch Changes
- dce00ab: Make loro-wasm work in cloudflare worker
[email protected]
[email protected]
Patch Changes
- a761430: Fix build script
[email protected]
Patch Changes
-
38b4bcf: Add text update API
🐛 Bug Fixes
- Workaround lldb bug make loro crate debuggable (#414)
- Delete the bring back tree node from the undo container remap (#423)
📚 Documentation
- Fix typo
- Refine docs about event (#417)
🎨 Styling
- Use clippy to perf code (#407)
⚙️ Miscellaneous Tasks
- Add test tools (#410)
[email protected]
Patch Changes
- 7cf54e8: Fix batch importing with snapshot