Skip to content

Enable the React Compiler#3785

Open
mwiencek wants to merge 1 commit into
metabrainz:masterfrom
mwiencek:react-compiler
Open

Enable the React Compiler#3785
mwiencek wants to merge 1 commit into
metabrainz:masterfrom
mwiencek:react-compiler

Conversation

@mwiencek
Copy link
Copy Markdown
Member

Now that our codebase is running React v19 and presumably follows the Rules of React [1], we can enable the React Compiler [2] for automatic memoization and optimization of our components.

This should mean we no longer have to add manual calls to useMemo, useCallback, or React.memo either, though existing uses don't hurt and I'm not removing them here.

[1] https://react.dev/reference/rules
[2] https://react.dev/learn/react-compiler

Testing

Browsed the site for a while and submitted various edit pages with the JS console open. Didn't observe any issues or new warnings. Also checked diffs of the JS output before & after enabling the compiler to see if there was anything unusual.

Now that our codebase is running React v19 and presumably follows the Rules of
React [1], we can enable the React Compiler [2] for automatic memoization and
optimization of our components.

This should mean we no longer have to add manual calls to `useMemo`,
`useCallback`, or `React.memo` either, though existing uses don't hurt and I'm
not removing them here.

[1] https://react.dev/reference/rules
[2] https://react.dev/learn/react-compiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant