Skip to content

refactor: merge crates/loro and crates/loro-internal into one crate#919

Open
zxch3n wants to merge 9 commits intoloro-dev:mainfrom
zxch3n:codex/merge-loro-crates
Open

refactor: merge crates/loro and crates/loro-internal into one crate#919
zxch3n wants to merge 9 commits intoloro-dev:mainfrom
zxch3n:codex/merge-loro-crates

Conversation

@zxch3n
Copy link
Member

@zxch3n zxch3n commented Mar 6, 2026

Summary

This merges crates/loro and crates/loro-internal into a single core crate.

  • move the engine into crates/loro/src/internal/** and make loro the only core implementation crate
  • preserve public LoroDoc auto-commit semantics while making the merged LoroDoc canonical
  • keep the public Loro* / loro::event::* APIs as compatibility facades, and make loro::internal::* the canonical first-party low-level surface for container/value/event/diff/undo paths
  • migrate crates/loro-wasm off loro-internal onto loro::internal without regressing the pending-event flush invariant
  • delete crates/loro-internal, move compat tests/assets/version files into the merged layout, and update docs/tooling to the new structure

Notes

  • The migration plan is tracked and marked complete in plans/20260306-merge-loro-crates.md.
  • Compatibility strategy is intentionally conservative: public stable-facing APIs remain in place, while first-party hot paths use the canonical internal surface directly.
  • Residual loro-internal text references are historical only (plan text, changelog text, and compatibility lockfiles for older pinned git revisions).

Validation

  • cargo test -p loro
  • cargo check --workspace
  • cargo test -p loro-wasm
  • pnpm -C crates/loro-wasm build-release
  • cargo bench -p loro --bench merge_baseline -- --sample-size 10 --warm-up-time 0.1 --measurement-time 0.2

Benchmark Highlights

  • internal heterogeneous reads: 1.4115 us .. 1.4424 us
  • internal active subscriptions: 7.8933 us .. 8.1270 us
  • internal undo callbacks: 9.0572 us .. 9.5479 us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant