Commit 86d45bf
authored
Add React Compiler with incremental adoption strategy (#1489)
## Description
Added React Compiler to improve performance and catch potential bugs at build time. This PR introduces the React Compiler with an incremental adoption approach, starting with the `src/components/Home/RunSection` directory. The compiler helps optimize React components by eliminating unnecessary re-renders and catching common React issues.
Docs:
https://react.dev/learn/react-compiler/incremental-adoption
https://react.dev/learn/react-compiler/installation
## Type of Change
- [x] Improvement
- [x] Performance optimization
## Checklist
- [x] I have tested this does not break current pipelines / runs functionality
- [x] I have tested the changes on staging
## Implementation Details
- Added `babel-plugin-react-compiler` and `eslint-plugin-react-compiler` dependencies
- Configured ESLint to warn (not error) on React Compiler violations
- Set up directory-based incremental adoption in Vite config
- Fixed several components to be compiler-compatible:
- Removed unnecessary `useCallback` in `RunRow.tsx`
- Fixed hook dependencies in `useAwaitAuthorization.ts`
- Improved state management in `sidebar.tsx`
- Fixed formatting in several UI components
## Test Instructions
1. Run the application and verify the Home page loads correctly
2. Check that the Runs section functions as expected
3. Verify there are no console errors related to React Compiler
## Additional Comments
This is the first step in adopting React Compiler across the codebase. More directories will be added incrementally as they are cleaned up for compiler compatibility.1 parent 0e6a309 commit 86d45bf
File tree
10 files changed
+296
-89
lines changed- src
- components
- Home/RunSection
- ui
- hooks
10 files changed
+296
-89
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments