[lexical-react][lexical-link][lexical-history][lexical-extension] Docs: API doc coverage of react exports#8714
Conversation
…umentation Update: document all @lexical/react public exports ## Description Previously many of the public exports in `@lexical/react` had no TSDoc comments, so the auto-generated TypeDoc API reference (built via `docusaurus-plugin-typedoc`) listed them with no description. This change adds TSDoc comments to every public export of `@lexical/react` that was previously undocumented — all 120 exports declared in the package, covering the plugins, composers, contexts, the decorator block node, the typeahead/node/context menus, the React extensions, and the hooks. It also documents, at their declaration sites, the eight symbols that `@lexical/react` re-exports from sibling packages, so those entries are no longer blank in the `@lexical/react` reference: `ChangeHandler`, `LinkMatcher`, and `createLinkMatcherWithRegExp` (`@lexical/link`); `HistoryState` (`@lexical/history`); and `SerializedHorizontalRuleNode`, `INSERT_HORIZONTAL_RULE_COMMAND`, `$isHorizontalRuleNode`, and `registerTabIndentation` (`@lexical/extension`). All changes are additive documentation comments only; there are no runtime, API, or type changes. Closes facebook#1527 ## Test plan This is a documentation-only change with no runtime behavior to capture in screenshots; it was validated with the repo's checks plus a full TypeDoc conversion. ### Before - A TypeScript-compiler scan of every `@lexical/react` entry point (resolving re-exports and excluding `@internal`) reported 120 public exports, 94 of them missing doc comments. ### After - The same scan reports 0 public exports missing doc comments. - `npx tsc` passes with no errors. - `prettier --check` on the changed files passes. - `eslint` on the changed files passes. - A full TypeDoc conversion using the website's entry points and `tsconfig.build.json` succeeds with no link-resolution or unknown-tag warnings, confirming every `{@link}` reference resolves. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J6Tb6LmNJebSvKyW6qjwuD
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…y plugins
Follow-up to the @lexical/react API documentation, addressing review
feedback:
- For each React plugin that has an equivalent extension, note that it is a
legacy plugin and recommend configuring the extension instead, with a
{@link} to it: AutoFocusPlugin, AutoLinkPlugin, CheckListPlugin,
ClearEditorPlugin, ClickableLinkPlugin, HashtagPlugin, HistoryPlugin,
LinkPlugin, ListPlugin, PlainTextPlugin, RichTextPlugin,
SelectionAlwaysOnDisplay, TablePlugin, TabIndentationPlugin, and
HorizontalRulePlugin.
- Point LexicalComposer at LexicalExtensionComposer and the React
extensions guide (https://lexical.dev/docs/extensions/react) for editors
built with the extension API.
- Clarify that the camelCase `aria*` props on ContentEditableElement are
retained only for backwards compatibility; the hyphenated `aria-*`
attributes are preferred.
Documentation comments only; no runtime or type changes. Verified with
tsc, prettier, eslint, and a full TypeDoc conversion (no link or tag
warnings).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J6Tb6LmNJebSvKyW6qjwuD
…or LexicalComposer and TreeView
Address review feedback:
- LexicalComposer: state plainly that it uses the legacy plugin pattern and
does not support the extension API, and direct readers to use
{@link LexicalExtensionComposer} to build an editor from extensions
(replacing the weaker "consider ... instead" wording, which also wrongly
implied LexicalComposer could be used with extensions).
- TreeView: note that, when building an editor with the extension API,
{@link TreeViewExtension} renders this debugging view wired to the editor.
Documentation comments only; no runtime or type changes. Verified with tsc,
prettier, eslint, and a full TypeDoc conversion (no link or tag warnings).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J6Tb6LmNJebSvKyW6qjwuD
…egacy
Note that LexicalNestedComposer uses the legacy plugin pattern, and direct
readers building a nested editor from extensions to create it with
{@link NestedEditorExtension} and render it with
{@link LexicalExtensionEditorComposer} instead.
Documentation comment only; no runtime or type changes. Verified with tsc,
prettier, eslint, and a full TypeDoc conversion (no link or tag warnings).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J6Tb6LmNJebSvKyW6qjwuD
potatowagon
left a comment
There was a problem hiding this comment.
Reviewed by Navi (Tater Thoughts Bobblehead) on behalf of @potatowagon.
Assessment: LGTM — pure documentation, no risk.
What I checked
-
Scope: This PR adds TSDoc/JSDoc comments to ~50 exported symbols across
lexical-react,lexical-link,lexical-history, andlexical-extensionpackages. No behavioral code changes whatsoever — only/** ... */comment blocks added above existing exports. -
Content accuracy: Spot-checked several docstrings against the actual implementation:
AutoFocusPlugincorrectly documentsdefaultSelectionprop behaviorLexicalComposercorrectly explains it creates an editor frominitialConfigand provides it via contextCollaborationPluginaccurately describes Yjs integration and cursor renderingHistoryStatetype docs correctly describe undo/redo stacks- Legacy plugin notes correctly point to extension API alternatives
createLinkMatcherWithRegExpaccurately describes the URL matching pattern
-
Consistency: All docstrings follow the same style —
@returnstags where applicable,{@link}references to related types/components, "This is a legacy plugin" notes pointing to extension equivalents. -
www compat: Zero runtime changes. No exports removed, renamed, or modified. Pure additive documentation. Completely safe for www consumers.
CI Status
- Core tests (unit, integrity, browser): ✅ all green
- E2E/browser/integration: skipped (docs-only change,
check_should_runcorrectly skipped them) - CLA: ✅ signed
- Vercel previews: ✅ deployed
Verdict: Ready to approve. Documentation-only PR with no risk of regression. Improves API discoverability for all consumers.
Description
Previously many of the public exports in
@lexical/reacthad no TSDoc comments, so the auto-generated TypeDoc API reference (built viadocusaurus-plugin-typedoc) listed them with no description.This change adds TSDoc comments to every public export of
@lexical/reactthat was previously undocumented — all 120 exports declared in the package, covering the plugins, composers, contexts, the decorator block node, the typeahead/node/context menus, the React extensions, and the hooks.It also documents, at their declaration sites, the eight symbols that
@lexical/reactre-exports from sibling packages, so those entries are no longer blank in the@lexical/reactreference:ChangeHandler,LinkMatcher, andcreateLinkMatcherWithRegExp(@lexical/link);HistoryState(@lexical/history); andSerializedHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND,$isHorizontalRuleNode, andregisterTabIndentation(@lexical/extension).All changes are additive documentation comments only; there are no runtime, API, or type changes.
Closes #1527
Test plan
This is a documentation-only change with no runtime behavior to capture in screenshots; it was validated with the repo's checks plus a full TypeDoc conversion.
Before
@lexical/reactentry point (resolving re-exports and excluding@internal) reported 120 public exports, 94 of them missing doc comments.After
npx tscpasses with no errors.prettier --checkon the changed files passes.eslinton the changed files passes.tsconfig.build.jsonsucceeds with no link-resolution or unknown-tag warnings, confirming every{@link}reference resolves.