docs/solutions/developer-experience/2026-04-15-slate-package-declaration-merging-recovery-must-start-from-base-aliases-not-example-casts.md
The current repo had drifted away from the legacy declaration-merging seam.
Examples were papering over that drift with local casts, but the real miss was
package-side: slate no longer exposed the base aliases and extendable type
machinery that legacy CustomTypes expected.
BaseEditor, BasePoint, BaseRange, and BaseSelection were missing from
the live package surfaceslate-react flattened ReactEditor onto the already-extended editor type,
which invited circular type recoveryRenderElementProps drift forced example-side prop casts in files like
check-lists, images, mentions, embeds, inlines, and paste-htmlCustomTypes a hard cutRecover the package seam first.
ExtendedType / CustomTypes machinery in slateBaseEditor, BaseElement, BaseText, BasePoint, BaseRange,
BaseSelection, and base operation aliasesslate-history compose from BaseEditor againslate-react package-side custom-types augmentationslate-react instead of letting local
sites invent castsusage.tsxRepresentative package changes:
packages/slate/src/types/custom-types.tspackages/slate/src/interfaces/editor.tspackages/slate/src/interfaces/node.tspackages/slate/src/interfaces.tspackages/slate/src/index.tspackages/slate-react/src/custom-types.tspackages/slate-react/src/components/editable-text-blocks.tsxpackages/slate-history/src/interfaces.tsThe old CustomTypes model was package-owned, not example-owned.
If the base aliases and extendable types are missing, examples can only fake the shape with casts. Once the base aliases exist again, consumers can rebuild the legacy merge contract honestly from package exports.
The other key lesson is that a consumer-type fixture should compile against the built package surface, not by globally augmenting the whole site example program. The latter creates fake failures in unrelated examples and hides the real question: whether the shipped package types work for consumers.
BaseEditor, BaseElement, BaseText, BasePoint, BaseRange,
BaseSelection.as CustomEditor and render-prop casts across examples as a
package typing smell until proven otherwise.