mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.03k stars 32.3k forks source link

[core] Adopt react compiler? #44336

Open oliviertassinari opened 2 weeks ago

oliviertassinari commented 2 weeks ago

Summary

Same as https://github.com/mui/base-ui/issues/809.

The action plan would involve:

Motivation

Performance.

Now, to be fair, we likely want to invest time into this for Base UI first, since in Material UI there should be barely anything to optimize (it should be almost only about style).

Janpot commented 2 weeks ago

Now, to be fair, we likely want to invest time into this for Base UI first, since in Material UI there should be barely anything to optimize (it should be almost only about style).

Future versions of the compiler will do jsx inlining and outlining which I think we could benefit from.

oliviertassinari commented 2 weeks ago

@Janpot It seems that we can't use inlining for the npm version: https://github.com/facebook/react/pull/30867#issuecomment-2327473985. It's for end-users. In https://youtu.be/qd5yk2gxbtg?t=861&si=zuNFXoGaxhW_i670 he says that they haven't seen clear performance benefits yet, Sebastian expands more on this in the PR.

Outlining is part of why I got the vib that it's not for UI libraries, the code diff example seems likely to slow things down.

But in any cases, time will tell, curious to explore this more.

Janpot commented 2 weeks ago

Also came across this statement: https://youtu.be/qd5yk2gxbtg?si=UXflMBYjkDbudA2L&t=1061

Screenshot 2024-11-08 at 16 39 47

Doesn't really seemed based on real benchmarking yet though