Skip to content

[core] Adopt react compiler? #809

Open
@oliviertassinari

Description

@oliviertassinari

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

Motivation

Performance.

Search keywords: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions