Skip to content

[lexical-website] Documentation Update: the deserialization hook is importJSON, not importFromJSON - #9199

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-nodes-import-json
Sep 23, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-nodes-import-json

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

concepts/nodes.mdx refers to static importFromJSON in three places — once
in the $config list of generated methods, once in a ColoredNode example,
and once in the "rest of the boilerplate" list. No such method exists anywhere
in Lexical; the hook is static importJSON, which the same page uses correctly
in its other four examples.

A reader following the ColoredNode example gets a node whose serialized form
never deserializes: nothing calls importFromJSON, so the base-class
importJSON runs instead and the custom __color is dropped silently.

Test plan

Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the page names a method that exists.

Before

$ grep -n "importFromJSON" packages/lexical-website/docs/concepts/nodes.mdx
341:- `static importFromJSON`
585:  static importFromJSON(serializedNode: SerializedColoredNode) {
1026:- `static importFromJSON` (always)

$ grep -rn "importFromJSON" packages/ --include=*.ts --include=*.tsx | wc -l
0

The page is the only place in the repo the name occurs.

After

$ grep -n "importFromJSON" packages/lexical-website/docs/concepts/nodes.mdx

$ grep -n "importJSON" packages/lexical-website/docs/concepts/nodes.mdx
137:Lastly, all nodes should have `static getType()`, `static clone()`, and `static importJSON()` methods.
162:  static importJSON(
341:- `static importJSON`
350:  boilerplate static `clone` and `importJSON` methods to be eliminated.
417:  static importJSON(serializedNode: SerializedLexicalNode): CustomParagraph {
585:  static importJSON(serializedNode: SerializedColoredNode) {
738:  static importJSON(serializedNode: SerializedVideoNode): VideoNode {
1026:- `static importJSON` (always)

$ grep -n "static importJSON" packages/lexical/src/LexicalNode.ts
1870:  static importJSON(

All three sites now match LexicalNode.importJSON and the page's own other
examples.

…mportJSON, not importFromJSON

## Description

`concepts/nodes.mdx` refers to `static importFromJSON` in three places — once
in the `$config` list of generated methods, once in a `ColoredNode` example,
and once in the "rest of the boilerplate" list. No such method exists anywhere
in Lexical; the hook is `static importJSON`, which the same page uses correctly
in its other four examples.

A reader following the `ColoredNode` example gets a node whose serialized form
never deserializes: nothing calls `importFromJSON`, so the base-class
`importJSON` runs instead and the custom `__color` is dropped silently.

## Test plan

Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the page names a method that exists.

### Before

```
$ grep -n "importFromJSON" packages/lexical-website/docs/concepts/nodes.mdx
341:- `static importFromJSON`
585:  static importFromJSON(serializedNode: SerializedColoredNode) {
1026:- `static importFromJSON` (always)

$ grep -rn "importFromJSON" packages/ --include=*.ts --include=*.tsx | wc -l
0
```

The page is the only place in the repo the name occurs.

### After

```
$ grep -n "importFromJSON" packages/lexical-website/docs/concepts/nodes.mdx

$ grep -n "importJSON" packages/lexical-website/docs/concepts/nodes.mdx
137:Lastly, all nodes should have `static getType()`, `static clone()`, and `static importJSON()` methods.
162:  static importJSON(
341:- `static importJSON`
350:  boilerplate static `clone` and `importJSON` methods to be eliminated.
417:  static importJSON(serializedNode: SerializedLexicalNode): CustomParagraph {
585:  static importJSON(serializedNode: SerializedColoredNode) {
738:  static importJSON(serializedNode: SerializedVideoNode): VideoNode {
1026:- `static importJSON` (always)

$ grep -n "static importJSON" packages/lexical/src/LexicalNode.ts
1870:  static importJSON(
```

All three sites now match `LexicalNode.importJSON` and the page's own other
examples.
@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 6:33am UTC
lexical-playground Ready Ready Preview Sep 23, 2026 6:33am 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

@etrepum etrepum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, although I suspect this page will be substantially rewritten to be $config-first with schema

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

This branch was successfully deployed

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