docs/solutions/developer-experience/2026-04-09-slate-transform-namespaces-should-stay-thin-sugar-over-the-current-engine.md
Slate v2 cannot claim editor.update(...) and editor methods as the primary
runtime while Transforms.* remains exported, imported in fixtures, or used in
runtime code.
Transforms.* stayed green in contract tests after docs/examples were clean.Transforms from slate, keeping the old
mental model alive.editor.insertText called itself when the old low-level
Transforms.insertText path was replaced blindly.Transforms as thin sugar. That preserved a second-looking public
write surface.Transforms.foo(editor, ...) to editor.foo(...).
Most calls were fine, but editor.insertText needed an internal low-level
text insertion helper.Hard-cut the public namespace and migrate callers:
Transforms, GeneralTransforms, NodeTransforms,
SelectionTransforms, and TextTransforms from the root slate surface.editor.setNodes(...),
editor.insertText(...), editor.select(...), and
editor.applyOperations(...).editor.insertText by routing its low-level text path through an
internal applyInsertText(...) helper instead of recursively calling the
semantic method.The public runtime has one write story:
editor.update(() => {
editor.setNodes({ type: 'heading-one' })
})
Operations and implementation helpers still exist, but users and tests do not
reach for a second Transforms.* namespace. The insertText split matters
because semantic text insertion owns marks and command dispatch, while the
internal text helper owns exact text operations.
Transforms.* outside generated historical output before claiming
closure.editor.applyOperations(...) for raw operation replay and editor methods
inside editor.update(...) for document writes.