Enable React compiler

This commit is contained in:
Kalle
2025-04-26 21:43:43 +03:00
parent a66b5eabd1
commit fdb71b13ce
3 changed files with 48 additions and 0 deletions

33
package-lock.json generated
View File

@@ -45,6 +45,7 @@
"react": "^18.3.1",
"react-aria-components": "^1.8.0",
"react-charts": "^3.0.0-beta.57",
"react-compiler-runtime": "^19.1.0-rc.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^5.0.0",
"react-flip-toolkit": "7.2.4",
@@ -73,11 +74,13 @@
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/web-push": "^3.6.4",
"babel-plugin-react-compiler": "^19.1.0-rc.1",
"cross-env": "^7.0.3",
"ley": "^0.8.1",
"sql-formatter": "^15.6.1",
"typescript": "^5.8.3",
"vite": "^6.3.3",
"vite-plugin-babel": "^1.3.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.2"
}
@@ -8270,6 +8273,16 @@
"uuid": "dist/bin/uuid"
}
},
"node_modules/babel-plugin-react-compiler": {
"version": "19.1.0-rc.1",
"resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-19.1.0-rc.1.tgz",
"integrity": "sha512-M4fpG+Hfq5gWzsJeeMErdRokzg0fdJ8IAk+JDhfB/WLT+U3WwJWR8edphypJrk447/JEvYu6DBFwsTn10bMW4Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.26.0"
}
},
"node_modules/bail": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz",
@@ -14440,6 +14453,15 @@
"@types/react": "^17.0.0"
}
},
"node_modules/react-compiler-runtime": {
"version": "19.1.0-rc.1",
"resolved": "https://registry.npmjs.org/react-compiler-runtime/-/react-compiler-runtime-19.1.0-rc.1.tgz",
"integrity": "sha512-wCt6g+cRh8g32QT18/9blfQHywGjYu+4FlEc3CW1mx3pPxYzZZl1y+VtqxRgnKKBCFLIGUYxog4j4rs5YS86hw==",
"license": "MIT",
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^0.0.0-experimental"
}
},
"node_modules/react-dom": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
@@ -16954,6 +16976,17 @@
"url": "https://opencollective.com/vitest"
}
},
"node_modules/vite-plugin-babel": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/vite-plugin-babel/-/vite-plugin-babel-1.3.0.tgz",
"integrity": "sha512-C5WKX0UwvQKH8WD2GiyWUjI62UBfLbfUhiLexnIm4asLdENX5ymrRipFlBnGeVxoOaYgTL5dh5KW6YDGpWsR8A==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"@babel/core": "^7.0.0",
"vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
}
},
"node_modules/vite-tsconfig-paths": {
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz",

View File

@@ -61,6 +61,7 @@
"react": "^18.3.1",
"react-aria-components": "^1.8.0",
"react-charts": "^3.0.0-beta.57",
"react-compiler-runtime": "^19.1.0-rc.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^5.0.0",
"react-flip-toolkit": "7.2.4",
@@ -89,11 +90,13 @@
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/web-push": "^3.6.4",
"babel-plugin-react-compiler": "^19.1.0-rc.1",
"cross-env": "^7.0.3",
"ley": "^0.8.1",
"sql-formatter": "^15.6.1",
"typescript": "^5.8.3",
"vite": "^6.3.3",
"vite-plugin-babel": "^1.3.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.2"
}

View File

@@ -1,11 +1,16 @@
import { vitePlugin as remix } from "@remix-run/dev";
import { installGlobals } from "@remix-run/node";
import { defineConfig } from "vite";
import babel from "vite-plugin-babel";
import tsconfigPaths from "vite-tsconfig-paths";
import { configDefaults } from "vitest/config";
installGlobals();
const ReactCompilerConfig = {
target: "18",
};
export default defineConfig(() => {
return {
ssr: {
@@ -22,6 +27,13 @@ export default defineConfig(() => {
v3_routeConfig: true,
},
}),
babel({
filter: /\.[jt]sx?$/,
babelConfig: {
presets: ["@babel/preset-typescript"],
plugins: [["babel-plugin-react-compiler", ReactCompilerConfig]],
},
}),
tsconfigPaths(),
],
test: {