From 4918b69d0a64f47847d3443a9d867fd5238a2bd8 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 26 May 2025 21:06:53 +0200 Subject: [PATCH] improve performance by enabling the react compiler (#1087) --- commafeed-client/package-lock.json | 11 +++++++++++ commafeed-client/package.json | 1 + commafeed-client/vite.config.ts | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/commafeed-client/package-lock.json b/commafeed-client/package-lock.json index 87c7741d..2152bc77 100644 --- a/commafeed-client/package-lock.json +++ b/commafeed-client/package-lock.json @@ -61,6 +61,7 @@ "@types/tinycon": "^0.6.7", "@vitejs/plugin-react": "^4.5.0", "babel-plugin-macros": "^3.1.0", + "babel-plugin-react-compiler": "^19.1.0-rc.2", "jsdom": "^26.1.0", "rollup-plugin-visualizer": "^6.0.0", "typescript": "^5.8.3", @@ -2824,6 +2825,16 @@ "node": ">= 6" } }, + "node_modules/babel-plugin-react-compiler": { + "version": "19.1.0-rc.2", + "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-19.1.0-rc.2.tgz", + "integrity": "sha512-kSNA//p5fMO6ypG8EkEVPIqAjwIXm5tMjfD1XRPL/sRjYSbJ6UsvORfaeolNWnZ9n310aM0xJP7peW26BuCVzA==", + "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", diff --git a/commafeed-client/package.json b/commafeed-client/package.json index b26e6336..7fa4988f 100644 --- a/commafeed-client/package.json +++ b/commafeed-client/package.json @@ -68,6 +68,7 @@ "@types/tinycon": "^0.6.7", "@vitejs/plugin-react": "^4.5.0", "babel-plugin-macros": "^3.1.0", + "babel-plugin-react-compiler": "^19.1.0-rc.2", "jsdom": "^26.1.0", "rollup-plugin-visualizer": "^6.0.0", "typescript": "^5.8.3", diff --git a/commafeed-client/vite.config.ts b/commafeed-client/vite.config.ts index 22fc6c3f..35bc32a1 100644 --- a/commafeed-client/vite.config.ts +++ b/commafeed-client/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig(() => ({ plugins: [ react({ babel: { - plugins: ["@lingui/babel-plugin-lingui-macro"], + plugins: [["babel-plugin-react-compiler", { target: "19" }], "@lingui/babel-plugin-lingui-macro"], }, }), lingui(),