docs/solutions/developer-experience/2026-04-29-slate-v2-hard-cuts-must-run-explicit-contract-files.md
The Slate v2 BaseEditor hard cut looked complete after bun check, but
explicit contract files still contained removed public editor APIs.
bun check passed.bun test ./packages/slate/test/read-update-contract.ts ... failed.editor.schema.define(...),
editor.getChildren(), and editor.insertText(...).Run the explicit contract files named by the plan, then either migrate or cut stale contracts:
bun test ./packages/slate/test/*contract.ts \
./packages/slate-hyperscript/test/smoke-contract.ts
For kept contracts:
editor.read(...) for public readseditor.update((tx) => ...) for public writeseditor.extend(...) for schema setupslate/internal only when the test is explicitly internalFor deleted behavior, delete the test. Do not preserve a compatibility helper just to keep old contract wording alive.
When a hard cut deletes a public example route, sweep more than the example registry:
site/constants/examples.tssite/pages/examples/[example].tsxsite/examples/ts/<route>.tsxplaywright/integration/examples/<route>.test.tspackages/slate-browser/src/core/first-party-browser-contracts.tsplaywright/stress/generated-editing.test.tsscripts/benchmarks/browser/**If the behavior still exists, move the browser proof to the surviving public route. If the route was only a synthetic harness, delete the harness-specific stress rows and keep package-level tests for the runtime behavior.
For Playwright route migrations, remember that this repo configures
testIdAttribute: 'data-test-id'. Public example metrics that tests read
should use data-test-id, not data-testid.
Bun's default test discovery does not treat every *-contract.ts file as a
test file. Explicit path runs are the only way to prove those files still match
the current API.
Example route hard cuts have the same shape: the route can disappear from the nav while benchmark paths, generated stress rows, proof maps, or static exports still point at it. Grepping route names after the cut catches those stale references before the browser gate does.