docs/brainstorms/slate-canvas.md
Define a concrete experimental path for html-in-canvas as an optional runtime
adapter for slate-v2 without pivoting the core architecture.
For this spike, “success” means:
html-in-canvas is a real runtime advantage for targeted
editor surfacesslate-v2 core pathThree separate signals are easy to blur together:
Those are all interesting.
They still do not imply that slate-v2 should pivot its core around
canvas-first editing.
The current slate-v2 architecture already chose the narrower and better
position:
That is still the right call.
Do not pivot slate-v2 core toward canvas-first editing.
Do not rebuild selection/caret/composition truth around canvas.
Run a hybrid runtime spike instead:
html-in-canvas as an optional rendering adapter for targeted surfacesPretext only as a planning primitive where offscreen/layout estimation
actually winsThis is the only sane route because:
html-in-canvas still depends on DOM layout, DOM hit testing, and transform
synchronizationhtml-in-canvas-room proves a rendering trick, not editor-grade IME/history
correctnessPretext is a measurement/layout engine, not a live editing runtimeslate-v2 rewrite is still finishing contract recovery, not
shopping for a renderer resetPretextslate-v2 core semanticsWhat matters:
Why that matters:
What matters:
Why that matters:
What matters:
prepare() is expensive but one-timelayout() is the cheap arithmetic hot pathWhy that matters:
The repo already says:
slate-react be excellentPretext is not a general rendering engine for slate-reactPretextThat should stay the governing constraint.
If html-in-canvas becomes stable tomorrow, it is not proof that the best
future-proof editor is “canvas-first everywhere”.
The best future-proof editor architecture is:
Canvas is a strong runtime option. It is not the new ontology.
This spike should answer only these:
html-in-canvas improve targeted slate-v2 surfaces enough to justify
an adapter package?Pretext help for:
Files:
docs/brainstorms/slate-canvas.mdWork:
Required output:
Candidate location:
Surfaces to test:
richtext viewReason:
Work:
Decision:
Blunt rule:
Pretext one honest rolePossible uses:
Explicit non-goals:
Success metrics:
Kill criteria:
If the spike fails:
slate-v2 architecturePretext planning ideas onlyIf the spike succeeds narrowly:
If the spike succeeds broadly:
slate-v2 contract recoveryThis is a planning artifact, so no same-turn code verification is required.
But the future spike must include:
slate-v2 around canvasPretext