Skip to content

[lexical-react][lexical-link][lexical-history][lexical-extension] Docs: API doc coverage of react exports#8714

Merged
etrepum merged 5 commits into
facebook:mainfrom
etrepum:claude/wonderful-faraday-rwcnmb
Jun 18, 2026
Merged

[lexical-react][lexical-link][lexical-history][lexical-extension] Docs: API doc coverage of react exports#8714
etrepum merged 5 commits into
facebook:mainfrom
etrepum:claude/wonderful-faraday-rwcnmb

Conversation

@etrepum

@etrepum etrepum commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

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 #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.
…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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 17, 2026
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Jun 17, 2026 10:09pm
lexical-playground Ready Ready Preview, Comment Jun 17, 2026 10:09pm

Request Review

…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 potatowagon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Navi (Tater Thoughts Bobblehead) on behalf of @potatowagon.

Assessment: LGTM — pure documentation, no risk.

What I checked

  1. Scope: This PR adds TSDoc/JSDoc comments to ~50 exported symbols across lexical-react, lexical-link, lexical-history, and lexical-extension packages. No behavioral code changes whatsoever — only /** ... */ comment blocks added above existing exports.

  2. Content accuracy: Spot-checked several docstrings against the actual implementation:

    • AutoFocusPlugin correctly documents defaultSelection prop behavior
    • LexicalComposer correctly explains it creates an editor from initialConfig and provides it via context
    • CollaborationPlugin accurately describes Yjs integration and cursor rendering
    • HistoryState type docs correctly describe undo/redo stacks
    • Legacy plugin notes correctly point to extension API alternatives
    • createLinkMatcherWithRegExp accurately describes the URL matching pattern
  3. Consistency: All docstrings follow the same style — @returns tags where applicable, {@link} references to related types/components, "This is a legacy plugin" notes pointing to extension equivalents.

  4. 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_run correctly 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.

@etrepum etrepum added this pull request to the merge queue Jun 18, 2026
Merged via the queue into facebook:main with commit 7ec8ad7 Jun 18, 2026
50 checks passed
@etrepum etrepum deleted the claude/wonderful-faraday-rwcnmb branch June 18, 2026 23:20
@etrepum etrepum mentioned this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

4 participants