Unverified 提交 52e5a3f1 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Enable React Compiler (#2259)

Add babel-plugin-react-compiler to the build pipeline to enable automatic memoization and optimization of React components. #skip-bugbot <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Enable React Compiler in the renderer Vite build to automatically memoize and optimize React components. This should reduce unnecessary re-renders and improve UI responsiveness. - **Dependencies** - Added babel-plugin-react-compiler and wired it into @vitejs/plugin-react via Babel (default config). - **Migration** - No code changes required; build-time only. Verify key UI flows for any unexpected behavior. <sup>Written for commit 64fdea33436212d3ba36aa60e5ca014eaf2ab3e5. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: 's avatarClaude <noreply@anthropic.com>
上级 e229b2a9
差异被折叠。
......@@ -66,10 +66,11 @@
"@types/node": "^22.14.0",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@typescript/native-preview": "^7.0.0-dev.20260107.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript/native-preview": "^7.0.0-dev.20260107.1",
"@vitest/ui": "^3.1.1",
"babel-plugin-react-compiler": "^1.0.0",
"cross-env": "^7.0.3",
"drizzle-kit": "^0.30.6",
"electron": "38.2.2",
......
......@@ -3,9 +3,18 @@ import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
const ReactCompilerConfig = {};
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
plugins: [
react({
babel: {
plugins: [["babel-plugin-react-compiler", ReactCompilerConfig]],
},
}),
tailwindcss(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论