[compiler] Remove @babel/plugin-proposal-private-methods (#34715)
redo of #34458 but fixing up prettier Co-authored-by: Arnaud Barré <arnaud.barre@carbometrix.com>
Joseph Savona committed
Oct 3, 2025 at 09:13 UTC
85c427d822baad6e654256b707b7d8755da7db26
9 files changed
+4
-40
compiler/packages/eslint-plugin-react-compiler/babel.config.js
-1
@@ -10,6 +10,5 @@ module.exports = {
10
plugins: [
11
['@babel/plugin-transform-private-property-in-object', {loose: true}],
12
['@babel/plugin-transform-class-properties', {loose: true}],
13
- ['@babel/plugin-transform-private-methods', {loose: true}],
13
],
14
};
compiler/packages/eslint-plugin-react-compiler/package.json
-1
@@ -14,7 +14,6 @@
14
"dependencies": {
15
"@babel/core": "^7.24.4",
16
"@babel/parser": "^7.24.4",
17
- "@babel/plugin-proposal-private-methods": "^7.18.6",
17
"hermes-parser": "^0.25.1",
18
"zod": "^3.22.4",
19
"zod-validation-error": "^3.0.3"
compiler/packages/eslint-plugin-react-compiler/src/shared/RunReactCompiler.ts
+1
-6
@@ -8,8 +8,6 @@
8
import {transformFromAstSync} from '@babel/core';
9
import {parse as babelParse} from '@babel/parser';
10
import {File} from '@babel/types';
11
-// @ts-expect-error: no types available
12
-import PluginProposalPrivateMethods from '@babel/plugin-proposal-private-methods';
11
import BabelPluginReactCompiler, {
12
parsePluginOptions,
13
validateEnvironmentConfig,
@@ -145,10 +143,7 @@ function runReactCompilerImpl({
143
filename,
144
highlightCode: false,
145
retainLines: true,
148
- plugins: [
149
- [PluginProposalPrivateMethods, {loose: true}],
150
- [BabelPluginReactCompiler, options],
151
- ],
146
+ plugins: [[BabelPluginReactCompiler, options]],
147
sourceType: 'module',
148
configFile: false,
149
babelrc: false,
compiler/packages/eslint-plugin-react-compiler/tsup.config.ts
+1
-7
@@ -10,13 +10,7 @@ import {defineConfig} from 'tsup';
10
export default defineConfig({
11
entry: ['./src/index.ts'],
12
outDir: './dist',
13
- external: [
14
- '@babel/core',
15
- '@babel/plugin-proposal-private-methods',
16
- 'hermes-parser',
17
- 'zod',
18
- 'zod-validation-error',
19
- ],
13
+ external: ['@babel/core', 'hermes-parser', 'zod', 'zod-validation-error'],
14
splitting: false,
15
sourcemap: false,
16
dts: false,
compiler/yarn.lock
+1
-9
@@ -326,7 +326,7 @@
326
lru-cache "^5.1.1"
327
semver "^6.3.1"
328
329
-"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.25.9", "@babel/helper-create-class-features-plugin@^7.27.0":
329
+"@babel/helper-create-class-features-plugin@^7.25.9", "@babel/helper-create-class-features-plugin@^7.27.0":
330
version "7.27.0"
331
resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.0.tgz"
332
integrity sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==
@@ -706,14 +706,6 @@
706
"@babel/helper-plugin-utils" "^7.25.9"
707
"@babel/traverse" "^7.25.9"
708
709
-"@babel/plugin-proposal-private-methods@^7.18.6":
710
- version "7.18.6"
711
- resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz"
712
- integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==
713
- dependencies:
714
- "@babel/helper-create-class-features-plugin" "^7.18.6"
715
- "@babel/helper-plugin-utils" "^7.18.6"
716
-
709
"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2":
710
version "7.21.0-placeholder-for-preset-env.2"
711
resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz"
packages/eslint-plugin-react-hooks/package.json
-1
@@ -41,7 +41,6 @@
41
"dependencies": {
42
"@babel/core": "^7.24.4",
43
"@babel/parser": "^7.24.4",
44
- "@babel/plugin-proposal-private-methods": "^7.18.6",
44
"hermes-parser": "^0.25.1",
45
"zod": "^3.22.4",
46
"zod-validation-error": "^3.0.3"
packages/eslint-plugin-react-hooks/src/shared/RunReactCompiler.ts
+1
-6
@@ -9,8 +9,6 @@
9
import {transformFromAstSync} from '@babel/core';
10
import {parse as babelParse} from '@babel/parser';
11
import {File} from '@babel/types';
12
-// @ts-expect-error: no types available
13
-import PluginProposalPrivateMethods from '@babel/plugin-proposal-private-methods';
12
import BabelPluginReactCompiler, {
13
parsePluginOptions,
14
validateEnvironmentConfig,
@@ -147,10 +145,7 @@ function runReactCompilerImpl({
145
filename,
146
highlightCode: false,
147
retainLines: true,
150
- plugins: [
151
- [PluginProposalPrivateMethods, {loose: true}],
152
- [BabelPluginReactCompiler, options],
153
- ],
148
+ plugins: [[BabelPluginReactCompiler, options]],
149
sourceType: 'module',
150
configFile: false,
151
babelrc: false,
scripts/rollup/bundles.js
-1
@@ -1253,7 +1253,6 @@ const bundles = [
1253
preferBuiltins: true,
1254
externals: [
1255
'@babel/core',
1256
- '@babel/plugin-proposal-private-methods',
1256
'hermes-parser',
1257
'zod',
1258
'zod-validation-error',
yarn.lock
-8
@@ -1108,14 +1108,6 @@
1108
"@babel/helper-create-class-features-plugin" "^7.10.4"
1109
"@babel/helper-plugin-utils" "^7.10.4"
1110
1111
-"@babel/plugin-proposal-private-methods@^7.18.6":
1112
- version "7.18.6"
1113
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea"
1114
- integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==
1115
- dependencies:
1116
- "@babel/helper-create-class-features-plugin" "^7.18.6"
1117
- "@babel/helper-plugin-utils" "^7.18.6"
1118
-
1111
"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2":
1112
version "7.21.0-placeholder-for-preset-env.2"
1113
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703"