From 677ef35ff7bf234a272b4dd6a38ed0a644041ac4 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Mon, 2 Mar 2026 07:20:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9B=86=E6=88=90=20React=20Compiler?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=20memoization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/bun.lock | 3 +++ web/package.json | 1 + web/vite.config.ts | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/bun.lock b/web/bun.lock index 5246679..9273a7e 100644 --- a/web/bun.lock +++ b/web/bun.lock @@ -17,6 +17,7 @@ "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^5.1.4", + "babel-plugin-react-compiler": "^1.0.0", "tailwindcss": "^4.2.1", "typescript": "^5.9.3", "vite": "^7.3.1", @@ -433,6 +434,8 @@ "babel-plugin-polyfill-regenerator": ["babel-plugin-polyfill-regenerator@0.6.6", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.6" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-hYm+XLYRMvupxiQzrvXUj7YyvFFVfv5gI0R71AJzudg1g2AI2vyCPPIFEBjk162/wFzti3inBHo7isWFuEVS/A=="], + "babel-plugin-react-compiler": ["babel-plugin-react-compiler@1.0.0", "", { "dependencies": { "@babel/types": "^7.26.0" } }, "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw=="], + "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "baseline-browser-mapping": ["baseline-browser-mapping@2.10.0", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA=="], diff --git a/web/package.json b/web/package.json index 3e036ff..87674d4 100644 --- a/web/package.json +++ b/web/package.json @@ -15,6 +15,7 @@ "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^5.1.4", + "babel-plugin-react-compiler": "^1.0.0", "tailwindcss": "^4.2.1", "typescript": "^5.9.3", "vite": "^7.3.1", diff --git a/web/vite.config.ts b/web/vite.config.ts index 1cf9a81..951918b 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -5,7 +5,7 @@ import { VitePWA } from "vite-plugin-pwa"; export default defineConfig({ plugins: [ - react(), + react({ babel: { plugins: ["babel-plugin-react-compiler"] } }), tailwindcss(), VitePWA({ registerType: "autoUpdate",