Skip to content

[lexical] Documentation Update: Add JSDoc comments to core package exports - #8895

Merged
etrepum merged 1 commit into
meta:mainfrom
mayrang:docs/jsdoc-lexical-core-exports
Jul 30, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
mayrang:docs/jsdoc-lexical-core-exports

Conversation

@mayrang

@mayrang mayrang commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Description

The lexical core package exports ~100 public functions and constants that had no JSDoc. IDE autocomplete showed bare signatures with no hint of what each function does. This PR adds single-line /** ... */ JSDoc comments to the exported symbols that were missing them across 14 files.

Coverage by file group:

  • Commands (LexicalCommands.ts) — 25 command constants (SELECTION_CHANGE_COMMAND, CLICK_COMMAND, PASTE_COMMAND, etc.). Pattern: "Dispatched when/on/to...".
  • Constants (LexicalConstants.ts) — 11 formatting bitmasks and lookup tables. Pattern: "Bitmask for...".
  • Environment (environment.ts) — 10 platform/browser detection flags (IS_APPLE, IS_FIREFOX, CAN_USE_BEFORE_INPUT, etc.).
  • Selection (LexicalSelection.ts) — 12 selection utilities ($getSelection, $createRangeSelection, $isBlockElementNode, etc.).
  • Utils (LexicalUtils.ts) — 28 utility functions ($getRoot, $splitNode, $applyNodeReplacement, toggleTextFormatType, etc.).
  • Normalization / Updates — $normalizeSelection, isCurrentlyReadOnlyMode, $parseSerializedNode.
  • Node files (7 files) — type guards ($isTextNode, $isElementNode, ...) and factory functions ($createParagraphNode, $createLineBreakNode, ...).

Existing JSDoc (e.g. on DELETE_CHARACTER_COMMAND, INSERT_LINE_BREAK_COMMAND, CUT_COMMAND, SELECT_ALL_COMMAND) was left untouched. The 3-line deletion is the // Text node formatting line comment in LexicalConstants.ts and the Android WebView UA comment in environment.ts, both replaced by their JSDoc equivalents.

Test plan

  • pnpm test-unit — all pass. No code changes, only JSDoc additions.
  • tsc / flow / prettier / eslint clean.

@vercel

vercel Bot commented Jul 30, 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 Jul 30, 2026 6:18pm
lexical-playground Ready Ready Preview Jul 30, 2026 6:18pm

Request Review

@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 Jul 30, 2026
@etrepum
etrepum added this pull request to the merge queue Jul 30, 2026
Merged via the queue into meta:main with commit a318845 Jul 30, 2026
44 checks passed
@etrepum etrepum mentioned this pull request Aug 31, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — fd9edb2c Deployed Jul 30, 2026 by vercel[bot]
Preview – lexical-playground — fd9edb2c Deployed Jul 30, 2026 by vercel[bot]
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants