docs/research/sources/editor-architecture/prosemirror-mapped-overlays-and-bookmarks.md
Compile the ProseMirror evidence that mattered to the Slate v2 decorations / annotations lane.
DecorationSource and DecorationSet are persistent mapped overlay data,
not just decoration callbacks.forChild(...) is the real scaling trick: child-scoped propagation instead of
repeatedly intersecting whole-tree overlay sets.SelectionBookmark is the clean durable-anchor contract:
map through changes, resolve later against the current document.ViewDesc tree is an explicit incremental view/update substrate rather
than generic React rerender.The important ProseMirror lesson is not “use decorations”.
It is:
That is exactly the discipline old Slate decorate lacked.
SelectionBookmark exists because the runtime needs a lightweight,
document-independent anchor that can survive edits and resolve later.
That supports the Slate v2 decision to prefer Bookmark as the durable public
anchor noun and keep live-ref machinery lower in the stack.
ProseMirror’s Decoration.node(...) makes the node-local visual lane explicit.
That matters because it reinforces the split between:
Instead of pretending one leaf-level decorate hook can own them all.
mapChildren(...) and the ViewDesc tree are still more explicit than the
current Slate v2 projection runtime about:
That matters for perf architecture because it means ProseMirror’s strongest claim is not just “it has decorations”. It has a tighter document-view update discipline.