Successfully rolling out the compiler to your codebase #8
poteto
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As background, in addition to automatic optimizations the compiler also does static validation of the Rules of React in order to correctly optimize components and hooks.
When the compiler detects a violation of these assumptions, it safely skips over the offending component or hook and continues compiling the rest of your code.
Because the compiler can safely skip these components, please note that it's absolutely not necessary to fix these violations straight away in order for you to see benefits from using the compiler. You can fix these as a second step after you first confirm that your app still works with the optimizations enabled.
We strongly recommend that you first get the compiler working on your app and testing that the app works at all. Once you get to this state, you can start profiling and running experiments to collect data on any changes to performance. After you have done this, you can go back and take a look at the components and hooks with reported errors from eslint-plugin-react-compiler and address them in order to improve memoization coverage.
Our recommended approach for using the compiler is thus:
Beta Was this translation helpful? Give feedback.
All reactions