Repository navigation
feat!: deprecates the component map - #7519
Merged
Merged
Conversation
jacobsfletch
requested review from
AlessioGr,
denolfe and
jmikrut
as code owners
August 5, 2024 20:26
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.
Description
Deprecates the component map by merging its logic into the client config. The main goal of this change is for performance and simplification. There was no need to deeply iterate over the Payload config twice, once for the component map, and another for the client config. Instead, we can do everything in the client config one time. This has also dramatically simplified the client side prop drilling through the UI library. Now, all components can share the same client config which matches the exact shape of their Payload config (with the exception of non-serializable props and mapped custom components).
One other important change here is that we need to ensure the HTML isn't bloated when using deeply nested fields. We need to ensure that React maintains a single reference for props that are drilled and ensure that as few
$undefinedstrings make their way into the client-side bundle as possible.There are a few things left to do here still, which will come in separate PRs:
undefinedon startup. CI will definitely fail because TS currently prevents build. Update: feat!: get beta-next to build, fix all types and errors #7594 (and others)typeproperty has been broken due to usingOmit. Need to resolve this across the board. Update: feat: client field types #7546 (and others)This is breaking change. The
useComponentMaphook no longer exists, and most component props have changed (for the better):The
useConfighook has also changed in shape,configis now a property within the context obj: