Conversation
Contributor
📦 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.
|
paulpopus
force-pushed
the
codex/poss-157-lexical-block-remount
branch
from
August 27, 2026 17:12
eee628b to
6c4331a
Compare
|
FYI: have this problem as well. A fix would be greatly appreciated |
|
Hello there, same problem for me. |
ClementNumericite
added a commit
to Numericite/ditnd-unification-site
that referenced
this pull request
Sep 23, 2026
Editing an accordion item in a WYSIWYG page, switching admin tab and coming back dropped everything added since the page load, before even saving. On remount, BlockComponent rebuilds its form state from the server-rendered snapshot and only refreshes top-level keys (`fieldName in formData`). The accordion block holds an array (`items`), whose sub-fields live under dotted paths (`items.0.content`): they are never refreshed, so the stale snapshot wins and is then written back to the lexical node. Backport payloadcms/payload#17957 to 3.89.0 via patch-package. The new getCachedFormStateIfDataMatches resolves dotted paths against the current node data, skips array/blocks parents whose value is a row list, and only falls back to a server rebuild when the row topology itself changed. Upstream issue payloadcms/payload#17894. Drop this patch once #17957 ships. Co-Authored-By: Claude <noreply@anthropic.com>
ClementNumericite
added a commit
to Numericite/ditnd-unification-site
that referenced
this pull request
Sep 23, 2026
Editing an accordion item in a WYSIWYG page, switching admin tab and coming back dropped everything added since the page load, before even saving. On remount, BlockComponent rebuilds its form state from the server-rendered snapshot and only refreshes top-level keys (`fieldName in formData`). The accordion block holds an array (`items`), whose sub-fields live under dotted paths (`items.0.content`): they are never refreshed, so the stale snapshot wins and is then written back to the lexical node. Backport payloadcms/payload#17957 to 3.89.0 via patch-package. The new getCachedFormStateIfDataMatches resolves dotted paths against the current node data, skips array/blocks parents whose value is a row list, and only falls back to a server rebuild when the row topology itself changed. The admin does not load dist/features/**, it loads the prebuilt dist/exports/client bundles, which carry their own copy of the component. So the same fix is applied there too, inlined as __pl17957 in exports/client/index.js (BlockComponent) and exports/client/chunk-XFA5M7FY.js (InlineBlockComponent). Patching only the unbundled sources has no effect. Upstream issue payloadcms/payload#17894. Drop this patch once #17957 ships. Co-Authored-By: Claude <noreply@anthropic.com>
Written with AI
Written with AI
Written with AI
paulpopus
marked this pull request as ready for review
September 24, 2026 11:33
Written with AI
paulpopus
requested review from
JarrodMFlesch and
jacobsfletch
as code owners
September 24, 2026 21:42
This branch has not been 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.
Summary
getFormStatepipeline for changed arrays, nested blocks, objects, null transitions, and metadataRoot cause
The remount initializer tried to merge nested node data into a flat cached
FormStateby matching top-level keys. Dotted array-row fields were never refreshed or created, and the array parent received the full array where the form-state contract expects a row count. The truncated state could then be written back to the Lexical node and autosaved.The fix avoids reconstructing schema-derived state from runtime value shapes. When cached values differ from the node, both block component variants rebuild through Payload's authoritative form-state builder.
Verification
pnpm test:unit packages/richtext-lexical/src— 9 files, 89 tests passedpnpm build:richtext-lexical— 4/4 tasks successfulgit diff --check— passedFixes #17894
Linear: https://linear.app/figma/issue/POSS-157