Skip to content

[slider] Don't re-render every part when the thumbs register - #6093

Open
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/slider-thumb-register
Open

Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/slider-thumb-register

Conversation

@Janpot

@Janpot Janpot commented Oct 23, 2026

Copy link
Copy Markdown
Member

The registered thumbs lived in Root's state, so every Slider part re-rendered when the thumbs registered on mount. Only Slider.Value reads them (for its htmlFor), so they now live in a store it subscribes to on its own. The thumbs also guess their composite index from render order, which avoids their own re-render after mount.

Split out of #5974; its benchmark comment below compares against master.

@Janpot Janpot added component: slider Changes related to the slider component. performance labels Oct 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

commit: a16ff64

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+86B(+0.02%) 🔺+35B(+0.02%)

Details of bundle changes

Performance

No regressions in 36 benchmarks · ran 4m 05s · details

Smoke · Slider

Metric baseline current Δ vs baseline
render 16.6 ms 12.8 ms 🟢 better -31.5% – -14.3%
bench:paint 26.85 ms 21.7 ms 🟢 better -27.7% – -11.0%

Medians; Δ is the confidence interval of the paired per-round difference (99%).


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Oct 23, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit a16ff64
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6adb75f7d9f59e8a5fe64b0f
😎 Deploy Preview https://deploy-preview-6093--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Janpot
Janpot marked this pull request as ready for review October 27, 2026 16:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: slider Changes related to the slider component. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant