mui / mui/base-ui

[internal] Adopt react compiler?

Open
#809 2 comments 5 reactions 0 assignees View on GitHub
discussion internal performance scope: all components scope: code-infra
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

### Summary

Per https://youtu.be/qd5yk2gxbtg?t=1061&si=ZueAd7hJ3rvYQBod we might want to explore adopting the react compiler.

The main question is does this even make sense? I suspect that we need to cherry-pick the optimizations that help and opt out of the harmful ones (extra bundle size, wasted CPU cycles, extra memory), using some sort of test app. Because we are almost exclusively leaf components, maybe this could be mostly harmful, not having much in the render tree that is pruned.

Another blocker is the overall community interest in this, which seems low: https://npm-stat.com/charts.html?package=babel-plugin-react-compiler&package=eslint-plugin-react-compiler for now.

The action plan would involve:

- [ ] Lint the codebase with eslint-plugin-react-compiler.
- [ ] Run all the tests on the output of the compiler. I believe we already do this with the Babel optimizations that we have, so won't be too hard. It's important to guarantee behavior.
- [ ] Publish the source with the output of the compiler.

### Examples

- https://github.com/TanStack/table/issues/5567
- https://github.com/TanStack/virtual/issues/736

### Motivation

Performance.

**Search keywords**: -

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.