-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(richtext-lexical): node replacements ignored for block, inline block, upload, unknown and relationship nodes #14249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ock, upload, unknown and relationship nodes
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
|
||
static override clone(node: UnknownConvertedNode): UnknownConvertedNode { | ||
return new UnknownConvertedNode({ | ||
return new this({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these changes in clone are necessary. It's already handled by $applyNodeReplacement
. The Lexical codebase doesn't use this pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mainly did this for consistency within our codebase. We use this
pattern ( ;) ) for our ServerBlockNode and BlockNode, so that we don't have to override clone
in BlockNode
when we extend from ServerBlockNode
.
We don't use this ServerUnknownConvertedNode
here, but consistency I just used this
all across our codebase
Currently, you are unable to replace block, inline block, upload, unknown and relationship nodes using lexical node replacement, because we forgot to call
$applyNodeReplacement
for those nodes.This PR inserts the missing
$applyNodeReplacement
calls. This concept is not new - we already do this for all the remaining nodes.