React Optimizing Compiler (without memo)

It’s a compiler that automatically generates the equivalent of useMemo and useCallback calls to minimize the cost of re-rendering, while retaining React’s programming model.

Recently, React core Team finished a rewrite of the compiler to make it more …


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by chandra-penugonda

It’s a compiler that automatically generates the equivalent of useMemo and useCallback calls to minimize the cost of re-rendering, while retaining React’s programming model.

Recently, React core Team finished a rewrite of the compiler to make it more reliable and capable after an early preview of React Forget at React Conf 2021. This new architecture allows us to analyze and memoize more complex patterns such as the use of local mutations, and opens up many new compile-time optimization opportunities beyond just being on par with memoization hooks.

Compiled code in React Forget sneak peek video
Compiled code in React Forget sneak peek video

According to Dan Abramov, this could eliminate the need to use React.memo() as well. This is because the compiler apparently memoizes not just the calculation of useMemo() results, but also the resulting React element objects returned by the component.

Watch the original video as it showcases a more in-depth and hands-on experience of using React Forget.


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by chandra-penugonda


Print Share Comment Cite Upload Translate Updates
APA

chandra-penugonda | Sciencx (2022-10-19T16:58:34+00:00) React Optimizing Compiler (without memo). Retrieved from https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/

MLA
" » React Optimizing Compiler (without memo)." chandra-penugonda | Sciencx - Wednesday October 19, 2022, https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/
HARVARD
chandra-penugonda | Sciencx Wednesday October 19, 2022 » React Optimizing Compiler (without memo)., viewed ,<https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/>
VANCOUVER
chandra-penugonda | Sciencx - » React Optimizing Compiler (without memo). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/
CHICAGO
" » React Optimizing Compiler (without memo)." chandra-penugonda | Sciencx - Accessed . https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/
IEEE
" » React Optimizing Compiler (without memo)." chandra-penugonda | Sciencx [Online]. Available: https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/. [Accessed: ]
rf:citation
» React Optimizing Compiler (without memo) | chandra-penugonda | Sciencx | https://www.scien.cx/2022/10/19/react-optimizing-compiler-without-memo/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.