-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: field schema map paths #10852
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
fix: field schema map paths #10852
Conversation
|
I came across a similar edge case. The |
714ac62 to
340089f
Compare
📦 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.
|
packages/ui/src/utilities/buildClientFieldSchemaMap/traverseFields.ts
Outdated
Show resolved
Hide resolved
packages/ui/src/utilities/buildFieldSchemaMap/traverseFields.ts
Outdated
Show resolved
Hide resolved
|
Happy birthday |
Continuation of #10638.
Field paths within the schema map are not correct.
For example, an unnamed tab containing a text field should have the schema path:
_index-0.fieldWithinUnnamedTabHowever, within the schema map that path is formatted as:
fieldWithinUnnamedTabThe leading index in the first example should exist, as this field is nested within another field, regardless of this field being unnamed. Otherwise, it would be impossible to traverse the schema and lookup this field.
This discrepancy is not an issue in the admin panel because fields are also provided the wrong schema paths. They can properly locate their schema within the schema map because they match despite being incorrect. Both are wrong and that's why it works.
Here's comprehensive example of how field paths should be formatted: