Skip to content

A local-first personal finance app

[AI] Run React Compiler on js/ts files in addition to jsx/tsx (#8650)

Matiss Janis Aboltins74ffe101b454
diff --git a/packages/component-library/.storybook/main.ts b/packages/component-library/.storybook/main.ts
index 6d3c98585e..38ffc6df02 100644
--- a/packages/component-library/.storybook/main.ts
+++ b/packages/component-library/.storybook/main.ts
@@ -8,7 +8,7 @@ import react, { reactCompilerPreset } from '@vitejs/plugin-react';
// Any workspace package's source; node_modules stays excluded by the babel
// plugin's default exclude.
const reactCompilerInclude =
- /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx(?:$|\?)/;
+ /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx?(?:$|\?)/;
/**
* This function is used to resolve the absolute path of a package.
diff --git a/packages/component-library/vitest.web.config.ts b/packages/component-library/vitest.web.config.ts
index 638c329cd1..39415ed488 100644
--- a/packages/component-library/vitest.web.config.ts
+++ b/packages/component-library/vitest.web.config.ts
@@ -5,7 +5,7 @@ import { defineConfig } from 'vitest/config';
// Any workspace package's source; node_modules stays excluded by the babel
// plugin's default exclude.
const reactCompilerInclude =
- /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx(?:$|\?)/;
+ /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx?(?:$|\?)/;
export default defineConfig({
test: {
diff --git a/packages/desktop-client/vite.config.mts b/packages/desktop-client/vite.config.mts
index f7b20092bd..cab3ce3bc9 100644
--- a/packages/desktop-client/vite.config.mts
+++ b/packages/desktop-client/vite.config.mts
@@ -28,7 +28,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
// automatically. Third-party code is never compiled: the babel plugin's
// default exclude (node_modules) still applies alongside this include.
const reactCompilerInclude =
- /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx(?:$|\?)/;
+ /[\\/]packages[\\/][^\\/]+[\\/]src[\\/].*\.[jt]sx?(?:$|\?)/;
const addWatchers = (): Plugin => ({
name: 'add-watchers',
diff --git a/upcoming-release-notes/react-compiler-js-ts.md b/upcoming-release-notes/react-compiler-js-ts.md
new file mode 100644
index 0000000000..8342ad75a9
--- /dev/null
+++ b/upcoming-release-notes/react-compiler-js-ts.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+Run React Compiler on .js/.ts files (e.g. hooks) in addition to .jsx/.tsx