From a5d5d44c6cafacc3f0383d2169c4da56d469ced1 Mon Sep 17 00:00:00 2001 From: Johannes Klein Agents Date: Mon, 16 Nov 2026 08:44:10 +0100 Subject: [PATCH] Remove the decorator plugin and the TypeScript decorator flag Co-Authored-By: Claude Sonnet 5.5 --- .babelrc | 15 --------------- electron.vite.config.js | 5 ++--- jest/babelTransform.js | 3 +-- package.json | 1 - tsconfig.json | 1 - yarn.lock | 16 ---------------- 6 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index a981a7ab..00000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", { - "targets": { - "node": "current" - } - } - ] - ], - "plugins": [ - ["@babel/plugin-proposal-decorators", { "legacy": true }], - ["@babel/plugin-proposal-class-properties", { "loose": false }] - ] -} diff --git a/electron.vite.config.js b/electron.vite.config.js index 631c5fb4..29a493ec 100644 --- a/electron.vite.config.js +++ b/electron.vite.config.js @@ -47,12 +47,11 @@ export default defineConfig( ( { command } ) => ( { }, }, plugins: [ - // plugin-react 5: its babel option compiles legacy MobX decorators. 6 dropped babel. - // JSX in .js is compiled here too: Vite's oxc parser does not treat .js as JSX. + // plugin-react 5: its babel option compiles JSX in .js files. 6 dropped babel. + // Vite's oxc parser does not treat .js as JSX. react( { babel: { plugins: [ - ['@babel/plugin-proposal-decorators', { legacy: true }], ['@babel/plugin-proposal-class-properties', { loose: false }], ['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }], ], diff --git a/jest/babelTransform.js b/jest/babelTransform.js index 7e13f168..0802f01f 100644 --- a/jest/babelTransform.js +++ b/jest/babelTransform.js @@ -1,6 +1,6 @@ const babelJest = require( 'babel-jest' ); -// Decorator plugins match the page build. preset-env and preset-typescript +// Plugins match the page build. preset-env and preset-typescript // are what Jest needs to load the page's ESM and .tsx imports. module.exports = babelJest.default.createTransformer( { babelrc: false, @@ -10,7 +10,6 @@ module.exports = babelJest.default.createTransformer( { '@babel/preset-typescript', ], plugins: [ - [ '@babel/plugin-proposal-decorators', { legacy: true } ], [ '@babel/plugin-proposal-class-properties', { loose: false } ], [ '@babel/plugin-transform-react-jsx', { runtime: 'automatic' } ], ], diff --git a/package.json b/package.json index bf0f76a0..a7b33ca4 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" electron.vite.config.js jest.config.js \"jest/**/*.js\" --fix" }, "dependencies": { - "@babel/plugin-proposal-decorators": "^7.29.7", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@mui/icons-material": "^7.3.11", diff --git a/tsconfig.json b/tsconfig.json index 534a7d41..0f13d91b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,6 @@ "lib": ["ESNext", "DOM"], "module": "ESNext", "moduleResolution": "bundler", - "experimentalDecorators": true, "useDefineForClassFields": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, diff --git a/yarn.lock b/yarn.lock index d77ea15e..108174ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -684,15 +684,6 @@ "@babel/helper-plugin-utils" "^7.24.7" "@babel/plugin-syntax-decorators" "^7.24.7" -"@babel/plugin-proposal-decorators@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.29.7.tgz#ebc57bd4d711df920a553de8a456a3a020ce0d72" - integrity sha512-EtU0Hi3GvrTqD56xKmZvV/uCXK2ZbwVNPNLAquVItcAZpUhkXwWlo3Fmj0c2LxgSf2I8IDULeAepwNP1OefLXg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.29.7" - "@babel/helper-plugin-utils" "^7.29.7" - "@babel/plugin-syntax-decorators" "^7.29.7" - "@babel/plugin-proposal-nullish-coalescing-operator@^7.16.0": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" @@ -771,13 +762,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.24.7" -"@babel/plugin-syntax-decorators@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.29.7.tgz#9a23ab91fb8e61d142684108bca6f343ceee88f6" - integrity sha512-9MTTLbF39X6sqM92JPEsoI7++26hjZvzkxKZy64aMhWLH2mPkJ/Q3AV4QLmls3R14FpSpkOwQQfUh962JGQxxg== - dependencies: - "@babel/helper-plugin-utils" "^7.29.7" - "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"