feat: enable React Compiler on Next 16

Auto-memoization via babel-plugin-react-compiler (stable in Next 16),
compiled through Turbopack's built-in babel. Build and test suite pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-07-06 10:02:58 +03:30
co-authored by Claude Fable 5
parent 374a9d5350
commit 08dd9e408b
3 changed files with 14 additions and 0 deletions
+2
View File
@@ -5,6 +5,8 @@ const nextConfig = {
// متادیتا (canonical/OG/keywords) باید داخل <head> رندر شود نه استریم در <body>.
// از Next 15.2 استریم متادیتا پیش‌فرض است؛ این regex همه‌ی UAها را blocking می‌کند.
htmlLimitedBots: /.*/,
// React Compiler (پایدار در Next 16) — memoization خودکار کامپوننت‌ها.
reactCompiler: true,
images: {
remotePatterns: [
{
+11
View File
@@ -60,6 +60,7 @@
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^4.7.0",
"babel-plugin-react-compiler": "^1.0.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.10",
@@ -3163,6 +3164,16 @@
"npm": ">=6"
}
},
"node_modules/babel-plugin-react-compiler": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz",
"integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.26.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+1
View File
@@ -67,6 +67,7 @@
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^4.7.0",
"babel-plugin-react-compiler": "^1.0.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.10",