Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
paulpopus
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.
TypeScript was very slow in this repo - worst when editing files in
test/, and for ESLint (which runs TypeScript). This PR makes it a lot faster with a few small, type-only changes.Why it was slow
Two simple root causes:
Fieldconfig types are big and self-referencing, and these helpers/types kept rebuilding them. A handful of one-line type changes stop that.test/folder instead of its own files. Eachtest/<suite>/tsconfig.jsononly saidextends, which made it pull in all ~1,600 test files (plus 87 clashing type declarations) every time you opened one test file.What changed (4 small fixes)
fieldAffectsDataand ~8 siblings, used in 100+ places): they narrowed a type by combining it with a big list of field types, which made TypeScript build hundreds of throwaway types on every call. Changed them to pick from the types that already exist instead. Same result, almost no new types created.hasKey): same "combine with a big type" problem. Removed it (callers didn't need it and it's internal-only)test/<suite>/tsconfig.jsonits own file list so it only loads its own folder, not all oftest/.Benchmarks
Per package (
tsc --noEmit, each package's own code)The big wins (payload, next, ui) are the packages that use the field types heavily.
Whole monorepo build
Test packages
test/fieldssuitepayloadSingle-file: ~17× faster, ~7× less memory, ~4× fewer types.
Editor latency (real
tsserver- open a file, time until errors show)test/file (test/fields/int.spec.ts)payloadsource file (config/client.ts)