perf(UnderlineNav): Batch layout reads and improve readability#7339
perf(UnderlineNav): Batch layout reads and improve readability#7339mattcosta7 wants to merge 1 commit intomainfrom
Conversation
…server throttling - UnderlineNavItem: Batch getBoundingClientRect and getComputedStyle reads - UnderlineNav: Add comment noting ResizeObserver callbacks are now throttled Part of #7312
🦋 Changeset detectedLatest commit: c4b6baf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
|
Closing this PR - on closer review, the layout reads were already batched in the original code. Both versions call The changes are purely readability/robustness improvements (named variables, |
Summary
Performance optimizations for UnderlineNav to improve INP.
Changes
Expected INP Impact
Why this matters
The previous code interleaved layout reads:
Batched version:
Part of the INP performance optimization effort. See #7312 for full context.