Skip to content

Stop automatic caching of styles, add some new prop/style helpers#4150

Merged
JasonVMo merged 5 commits into
mainfrom
user/jasonvmo/style-cache
Jul 15, 2026
Merged

Stop automatic caching of styles, add some new prop/style helpers#4150
JasonVMo merged 5 commits into
mainfrom
user/jasonvmo/style-cache

Conversation

@JasonVMo

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • all

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 like Object.assign for 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

  • Automated tests

@JasonVMo JasonVMo requested a review from Saadnajmi July 15, 2026 18:01
@JasonVMo JasonVMo enabled auto-merge (squash) July 15, 2026 18:20
@JasonVMo JasonVMo merged commit 9d2bb3e into main Jul 15, 2026
14 checks passed
@JasonVMo JasonVMo deleted the user/jasonvmo/style-cache branch July 15, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants