Skip to content

[internal] Simplify isReactVersionAtLeast()#1047

Merged
oliviertassinari merged 1 commit intomui:masterfrom
oliviertassinari:bundle-size
Dec 12, 2024
Merged

[internal] Simplify isReactVersionAtLeast()#1047
oliviertassinari merged 1 commit intomui:masterfrom
oliviertassinari:bundle-size

Conversation

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Dec 11, 2024

Same as mui/material-ui#43820

parseInt('19.0.0-rc.12131', 10); // returns 19

Off topic. I could see us creating an internal helper and exposing fit from Base UI, this duplication feels off:

A possible path:

  • We remove isReactVersionAtLeast() no need for an abstraction of: >=.
  • We expose majorVersion from @base-ui-components/internal/majorVersion
  • Everything else starts to use it.

The value is then only about abstracting parseInt(React.version, 10) into something simpler.

If we are worried about the coupling of Base UI / Material UI / MUI X (I don't understand this as I think it's a great thing, it forces Base UI to be anchored into its product purpose) but ok, we could replicate the same structure. I see no reason for this to be different.

@mui-bot
Copy link

mui-bot commented Dec 11, 2024

Netlify deploy preview

https://deploy-preview-1047--base-ui.netlify.app/

Generated by 🚫 dangerJS against 935e343

@oliviertassinari oliviertassinari changed the title [core] Simplify isReactVersionAtLeast [core] Simplify isReactVersionAtLeast() Dec 11, 2024
@oliviertassinari oliviertassinari merged commit 71e1459 into mui:master Dec 12, 2024
@oliviertassinari oliviertassinari deleted the bundle-size branch December 12, 2024 21:38
@oliviertassinari oliviertassinari added internal Behind-the-scenes enhancement. Formerly called “core”. and removed core labels Aug 2, 2025
@oliviertassinari oliviertassinari changed the title [core] Simplify isReactVersionAtLeast() [internal] Simplify isReactVersionAtLeast() Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants