Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohebifar/react-unforget
DEPRECATED | ⚠️ Use React Compiler instead ⚠️ | A compiler for automatic optimization of React apps
https://github.com/mohebifar/react-unforget
babel react react-forget
Last synced: 4 months ago
JSON representation
DEPRECATED | ⚠️ Use React Compiler instead ⚠️ | A compiler for automatic optimization of React apps
- Host: GitHub
- URL: https://github.com/mohebifar/react-unforget
- Owner: mohebifar
- License: mit
- Created: 2024-02-24T21:55:29.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-02T17:45:22.000Z (8 months ago)
- Last Synced: 2024-06-02T19:32:24.089Z (8 months ago)
- Topics: babel, react, react-forget
- Language: TypeScript
- Homepage: https://react-unforget.vercel.app/
- Size: 1.02 MB
- Stars: 396
- Watchers: 4
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
> **[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](https://react-unforget.vercel.app/).
### 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
- **Intelligent component and hook memoization**: Automatically identifies and memoizes React components and hooks, ensuring that only necessary re-renders occur. This leads to a more performant yet with more readable code.
- **Granular JSX element unwrapping**: Unwraps JSX elements and memoizes each element and expression separately for more effective optimization. Eliminiating the need to use `React.memo`.
- **Memoization beyond early returns**: React Unforget uniquely enables the memoization of values even after early returns in component functions, eliminating the need to restructure your code to comply with the Rules of Hooks. This ensures optimization without altering the logical flow of your components.## 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.