Repository navigation
[lexical-website] Documentation Update: title the history page after its public API, not useHistory - #9190
Merged
Conversation
…its public API, not useHistory
## Description
The history concepts page is titled `# useHistory` and opens with "Lexical's
useHistory adds support for Undo and Redo". `useHistory` is an internal hook:
it lives in `packages/lexical-react/src/shared/`, has a single caller
(`LexicalHistoryPlugin`), and `@lexical/react` ships no export path for it — so
a reader who follows the page cannot import what it names. The page also
supplies the sidebar label, which currently reads "useHistory".
The public surfaces are `registerHistory` and `HistoryExtension` from
`@lexical/history`, and `HistoryPlugin` from
`@lexical/react/LexicalHistoryPlugin`. This retitles the page to "History" and
names those three. The undo-coalescing background that makes up the rest of the
page is unchanged.
## Test plan
Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the page names APIs a reader can
actually import.
### Before
```
$ grep -rn "useHistory" packages/lexical-website/docs/
packages/lexical-website/docs/concepts/history.md:1:# useHistory
packages/lexical-website/docs/concepts/history.md:3:Lexical's useHistory adds support for Undo and Redo. Part of undo and redo requires supporting coalescing [...]
$ grep -rn "useHistory" packages/lexical-react/src/LexicalHistoryPlugin.ts packages/lexical-react/src/shared/useHistory.ts
packages/lexical-react/src/LexicalHistoryPlugin.ts:13:import {useHistory} from './shared/useHistory';
packages/lexical-react/src/LexicalHistoryPlugin.ts:39: useHistory(editor, externalHistoryState, delay);
packages/lexical-react/src/shared/useHistory.ts:18:export function useHistory(
$ python3 -c "import json;d=json.load(open('packages/lexical-react/package.json'));print([k for k in d['exports'] if 'istory' in k])"
['./LexicalHistoryPlugin', './LexicalHistoryPlugin.js']
```
`useHistory` is reachable only from inside the package.
### After
```
$ grep -rn "useHistory" packages/lexical-website/docs/
$ head -7 packages/lexical-website/docs/concepts/history.md
# History
Lexical adds support for Undo and Redo through the `@lexical/history` package —
`registerHistory`, the `HistoryExtension` extension, or the `HistoryPlugin`
React component from `@lexical/react/LexicalHistoryPlugin`. Part of undo and redo requires supporting coalescing [...]
$ grep -n "export function registerHistory\|export const HistoryExtension" packages/lexical-history/src/index.ts
544:export function registerHistory(
761:export const HistoryExtension = defineExtension({
$ grep -n "export function HistoryPlugin" packages/lexical-react/src/LexicalHistoryPlugin.ts
30:export function HistoryPlugin({
```
All three named surfaces are exported. The sidebar entry (`concepts/history` in
`packages/lexical-website/sidebars.js:55`) now renders as "History".
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 22, 2026 11:34
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 22, 2026
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The history concepts page is titled
# useHistoryand opens with "Lexical'suseHistory adds support for Undo and Redo".
useHistoryis an internal hook:it lives in
packages/lexical-react/src/shared/, has a single caller(
LexicalHistoryPlugin), and@lexical/reactships no export path for it — soa reader who follows the page cannot import what it names. The page also
supplies the sidebar label, which currently reads "useHistory".
The public surfaces are
registerHistoryandHistoryExtensionfrom@lexical/history, andHistoryPluginfrom@lexical/react/LexicalHistoryPlugin. This retitles the page to "History" andnames those three. The undo-coalescing background that makes up the rest of the
page is unchanged.
Test plan
Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the page names APIs a reader canactually import.
Before
useHistoryis reachable only from inside the package.After
All three named surfaces are exported. The sidebar entry (
concepts/historyinpackages/lexical-website/sidebars.js:55) now renders as "History".