base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[core] perf: state classes [draft]

Open romgrk opened this issue 6 months ago • 2 comments

Test case: https://gist.github.com/romgrk/023d376d54f38812c2ba3f91b96eace0

The case above was tested in joy-ui docs because there is fine-tuning to do to ensure babel/swc/next don't add up noise to the benchmark and I already have that fine-tuning done in that repo. If you're interested in reproducing it, you can use this branch: https://github.com/romgrk/joy-ui/tree/perf-test-setup

romgrk avatar May 21 '25 22:05 romgrk

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@1958

commit: c2b0e5a

pkg-pr-new[bot] avatar May 21 '25 22:05 pkg-pr-new[bot]

Deploy Preview for base-ui ready!

Name Link
Latest commit c2b0e5a76c76a7d77eb41395b568ddb731191376
Latest deploy log https://app.netlify.com/projects/base-ui/deploys/682e5286951d2400084a736d
Deploy Preview https://deploy-preview-1958--base-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

netlify[bot] avatar May 21 '25 22:05 netlify[bot]

If we see this affecting and creating perf issues on the styled layer, would it make sense to add this as some kind of config in a centralized place for the library? If the config is enabled, Base UI uses classes as style hooks instead of data attributes. We could try it internally first. Unless of course, adding this overhead is more than using data attributes directly.

mnajdova avatar Aug 25 '25 10:08 mnajdova