mohebifar / react-unforget

DEPRECATED | ⚠️ Use React Compiler instead ⚠️ | A compiler for automatic optimization of React apps
https://react-unforget.vercel.app/
MIT License
391 stars 4 forks source link
babel react react-forget

[2023-06-02] Note ⚠ - React Unforget was an experimental project developed before the release of the React Compiler. As the React Compiler is now available, we recommend using it instead of React Unforget for your projects. For more information and to get started with the React Compiler, visit the official documentation: React Compiler


React Unforget

React Unforget is a compiler designed to enhance the performance of React applications through intelligent memoization and optimization. By analyzing and transforming React components and hooks, React Unforget aims to reduce unnecessary re-renders and optimize the execution flow, thus bridging the performance gap with more efficient frameworks like Svelte.

For demos and more information, visit the official website.

How It Works

The transformation process involves two main steps:

  1. Computing Dependency Graph: The initial step involves creating a segment from the root block statement and performing a dependency graph traversal to understand the interdependencies between various code segments.

  2. Transforming Segments: Based on the dependency graph, code segments are transformed to optimize their execution and reduce unnecessary computations.

Features

Comparison with React Compiler

React Compiler (Forget) is still under development and its release date remains uncertain. React Unforget offers an alternative approach to optimizing React applications, similar to how Preact serves as an alternative to React. It not only provides a fallback option but also pushes the boundaries of what's possible within the React ecosystem, encouraging innovation and diversity in optimization techniques.

License

React Unforget is open-source software licensed under the MIT license. Feel free to use, modify, and distribute it as per the license terms.