This repository was archived by the owner on Sep 5, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


first of all due to some technicalities we can no longer get_workbench - we shouldn't anyway (LoroDoc doesn't implement Clone so I can't just return a clone of the workbench itself)
it forced a long awaited fix: JS no longer duplicates the whole WASM memory
it should just hold the oplog (history) and evtree (LoroDoc) as well as a project and workbench index. that's it
so JS instead of calling Project::get_workbench now calls get_workbench_oplog and get_workbench_evtree where both require a project_index and workbench_index. both regular incremented numbers, nothing fancy
I also introduced set_workbench_evtree since we want a way for JS to update the evtree
so what changed?
lib.rsProject struct - it can be removed completely - but calls static global functionsEvTreestruct. A thin wrapper aroundLoroDocLoroDocholds a list of step hashes. that's it. (this choice was made for us since Loro can't hold arbitrary types)LoroDocholds is always a sub-group of the actual history. the lorodoc can fork or whatever but the history is always linearproject::Projectstruct:rebuild_workbench. It accepts a workbench index and it:but there are quite a bit to get done in the UI:
wasmProject.*$workbenchstate but hold$oplog,$evtree,$project_index,$workbench_indexand maybe$project(for the name?) insteadoplogandevtree(onsend_messageupdate them both)evtree