docs/research/systems/slate-v2-perfect-plan-steal-reject-defer-map.md
This page is the compiled cross-corpus map for the next Slate v2 "perfect plan" question:
It is narrower than the broader editor architecture landscape. It exists to shape the final public/runtime architecture for Slate v2.
The best architecture is not "copy Lexical", "copy ProseMirror", or "copy Tiptap".
It is:
Slate model + operations
Lexical-style read/update lifecycle
ProseMirror-style transaction and DOM-selection discipline
Tiptap-style extension and product DX
React 19.2 optimized renderer/runtime APIs
Steal from Lexical:
editor.read(fn)editor.update(fn, options?)Why now:
tx.resolveTarget() into user DXSteal from ProseMirror:
Why now:
Steal from ProseMirror:
Why now:
Steal from Lexical:
Adapt to Slate:
Why now:
Steal from Tiptap and Lexical Extensions:
Why now:
Steal from Tiptap docs and Lexical subscription posture:
Why now:
Reject:
$function API styleWhy:
Reject:
Why:
Reject:
editor.chain().focus().toggleX().run() as the normal way to mutate from UIWhy:
focus() is workaround ceremony when selection freshness is not owned by the
runtimeReject:
editor.selectioneditor.markseditor.childreneditor.operationsWhy:
Transforms.* as primary API/docsReject:
Why:
editor.update, not free functions that bypass lifecycle ownershipReject:
Why:
Defer:
editor.chain().setNodes(...).wrapNodes(...).run()
Why:
editor.updateDefer:
Why:
Defer:
Why:
Defer:
Why:
Defer:
Why:
editor.read(() => {
editor.getSelection()
editor.getChildren()
})
editor.update(() => {
editor.unwrapNodes({ match: isList })
editor.setNodes({ type: 'list-item' })
editor.wrapNodes({ type: 'bulleted-list', children: [] })
})
editor.update
-> transaction
-> internal target resolution
-> operations
-> EditorCommit
-> history/collab/render/DOM repair
editor.extend({
name: 'todo',
methods: {
toggleTodo() {
this.update(() => {
this.setNodes({ type: 'todo', checked: true })
})
},
},
})
The next implementation plan should be organized around these owners: