Back to Plate

Slate v2 perfect plan should steal read update transaction discipline and extension DX

docs/research/decisions/slate-v2-perfect-plan-should-steal-read-update-transaction-discipline-and-extension-dx.md

53.0.62.5 KB
Original Source

Slate v2 perfect plan should steal read update transaction discipline and extension DX

Decision

For the "perfect plan" target, Slate v2 should:

  • steal Lexical's read/update lifecycle discipline
  • steal ProseMirror's transaction and DOM-selection discipline
  • steal Tiptap's extension and product DX
  • reject all three engines' mismatched core identities when they fight Slate's data model and operation semantics

Steal

Lexical

  • editor.read
  • editor.update
  • lifecycle tags
  • dirty-node discipline
  • extension dependency graph ideas

ProseMirror

  • transaction authority
  • selection mapping
  • selection bookmarks
  • centralized DOM selection import/export
  • view-data overlay discipline

Tiptap

  • extension ergonomics
  • command discoverability
  • selector-based React UI state
  • optional chain API later

Reject

  • Lexical class-based node model
  • Lexical $function public style
  • ProseMirror integer position model
  • ProseMirror schema-first identity
  • Tiptap focus().chain().run() as required public ceremony
  • public mutable editor fields
  • public free-transform-first docs
  • React-avoidance as a performance strategy

Defer

  • optional editor.chain()
  • extension dependency/conflict polish
  • page/layout system
  • AI/review/tracked-change product surfaces
  • full product UI kit parity

Public Contract

ts
editor.read(fn)
editor.update(fn, options?)

Primitive editor methods are the power API inside editor.update.

tx.resolveTarget() stays internal.

2026-04-28 Maintain Note

The later state/tx API decision narrows this public-contract wording:

  • editor.read((state) => ...) is the normal read path.
  • editor.update((tx) => ...) is the normal write path.
  • write groups live on tx, including plugin/extension groups.
  • primitive editor.* transform methods may remain internal or advanced runtime tools, but this page should not be used to justify them as the final normal authoring DX.

Use slate-v2-state-tx-public-api-and-extension-namespaces.md as the current authority for public naming and extension namespaces.

Why This Wins

This combination gives Slate v2:

  • best chance at React 19.2-perfect runtime performance
  • flexible DX for custom node types
  • safer browser-editing correctness than patch-driven event handling
  • a migration path Plate and Yjs can actually follow

Status

Accepted as the deeper architecture/API direction for the Slate v2 perfect plan. Implementation sequencing remains a separate planning concern.