-
Notifications
You must be signed in to change notification settings - Fork 649
pass at optimizing css and js to minimize blocking, recalc, layout, inp costs #7312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2a9d1ea
perf: fix expensive CSS :has() selectors for INP optimization
mattcosta7 e013110
perf: tighten :has() selector scope for better INP
mattcosta7 0616cb3
perf: scope PageHeader :has() selectors to direct children
mattcosta7 02d9f6d
perf: scope :has() selectors to direct children across components
mattcosta7 78d425b
update copilot instructions
mattcosta7 b99df04
fix(ActionList): use only data-disabled for hover state selector
mattcosta7 90f3b57
backout a bit
mattcosta7 86897e9
backout a bit
mattcosta7 2ef0cc6
perf(TreeView): cache tree items in typeahead to improve INP
mattcosta7 8c4c70b
perf: additional :has() optimizations and documentation
mattcosta7 cc131e3
minor updates to scripts
mattcosta7 d4857e0
useResizeObserver throttling
mattcosta7 4eacb4b
useResizeObserver updates
mattcosta7 4c7db34
perf: optimize useResizeObserver and useAnchoredPosition hooks
mattcosta7 633fe97
chore: add changeset for INP performance optimizations
mattcosta7 d0fc079
changeset
mattcosta7 b9ceb4a
revert: remove hook optimizations that broke tests
mattcosta7 985573f
perf: add first-immediate throttling to useResizeObserver and useOver…
mattcosta7 80e449a
Update packages/react/src/UnderlineNav/UnderlineNav.tsx
mattcosta7 6b83e79
context splits + useAnchoredPosition observer
mattcosta7 539cf3f
update feedback
mattcosta7 48ee449
avoid duplicate work and observers (#7321)
mattcosta7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| "@primer/react": patch | ||
| --- | ||
|
|
||
| Performance: Optimize CSS `:has()` selectors and JavaScript hooks for improved INP | ||
|
|
||
| - Scope CSS `:has()` selectors to direct children across Dialog, PageHeader, ActionList, Banner, ButtonGroup, AvatarStack, Breadcrumbs, SegmentedControl, TreeView, and SelectPanel | ||
| - Add requestAnimationFrame throttling to `useResizeObserver` (first callback immediate, subsequent throttled) | ||
| - Add anchor element ResizeObserver to `useAnchoredPosition` for repositioning on anchor resize | ||
| - Add `useTreeItemCache` hook for caching TreeView DOM queries with MutationObserver invalidation | ||
| - Throttle MutationObserver callbacks in AvatarStack and Announce components | ||
| - Add rAF throttling to `useOverflow` hook | ||
| - Optimize `hasInteractiveNodes` utility with querySelectorAll and attribute-first checks | ||
| - Split Autocomplete context to prevent Overlay re-renders during typing |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.