Skip to content

Commit c0b06ff

Browse files
authored
chore: switch to babel resource management transform (#780)
I noticed the resource management proposal was deprecated since there's now a stable transform plugin available. In order to avoid duplicating babel installs, this also updates the other babel packages in the monorepo to match (so we have one copy).
1 parent 2e6ff95 commit c0b06ff

File tree

8 files changed

+611
-497
lines changed

8 files changed

+611
-497
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"react-dom": "^18.2.0"
2424
},
2525
"devDependencies": {
26-
"@babel/core": "^7.22.8",
26+
"@babel/core": "^7.28.4",
2727
"@preact/preset-vite": "^2.3.0",
2828
"@types/react": "^18.0.18",
2929
"@types/react-dom": "^18.0.6",

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function createEsbuildPlugin(filteredPkgList) {
185185
];
186186

187187
const explicitResourceManagement = [
188-
"@babel/plugin-proposal-explicit-resource-management",
188+
"@babel/plugin-transform-explicit-resource-management",
189189
];
190190

191191
const tmp = await babel.transformAsync(result, {

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@
4949
],
5050
"license": "MIT",
5151
"devDependencies": {
52-
"@babel/core": "^7.27.7",
53-
"@babel/plugin-proposal-explicit-resource-management": "^7.27.4",
52+
"@babel/core": "^7.28.4",
53+
"@babel/plugin-transform-explicit-resource-management": "^7.28.0",
5454
"@babel/plugin-syntax-jsx": "^7.27.1",
5555
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
5656
"@babel/plugin-transform-react-jsx": "^7.27.1",
57-
"@babel/plugin-transform-typescript": "^7.27.1",
58-
"@babel/preset-env": "^7.27.2",
57+
"@babel/plugin-transform-typescript": "^7.28.0",
58+
"@babel/preset-env": "^7.28.3",
5959
"@babel/preset-react": "^7.27.1",
6060
"@babel/preset-typescript": "^7.27.1",
61-
"@babel/register": "^7.27.1",
62-
"@babel/standalone": "^7.27.7",
61+
"@babel/register": "^7.28.3",
62+
"@babel/standalone": "^7.28.4",
6363
"@changesets/changelog-github": "^0.5.0",
6464
"@changesets/cli": "^2.27.1",
65-
"@types/babel__traverse": "^7.18.5",
65+
"@types/babel__traverse": "^7.28.0",
6666
"@types/chai": "^4.3.3",
6767
"@types/mocha": "^9.1.1",
6868
"@types/node": "^18.19.103",

packages/preact-transform/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@
4545
"prepublishOnly": "cd ../.. && pnpm build:preact-transform"
4646
},
4747
"dependencies": {
48-
"@babel/helper-module-imports": "^7.22.5",
49-
"@babel/helper-plugin-utils": "^7.22.5",
48+
"@babel/helper-module-imports": "^7.27.1",
49+
"@babel/helper-plugin-utils": "^7.27.1",
5050
"debug": "^4.3.4"
5151
},
5252
"peerDependencies": {
5353
"@babel/core": "^7.0.0"
5454
},
5555
"devDependencies": {
56-
"@babel/core": "^7.22.8",
57-
"@types/babel__core": "^7.20.1",
58-
"@types/babel__helper-module-imports": "^7.18.0",
59-
"@types/babel__helper-plugin-utils": "^7.10.0",
56+
"@babel/core": "^7.28.4",
57+
"@types/babel__core": "^7.20.5",
58+
"@types/babel__helper-module-imports": "^7.18.3",
59+
"@types/babel__helper-plugin-utils": "^7.10.3",
6060
"@types/debug": "^4.1.12",
6161
"@types/prettier": "^2.7.3",
6262
"assert": "^2.0.0",

packages/react-transform/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"prepublishOnly": "cd ../.. && pnpm build:react-transform"
4646
},
4747
"dependencies": {
48-
"@babel/helper-module-imports": "^7.22.5",
49-
"@babel/helper-plugin-utils": "^7.22.5",
48+
"@babel/helper-module-imports": "^7.27.1",
49+
"@babel/helper-plugin-utils": "^7.27.1",
5050
"@preact/signals-react": "workspace:^3.3.0",
5151
"debug": "^4.3.4",
5252
"use-sync-external-store": "^1.2.0"
@@ -56,10 +56,10 @@
5656
"react": "^16.14.0 || 17.x || 18.x || 19.x"
5757
},
5858
"devDependencies": {
59-
"@babel/core": "^7.22.8",
60-
"@types/babel__core": "^7.20.1",
61-
"@types/babel__helper-module-imports": "^7.18.0",
62-
"@types/babel__helper-plugin-utils": "^7.10.0",
59+
"@babel/core": "^7.28.4",
60+
"@types/babel__core": "^7.20.5",
61+
"@types/babel__helper-module-imports": "^7.18.3",
62+
"@types/babel__helper-plugin-utils": "^7.10.3",
6363
"@types/debug": "^4.1.12",
6464
"@types/prettier": "^2.7.3",
6565
"@types/react": "^18.0.18",

packages/react-transform/test/node/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ describe("React Signals Babel Transform", () => {
772772
}
773773

774774
const state: VisitorState = {};
775-
traverse(result.ast, programScopeVisitor, undefined, state);
775+
traverse(result.ast!, programScopeVisitor, undefined, state);
776776

777777
const scope = state.programScope;
778778
if (!scope) {

0 commit comments

Comments
 (0)