Skip to content

perf: add React Compiler #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025
Merged

perf: add React Compiler #109

merged 2 commits into from
Jun 6, 2025

Conversation

xbinaryx
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

This PR installs the React Compiler to optimize our React application by automatically memoizing components and hooks. The compiler helps improve performance by reducing unnecessary re-renders and computations.

What changes did you make? (Give an overview)

1- Installed the following dependencies:

  • babel-plugin-react-compiler@rc
  • eslint-plugin-react-hooks@^6.0.0-rc.1

2- Modified vite.config.ts to include the compiler plugin
3- Added "react-hooks/react-compiler": "error" to enable the React Compiler ESLint rule

Related Issues

This fixes #67 for me

Is there anything you'd like reviewers to focus on?

Copy link

netlify bot commented May 26, 2025

Deploy Preview for eslint-code-explorer ready!

Name Link
🔨 Latest commit bc687bf
🔍 Latest deploy log https://app.netlify.com/projects/eslint-code-explorer/deploys/683818f15502880008fc9cd5
😎 Deploy Preview https://deploy-preview-109--eslint-code-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request aims to optimize our React application by integrating the React Compiler, which automates memoization of components and hooks to reduce unnecessary re-renders.

  • Added configuration in vite.config.ts to enable the React Compiler via the Babel plugin.
  • Upgraded dependencies in package.json including React, babel-plugin-react-compiler, and eslint-plugin-react-hooks.
  • Updated eslint.config.mjs to enforce the new react-hooks/react-compiler rule and temporarily disabled this rule in one component file.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
vite.config.ts Integrated babel-plugin-react-compiler in the React plugin config
src/components/path/index.tsx Temporarily disabled react-hooks/react-compiler for specific use
package.json Upgraded dependencies to support the React Compiler integration
eslint.config.mjs Added new ESLint rule for react-hooks/react-compiler

@lumirlumir
Copy link
Member

Could you take a look at the merge conflicts?

@lumirlumir
Copy link
Member

Could you provide the before/after changes, including bug fixes? Including a benchmark would be nice if possible.

@nzakas
Copy link
Member

nzakas commented May 30, 2025

@lumirlumir can you better describe what you mean by "before/after changes"? It's not clear to me what it is you're requesting.

@xbinaryx
Copy link
Contributor Author

I think he wants a before/after video of the bug fix

Before:
before.mp4
After:
after.mp4

Copy link
Member

@lumirlumir lumirlumir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all for clarifying my words. Since the bug behavior was not reproducible on my end, I needed an alternative way to check it.

LGTM. Would like @amareshsm to verify the bug fix on his end before merging.

@lumirlumir lumirlumir added this to Triage Jun 2, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 2, 2025
@lumirlumir lumirlumir moved this from Needs Triage to Second Review Needed in Triage Jun 2, 2025
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jun 2, 2025
Copy link
Member

@amareshsm amareshsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks.

@amareshsm amareshsm merged commit ef1ad52 into eslint:main Jun 6, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion chore
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Bug: cursor in the code editor jumps to the top while typing.
4 participants