Stop automatic caching of styles, add some new prop/style helpers#4150
Merged
Conversation
Saadnajmi
approved these changes
Jul 15, 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.
Platforms Impacted
Description of changes
Currently, style combinations are cached based on object identity in
mergeProps. I instrumented the code to see the hit rate on it and most things do very well, the issue is that places where the identity is broken cause a lot of cache misses, and those cache misses are never cleaned up. As a result the set of cached styles grows over the lifetime of the process.This also adds a few future looking apis to framework-base.
assignProps/assignStyles- a mutating merge helper more likeObject.assignfor working in more standard ways for new components.attachSlotProps- which lets you add additional props to a slot before rendering. This will be necessary if we have a separate applyStyles stage in the component structure similar to how v9 does it.Verification