feat!: always generate a top-level interface for blocks#16784
Open
AlessioGr wants to merge 7 commits into
Open
feat!: always generate a top-level interface for blocks#16784AlessioGr wants to merge 7 commits into
AlessioGr wants to merge 7 commits into
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.
|
836b20d to
b43d075
Compare
DanRibbens
reviewed
May 29, 2026
Contributor
DanRibbens
left a comment
There was a problem hiding this comment.
I like the change, I'm just concerned with variations of reused configs in the wild.
- Is my assumption correct?
- Does it matter?
- If yes, what could we do to make the interface names more unique?
DanRibbens
approved these changes
May 29, 2026
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.
BREAKING: Blocks used to get a top-level interface in
payload-types.tsonly wheninterfaceNamewas set; otherwise the fields were inlined wherever the block appeared.Now every block always generates a top-level interface.
interfaceNamebecomes an override of the auto-derived name rather than the switch that enables generation. The auto-derived name is a PascalCase form of the slug viatoWords(slug, true)('content-block'→ContentBlock).Reason for this change: as part of lexical type gen improvements, we're outputting generated types that look like this:
SerializedBlockNode<Block1 | Block2 | Block3>.If the blocks (Block1,Block2,Block3) do not exist as top-level interfaces, we cannot reference them in generics like these. And due to a limitation in the
json-schema-to-typescriptpackage, we cannot output block types inline within generics. We can output them inline anywhere else, which is what we have been doing so far if nointerfaceNamewas set. But now there is a need for outputting them within generics, which is not possible inline