Skip to content

@primer/react@38.7.0

Choose a tag to compare

@primer primer released this 07 Jan 17:33
· 70 commits to main since this release
428469d

Minor Changes

Patch Changes

  • #7354 efbebdf Thanks @llastflowers! - update SelectPanel Multi Select Modal story

  • #7426 094be60 Thanks @kelsey-myers! - Add focusPrependedElements prop to useFocusZone, FilteredActionList, and SelectPanel

  • #7349 713d5a5 Thanks @mattcosta7! - PageLayout: Optimize drag/resize performance with inline styles and new optimizations

    Refactored:

    • Use direct attribute selectors (.Pane[data-dragging='true']) instead of descendant selectors for CSS containment (O(1) vs O(n) selector matching)
    • Extract optimization utilities to paneUtils.ts
    • Apply drag handle visual feedback via inline styles and CSS variables

    Added:

    • content-visibility: auto during drag/resize to skip off-screen content rendering
    • rAF throttle for drag updates (one update per frame, latest position wins)
    • Containment during window resize (parity with drag)

    These changes improve style recalculation performance on large DOMs (100k+ nodes) by eliminating descendant selector traversal.

  • #7337 de970d6 Thanks @mattcosta7! - perf(Autocomplete): Split context to reduce unnecessary re-renders

    Split AutocompleteContext into separate contexts for static values, setters, and dynamic state.
    Components now subscribe only to the context slices they need, reducing re-renders.

  • #7325 cc7e10e Thanks @mattcosta7! - perf(BaseStyles): Remove expensive :has([data-color-mode]) selectors

    Remove :has([data-color-mode]) selectors that scanned the entire DOM on every style recalculation.
    Input color-scheme is already handled by global selectors in the codebase.

  • #7329 501a41f Thanks @mattcosta7! - perf(Dialog): Add feature flag for CSS :has() selector performance optimization

    • Add primer_react_css_has_selector_perf feature flag (default: false)
    • When flag is OFF: uses legacy body:has(.Dialog.DisableScroll) selector
    • When flag is ON: uses optimized direct body[data-dialog-scroll-disabled] data attribute with ref counting
    • Enables gradual rollout and easy rollback of performance optimization
  • #7342 a8b42b2 Thanks @mattcosta7! - perf(hasInteractiveNodes): Optimize with combined selector and early attribute checks

    • Use combined querySelectorAll selector instead of recursive traversal
    • Check attribute-based states (disabled, hidden, inert) before getComputedStyle
    • Only call getComputedStyle when CSS-based visibility check is needed