docs/slate-v2/absolute-architecture-release-claim.md
Slate v2 keeps Slate's JSON-like model and operation stream, and uses a Lexical-style read/update lifecycle, ProseMirror-style transaction and DOM selection authority, Tiptap-style extension ergonomics, and a React 19.2 runtime built around live reads, dirty commits, semantic islands, projection sources, and strict browser conformance proof.
This is the public runtime shape:
editor.read(() => {
const selection = editor.getSelection()
const children = editor.getChildren()
})
editor.update(() => {
editor.unwrapNodes({ match: isList })
editor.setNodes({ type: 'list-item' })
editor.wrapNodes({ type: 'bulleted-list', children: [] })
})
Primitive editor methods are the power API:
editor.insertTexteditor.deleteeditor.insertNodeseditor.insertFragmenteditor.setNodeseditor.removeNodeseditor.unwrapNodeseditor.wrapNodeseditor.selectConvenience methods are optional surface on top of primitives, not the runtime foundation.
editor.update
-> one transaction
-> implicit target resolution when a primitive omits `at`
-> operation production
-> EditorCommit
-> history / collaboration / React / DOM repair consumers
Rules:
editor.update(fn) is the write boundary.editor.read(fn) is the coherent read boundary.tx.resolveTarget() is internal engine-room API.at never imports DOM selection.at uses the active transaction target.EditorCommit remains the local runtime truth.Extensions add named editor, state, and tx groups.
editor.extend(defineEditorExtension({
name: 'todo',
tx: {
todo(tx) {
return {
toggle() {
tx.nodes.set({ type: 'todo', checked: true })
},
}
},
},
}))
Extension groups compose through the read/update runtime. Direct method replacement is not the public extension model.
These are not primary public API:
Transforms.*editor.selectioneditor.childreneditor.markseditor.operationseditor.apply as an extension pointeditor.onChange as an extension pointtx.resolveTarget()decorate as the primary overlay APIInternal storage and compatibility mirrors exist only where package/runtime code still requires them. Public docs, examples, and plugin guidance must use read/update, state groups, tx groups, editor groups, commit listeners, and projection sources.
Browser editing correctness is claimed only when the generated gauntlet proves:
The generated gauntlet substrate is release-blocking for cursor/caret claims. Model-only proof is not enough for browser editing behavior. DOM-only proof is not enough for Slate correctness.
Current destructive editing proof includes generated richtext destructive
paste/word-delete scenarios, replay/shrink coverage, cross-browser Chromium /
Firefox / WebKit / mobile-project rows, and persistent-profile soak artifacts.
That proof covers the screenshot-class repeated word-delete and paste-over-range
regression family. Final architecture closure still requires the full
bun test:integration-local sweep in the closeout slice.
EditableConformanceKernel and the editing epoch runtime own event-frame and
native-action authority for:
Controllers and strategies are workers. They do not own selection source, target source, mutation authority, repair scheduling, or release-trace truth outside the kernel contract.
Destructive editing is model-owned. Native structural delete is not trusted as the final document or selection truth.
Current automated mobile proof is scoped:
The current automated claim does not include native mobile clipboard, human soft keyboard behavior, glide typing, voice input, or raw device rows unless a device gate explicitly runs.
React 19.2 runtime proof is based on:
EditorCommit metadataThe 5000-block huge-document comparison is the release perf gate:
REACT_HUGE_COMPARE_BLOCKS=5000 REACT_HUGE_COMPARE_ITERATIONS=5 REACT_HUGE_COMPARE_TYPE_OPS=10 bun run bench:react:huge-document:legacy-compare:local
The current release claim does not close universal huge-document superiority.
Fresh 5000-block comparisons show shell mode winning ready, typing, select,
and full-document lanes, while DOM-present no-shell wins direct typing/select
lanes but still loses startup, full-document replacement, promote, and
event-input lanes. The accepted direction is two-layer auto: DOM-present is
the safe default baseline, and shell/occlusion escalation remains explicit or
proof-disabled until browser find, screen reader, native selection, copy/paste,
IME, mobile, undo/history, and collaboration proof passes.
The architecture does not claim:
Transforms.* is the primary mutation storyFinal closure requires:
bun test:integration-local