Skip to content

[lexical-website] Documentation Update: fix syntax errors, outdated APIs, and broken links in Node Transforms guide - #9197

Merged
etrepum merged 1 commit into
meta:mainfrom
jaideepkrishna2008-ui:fix-transforms-docs
Sep 23, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
jaideepkrishna2008-ui:fix-transforms-docs

Conversation

@jaideepkrishna2008-ui

Copy link
Copy Markdown
Contributor

Description

This PR updates the Node Transforms documentation guide (packages/lexical-website/docs/concepts/transforms.md) to resolve syntax errors, outdated API calls, invalid type signatures, and broken links:

  1. Syntax Fixes in Code Examples:

    • Adds the missing closing ); to the editor.registerNodeTransform(TextNode, ...) precondition example (previously terminated with just }).
    • Adds the missing closing parenthesis to paragraph.append($createTextNode('foo')); in the parent node transform example.
    • Replaces the invalid JavaScript .. placeholder with standard () => {}.
  2. API & Helper Modernization:

    • Replaces the nonexistent editor.addListener('update', ...) call with editor.registerUpdateListener(({editorState}) => ...).
    • Replaces the undefined $textContent identifier with $getRoot().getTextContent() inside editorState.read().
  3. TypeScript Signature Modernization:

    • Updates editor.registerNodeTransform signature from Flow syntax <T: LexicalNode>(Class<T>, T) to TypeScript <T extends LexicalNode>(klass: Klass<T>, listener: Transform<T>): () => void.
    • Updates registerLexicalTextEntity signature from Flow syntax (<N: TextNode>, Class<N>) to TypeScript (<T extends TextNode>, Klass<T>).
  4. Broken Link Fixes:

    • Fixes broken 404 links to the playground examples which were migrated to extensions:
      • EmojisPlugin/index.ts -> EmojisExtension/index.ts
      • AutoLinkPlugin/index.tsx -> AutoLinkExtension/index.ts
  5. Grammar:

    • Corrects "it's children" to "its children".

Test plan

Documentation-only change. Verified that:

  • Code snippets parse as valid JavaScript/TypeScript syntax.
  • Updated extension URLs resolve to HTTP 200 on main.
  • Type signatures match packages/lexical/src/LexicalEditor.ts and packages/lexical-text/src/registerLexicalTextEntity.ts.

Before

  • paragraph.append($createTextNode('foo'); missing closing parenthesis.
  • Precondition registerNodeTransform example missing closing );.
  • editor.addListener and $textContent are not exported or implemented in Lexical.
  • Example links to EmojisPlugin/index.ts and AutoLinkPlugin/index.tsx result in HTTP 404.

After

  • All code snippets are valid, runnable JavaScript/TypeScript.
  • Example links point to EmojisExtension/index.ts and AutoLinkExtension/index.ts (HTTP 200).
  • Type signatures match modern TypeScript definitions in the codebase.

…PIs, and broken links in Node Transforms guide
@meta-cla

meta-cla Bot commented Sep 23, 2026

Copy link
Copy Markdown

Hi @jaideepkrishna2008-ui!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 23, 2026 3:28am UTC
lexical-playground Ready Ready Preview Sep 23, 2026 3:28am UTC

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 Sep 23, 2026
@meta-cla

meta-cla Bot commented Sep 23, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@etrepum
etrepum added this pull request to the merge queue Sep 23, 2026
Merged via the queue into meta:main with commit c4dd281 Sep 23, 2026
9 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — 9d2abcae Deployed Sep 23, 2026 by vercel[bot]
Preview – lexical-playground — 9d2abcae Deployed Sep 23, 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