Repository navigation
[lexical-website] Documentation Update: the deserialization hook is importJSON, not importFromJSON - #9199
Merged
Conversation
…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.
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 23, 2026 06:31
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 23, 2026
etrepum
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, although I suspect this page will be substantially rewritten to be $config-first with schema
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
concepts/nodes.mdxrefers tostatic importFromJSONin three places — oncein the
$configlist of generated methods, once in aColoredNodeexample,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 correctlyin its other four examples.
A reader following the
ColoredNodeexample gets a node whose serialized formnever deserializes: nothing calls
importFromJSON, so the base-classimportJSONruns instead and the custom__coloris 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
The page is the only place in the repo the name occurs.
After
All three sites now match
LexicalNode.importJSONand the page's own otherexamples.