[popups] Improve trigger mount performance - #5426
Conversation
Bundle size
PerformanceTotal duration: 1,140.30 ms -85.31 ms(-7.0%) | Renders: 76 (▼-2) | Paint: 1,804.27 ms -143.42 ms(-7.4%)
13 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
702110d to
a3fb892
Compare
|
@claude review low |
PR reviewNothing here is merge-blocking. The refactor is mostly a re-shaping of when state that already existed gets its final value: each popup store now builds its real Bugs (2)1. ℹ️ Menu's floating context now starts closed even when the root mounts openLocation: floatingRootContext: new FloatingRootStore({
open: false,
...Previously Menu did not pass This is almost certainly benign: Popover, Dialog, Tooltip and PreviewCard have always had exactly this shape (their Failure scenario: On the first commit of Fix: No change required if the existing 2. ℹ️ Render-phase
|
This PR reduces the work needed to mount closed popup roots and triggers.
Changes
Performance
Menu results are React render totals from the repository's production benchmark harness. Base UI 1.7.0 is averaged across two runs and this PR across three runs. Popover and Dialog results use the standalone production harness and average two reverse-order fresh-browser runs per version. Every run uses 20 measured iterations with outlier filtering.