Skip to content

The agent that grows with you

feat(desktop,web): enable the React Compiler in both renderer builds

Jaaneek95057c2a6336
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index b3f55444c0a..ef1a9f6d169 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -158,16 +158,20 @@
"get-windows": "9.3.0"
},
"devDependencies": {
+ "@babel/core": "8.0.1",
"@electron/rebuild": "4.2.0",
"@playwright/test": "1.58.2",
+ "@rolldown/plugin-babel": "0.2.3",
"@testing-library/dom": "10.4.1",
"@testing-library/react": "16.3.2",
+ "@types/babel__core": "7.20.5",
"@types/d3-force": "3.0.10",
"@types/hast": "3.0.5",
"@types/node": "22.20.1",
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.3",
+ "babel-plugin-react-compiler": "1.0.0",
"bippy": "0.5.43",
"concurrently": "10.0.4",
"cross-env": "10.1.0",
diff --git a/apps/desktop/src/i18n/plugin-i18n.ts b/apps/desktop/src/i18n/plugin-i18n.ts
index a8e9c79a42b..b5f81b1c54f 100644
--- a/apps/desktop/src/i18n/plugin-i18n.ts
+++ b/apps/desktop/src/i18n/plugin-i18n.ts
@@ -104,13 +104,15 @@ export function createPluginI18n(pluginId: string, track: (dispose: () => void)
* late bundle registration. Pass your plugin id (your default export's `id`). */
export function usePluginI18n(pluginId: string): PluginTranslate {
const { locale } = useI18n()
+ const version = useStore($version)
- // Subscribe so a bundle registered after mount repaints; `translatePlugin`
- // reads the live registry, so the memoized closure needs only id + locale.
- useStore($version)
-
+ // `version` is the registry's change token and must key the translator's
+ // identity: memoized consumers (React.memo, React Compiler output) cache
+ // render slices on `t` itself, so a stable `t` over a mutated registry
+ // serves stale strings after a late bundle registration.
return useCallback(
(key: string, ...args: unknown[]) => translatePlugin(pluginId, locale, key, args),
- [pluginId, locale]
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [pluginId, locale, version]
)
}
diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.ts
index 2d726ee2e05..2289219bd99 100644
--- a/apps/desktop/vite.config.ts
+++ b/apps/desktop/vite.config.ts
@@ -1,5 +1,17 @@
import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
+import babel from '@rolldown/plugin-babel'
+import react, { reactCompilerPreset } from '@vitejs/plugin-react'
+
+/** React Compiler preset scoped to modules that can actually contain
+ * components/hooks (JSX syntax or a react-ish import). The preset's default
+ * code filter matches any PascalCase/use* declaration — effectively every TS
+ * module — which made the babel pass parse all ~1.5k source files when only
+ * ~750 are React-bearing. */
+function compilerPreset() {
+ const preset = reactCompilerPreset()
+ preset.rolldown.filter.code = /\/>|<\/|from\s*['"][^'"]*react/
+ return preset
+}
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
import fs from 'fs'
@@ -91,7 +103,12 @@ const emojibaseAssets = () => ({
export default defineConfig(({ command }) => ({
base: './',
- plugins: [react(), tailwindcss(), emojibaseAssets()],
+ plugins: [
+ react(),
+ babel({ presets: [compilerPreset()] }),
+ tailwindcss(),
+ emojibaseAssets()
+ ],
css: {
// Pin an explicit (empty) PostCSS config. Tailwind is handled entirely by
// `@tailwindcss/vite`, so the renderer needs no PostCSS plugins — and
diff --git a/package-lock.json b/package-lock.json
index c50dd25d736..97bd033637e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -141,16 +141,20 @@
"web-haptics": "0.0.6"
},
"devDependencies": {
+ "@babel/core": "8.0.1",
"@electron/rebuild": "4.2.0",
"@playwright/test": "1.58.2",
+ "@rolldown/plugin-babel": "0.2.3",
"@testing-library/dom": "10.4.1",
"@testing-library/react": "16.3.2",
+ "@types/babel__core": "7.20.5",
"@types/d3-force": "3.0.10",
"@types/hast": "3.0.5",
"@types/node": "22.20.1",
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.3",
+ "babel-plugin-react-compiler": "1.0.0",
"bippy": "0.5.43",
"concurrently": "10.0.4",
"cross-env": "10.1.0",
@@ -173,6 +177,241 @@
"get-windows": "9.3.0"
}
},
+ "apps/desktop/node_modules/@babel/code-frame": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.0.tgz",
+ "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^8.0.0",
+ "js-tokens": "^10.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/compat-data": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-8.0.0.tgz",
+ "integrity": "sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/core": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.1.tgz",
+ "integrity": "sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/generator": "^8.0.0",
+ "@babel/helper-compilation-targets": "^8.0.0",
+ "@babel/helpers": "^8.0.0",
+ "@babel/parser": "^8.0.0",
+ "@babel/template": "^8.0.0",
+ "@babel/traverse": "^8.0.0",
+ "@babel/types": "^8.0.0",
+ "@types/gensync": "^1.0.5",
+ "convert-source-map": "^2.0.0",
+ "empathic": "^2.0.1",
+ "gensync": "^1.0.0-beta.2",
+ "import-meta-resolve": "^4.2.0",
+ "json5": "^2.2.3",
+ "obug": "^2.1.1",
+ "semver": "^7.7.3"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "apps/desktop/node_modules/@babel/core/node_modules/semver": {
+ "version": "7.8.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "apps/desktop/node_modules/@babel/generator": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.0.tgz",
+ "integrity": "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^8.0.0",
+ "@babel/types": "^8.0.0",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "@types/jsesc": "^2.5.0",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-compilation-targets": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-8.0.0.tgz",
+ "integrity": "sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^8.0.0",
+ "@babel/helper-validator-option": "^8.0.0",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^11.0.0",
+ "semver": "^7.7.3"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+ "version": "7.8.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-globals": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-8.0.0.tgz",
+ "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-string-parser": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz",
+ "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-validator-identifier": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz",
+ "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helper-validator-option": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-8.0.0.tgz",
+ "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/helpers": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-8.0.0.tgz",
+ "integrity": "sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^8.0.0",
+ "@babel/types": "^8.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/parser": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz",
+ "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^8.0.4"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/template": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-8.0.0.tgz",
+ "integrity": "sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/parser": "^8.0.0",
+ "@babel/types": "^8.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/traverse": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-8.0.4.tgz",
+ "integrity": "sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/generator": "^8.0.0",
+ "@babel/helper-globals": "^8.0.0",
+ "@babel/parser": "^8.0.4",
+ "@babel/template": "^8.0.0",
+ "@babel/types": "^8.0.4",
+ "obug": "^2.1.1"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "apps/desktop/node_modules/@babel/types": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz",
+ "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^8.0.0",
+ "@babel/helper-validator-identifier": "^8.0.4"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
"apps/desktop/node_modules/@electron/get": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz",
@@ -195,6 +434,37 @@
"global-agent": "^3.0.0"
}
},
+ "apps/desktop/node_modules/@rolldown/plugin-babel": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.3.tgz",
+ "integrity": "sha512-+zEk16yGlz1F9STiRr6uG9hmIXb6nprjLczV/htGptYuLoCuxb+itZ03RKCEeOhBpDDd1NU7qF6x1VLMUp62bw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=22.12.0 || ^24.0.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.29.0 || ^8.0.0-rc.1",
+ "@babel/plugin-transform-runtime": "^7.29.0 || ^8.0.0-rc.1",
+ "@babel/runtime": "^7.27.0 || ^8.0.0-rc.1",
+ "rolldown": "^1.0.0-rc.5",
+ "vite": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/plugin-transform-runtime": {
+ "optional": true
+ },
+ "@babel/runtime": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
"apps/desktop/node_modules/blobatar": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/blobatar/-/blobatar-2.0.0.tgz",
@@ -247,6 +517,23 @@
"node": ">= 4"
}
},
+ "apps/desktop/node_modules/js-tokens": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz",
+ "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "apps/desktop/node_modules/lru-cache": {
+ "version": "11.5.2",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
+ "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
"apps/desktop/node_modules/undici-types": {
"version": "7.18.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
@@ -6092,6 +6379,51 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/babel__core": {
+ "version": "7.20.5",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7",
+ "@types/babel__generator": "*",
+ "@types/babel__template": "*",
+ "@types/babel__traverse": "*"
+ }
+ },
+ "node_modules/@types/babel__generator": {
+ "version": "7.27.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",
+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__template": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__traverse": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",
+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.28.2"
+ }
+ },
"node_modules/@types/cacheable-request": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz",
@@ -6418,6 +6750,13 @@
"@types/node": "*"
}
},
+ "node_modules/@types/gensync": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.5.tgz",
+ "integrity": "sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/geojson": {
"version": "7946.0.16",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
@@ -6440,6 +6779,13 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/jsesc": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/@types/jsesc/-/jsesc-2.5.1.tgz",
+ "integrity": "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -7628,6 +7974,16 @@
"node": ">= 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/bail": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz",
@@ -10038,6 +10394,16 @@
"emojibase": "*"
}
},
+ "node_modules/empathic": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.1.tgz",
+ "integrity": "sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/encoding": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
@@ -19225,17 +19591,291 @@
"unicode-animations": "1.0.3"
},
"devDependencies": {
+ "@babel/core": "8.0.1",
+ "@rolldown/plugin-babel": "0.2.3",
+ "@types/babel__core": "7.20.5",
"@types/node": "22.20.1",
"@types/qrcode": "1.5.6",
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.3",
+ "babel-plugin-react-compiler": "1.0.0",
"eslint-plugin-react-refresh": "0.5.3",
"three": "0.180.0",
"typescript": "6.0.3",
"vite": "8.2.0",
"vitest": "4.1.10"
}
+ },
+ "web/node_modules/@babel/code-frame": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.0.tgz",
+ "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^8.0.0",
+ "js-tokens": "^10.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/compat-data": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-8.0.0.tgz",
+ "integrity": "sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/core": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.1.tgz",
+ "integrity": "sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/generator": "^8.0.0",
+ "@babel/helper-compilation-targets": "^8.0.0",
+ "@babel/helpers": "^8.0.0",
+ "@babel/parser": "^8.0.0",
+ "@babel/template": "^8.0.0",
+ "@babel/traverse": "^8.0.0",
+ "@babel/types": "^8.0.0",
+ "@types/gensync": "^1.0.5",
+ "convert-source-map": "^2.0.0",
+ "empathic": "^2.0.1",
+ "gensync": "^1.0.0-beta.2",
+ "import-meta-resolve": "^4.2.0",
+ "json5": "^2.2.3",
+ "obug": "^2.1.1",
+ "semver": "^7.7.3"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "web/node_modules/@babel/generator": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.0.tgz",
+ "integrity": "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^8.0.0",
+ "@babel/types": "^8.0.0",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "@types/jsesc": "^2.5.0",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helper-compilation-targets": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-8.0.0.tgz",
+ "integrity": "sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^8.0.0",
+ "@babel/helper-validator-option": "^8.0.0",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^11.0.0",
+ "semver": "^7.7.3"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helper-globals": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-8.0.0.tgz",
+ "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helper-string-parser": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz",
+ "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helper-validator-identifier": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz",
+ "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helper-validator-option": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-8.0.0.tgz",
+ "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/helpers": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-8.0.0.tgz",
+ "integrity": "sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^8.0.0",
+ "@babel/types": "^8.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/parser": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz",
+ "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^8.0.4"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/template": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-8.0.0.tgz",
+ "integrity": "sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/parser": "^8.0.0",
+ "@babel/types": "^8.0.0"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/traverse": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-8.0.4.tgz",
+ "integrity": "sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^8.0.0",
+ "@babel/generator": "^8.0.0",
+ "@babel/helper-globals": "^8.0.0",
+ "@babel/parser": "^8.0.4",
+ "@babel/template": "^8.0.0",
+ "@babel/types": "^8.0.4",
+ "obug": "^2.1.1"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@babel/types": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz",
+ "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^8.0.0",
+ "@babel/helper-validator-identifier": "^8.0.4"
+ },
+ "engines": {
+ "node": "^22.18.0 || >=24.11.0"
+ }
+ },
+ "web/node_modules/@rolldown/plugin-babel": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.3.tgz",
+ "integrity": "sha512-+zEk16yGlz1F9STiRr6uG9hmIXb6nprjLczV/htGptYuLoCuxb+itZ03RKCEeOhBpDDd1NU7qF6x1VLMUp62bw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=22.12.0 || ^24.0.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.29.0 || ^8.0.0-rc.1",
+ "@babel/plugin-transform-runtime": "^7.29.0 || ^8.0.0-rc.1",
+ "@babel/runtime": "^7.27.0 || ^8.0.0-rc.1",
+ "rolldown": "^1.0.0-rc.5",
+ "vite": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/plugin-transform-runtime": {
+ "optional": true
+ },
+ "@babel/runtime": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "web/node_modules/js-tokens": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz",
+ "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "web/node_modules/lru-cache": {
+ "version": "11.5.2",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
+ "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "web/node_modules/semver": {
+ "version": "7.8.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
}
}
}
diff --git a/web/package.json b/web/package.json
index e4169ffe6b1..74b5f3cb8b3 100644
--- a/web/package.json
+++ b/web/package.json
@@ -40,11 +40,15 @@
"unicode-animations": "1.0.3"
},
"devDependencies": {
+ "@babel/core": "8.0.1",
+ "@rolldown/plugin-babel": "0.2.3",
+ "@types/babel__core": "7.20.5",
"@types/node": "22.20.1",
"@types/qrcode": "1.5.6",
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "6.0.3",
+ "babel-plugin-react-compiler": "1.0.0",
"eslint-plugin-react-refresh": "0.5.3",
"three": "0.180.0",
"typescript": "6.0.3",
diff --git a/web/vite.config.ts b/web/vite.config.ts
index 430a3414989..b23b716d063 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -1,5 +1,16 @@
import { defineConfig, type Plugin } from "vite";
-import react from "@vitejs/plugin-react";
+import babel from "@rolldown/plugin-babel";
+import react, { reactCompilerPreset } from "@vitejs/plugin-react";
+
+/** React Compiler preset scoped to modules that can actually contain
+ * components/hooks (JSX syntax or a react-ish import). The preset's default
+ * code filter matches any PascalCase/use* declaration — effectively every TS
+ * module — which made the babel pass parse the whole codebase. */
+function compilerPreset() {
+ const preset = reactCompilerPreset();
+ preset.rolldown.filter.code = /\/>|<\/|from\s*['"][^'"]*react/;
+ return preset;
+}
import tailwindcss from "@tailwindcss/vite";
import path from "path";
@@ -58,7 +69,12 @@ function hermesDevToken(): Plugin {
}
export default defineConfig({
- plugins: [react(), tailwindcss(), hermesDevToken()],
+ plugins: [
+ react(),
+ babel({ presets: [compilerPreset()] }),
+ tailwindcss(),
+ hermesDevToken(),
+ ],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
diff --git a/web/vitest.config.ts b/web/vitest.config.ts
index 34baae684e8..63c8927716f 100644
--- a/web/vitest.config.ts
+++ b/web/vitest.config.ts
@@ -1,9 +1,17 @@
import { defineConfig } from "vitest/config";
-import react from "@vitejs/plugin-react";
+import babel from "@rolldown/plugin-babel";
+import react, { reactCompilerPreset } from "@vitejs/plugin-react";
+
+/** Same component/hook-scoped compiler preset as vite.config.ts. */
+function compilerPreset() {
+ const preset = reactCompilerPreset();
+ preset.rolldown.filter.code = /\/>|<\/|from\s*['"][^'"]*react/;
+ return preset;
+}
import path from "path";
export default defineConfig({
- plugins: [react()],
+ plugins: [react(), babel({ presets: [compilerPreset()] })],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),