Skip to content

Conversation

@gaearon
Copy link
Member

@gaearon gaearon commented Oct 11, 2025

No description provided.

@gaearon gaearon marked this pull request as ready for review October 11, 2025 15:03
@meta-cla meta-cla bot added the CLA Signed label Oct 11, 2025
@gaearon gaearon merged commit 6346efd into main Oct 11, 2025
10 checks passed
@github-actions
Copy link

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

[React Compiler](/learn/react-compiler) is a build-time tool that optimizes your React app through automatic memoization.

This stable release is our first of many. The compiler will continue to evolve and improve, and we expect to see it become a new foundation and era for the next decade and more of React.
You can get an intuitive sense of how the Compiler works by [looking at the playground](https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAKhACYQAyeYOAFMEThRGADRFp4A2OCMIgF8AlEWAAdYkTiE6XXvxgJyZSmCIBeZqzAA6bnwH0cWgHzM9dAIY4oGzY4VGYIgNxSiRT1yy4CxAAW1pjkPAgAwjx4cADW9HjkYpLSXrKYkOF6PBAA5glJPkLexD7KdjDEADw08nj8ALZgmsCGSipqbMWEUTGxLcGh4b1xxQD0Zh6YQiDsIOncuSggeA0ADhAwpjgAnmsI4kQACjxQuXiYAPJr+HLCXDAQDUQA5ABG1m8IPAC0a6fnTA-ZTWXA-WTrXgCMbkWg4F5TKSMHxjMYQta8WwBACyFAQyG8IGsPB4EhAUmKYCxYG4CA0JzOF2utwy7lm4ECEAA7gBJTBKTDEsAoHAwKAIIRAA). Fundamentally, React Compiler relies on an old idea from functional programming: pure functions don't "do" anything (they only compute things), so it is safe to reorder their calls, or to reuse their past output for the same inputs. React Compiler checks that your code follows the [Rules of React](https://react.dev/reference/rules) which ensure your code can be reordered this way.
Copy link
Member

@josephsavona josephsavona Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one thing that nags me about this explanation is that most functions in React cannot be treated as pure. We treat components and hooks as pure, but everything else in the component is a giant blob of mutability. What makes the compiler work is precisely modeling data and control flow, inferring types, and tracking mutability and aliasing in order to limit the impact of mutability.

gaearon added a commit that referenced this pull request Oct 11, 2025
gaearon added a commit that referenced this pull request Oct 11, 2025
gaearon added a commit that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants