fix(ui): strip row components from serializable form state#17371
fix(ui): strip row components from serializable form state#17371rasitakyol wants to merge 1 commit into
Conversation
db69fb0 to
2bcf735
Compare
|
CI note after rebasing onto current The failing No patch change is indicated by these logs. Some long-running Lexical jobs are still in progress; once they finish, a maintainer rerun of the failed E2E jobs would be appreciated. |
What?
Remove row-level custom components when reducing admin form state to serializable fields.
Why?
Array and blocks rows can contain a React
RowLabelcomponent. That value may include circular references, so preview and SEO fields can fail while serializing form state even though top-level custom components are already removed.How?
Clone and sanitize each row without mutating the original form state, while preserving row metadata such as IDs, block types, and collapsed state. A focused unit test covers circular row labels, top-level non-serializable values, preserved metadata, and input immutability.
Validation:
pnpm test:unit packages/ui/src/forms/Form/reduceToSerializableFields.spec.tspnpm eslint --max-warnings=0 packages/ui/src/forms/Form/reduceToSerializableFields.tspnpm prettier --check packages/ui/src/forms/Form/reduceToSerializableFields.ts packages/ui/src/forms/Form/reduceToSerializableFields.spec.tspnpm build:uiFixes #16786