Skip to content

Commit

Permalink
use @react-native/babel-preset instead of `metro-react-native-babel…
Browse files Browse the repository at this point in the history
…-preset`

`metro-react-native-babel-preset` has been moved to the `react-native` repo and is now published as `react-native/babel-preset`.

See:
- facebook/metro#1024
- facebook/react-native#38228
  • Loading branch information
zetavg committed Jul 1, 2024
1 parent 2a36c99 commit de360bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 60 deletions.
2 changes: 1 addition & 1 deletion packages/vite-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@babel/core": "^7.21.8",
"metro-react-native-babel-preset": "^0.77.0"
"@react-native/babel-preset": "^0.74.84"
},
"devDependencies": {
"@biomejs/biome": "^1.6.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-flow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function transformFlow(input: string) {
babel.transform(
input,
{
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
},
(err: any, result) => {
if (!result || err) rej(err || 'no res')
Expand Down
60 changes: 2 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4616,7 +4616,7 @@ __metadata:
languageName: node
linkType: hard

"@react-native/babel-preset@npm:0.74.84":
"@react-native/babel-preset@npm:0.74.84, @react-native/babel-preset@npm:^0.74.84":
version: 0.74.84
resolution: "@react-native/babel-preset@npm:0.74.84"
dependencies:
Expand Down Expand Up @@ -7418,8 +7418,8 @@ __metadata:
dependencies:
"@babel/core": ^7.21.8
"@biomejs/biome": ^1.6.3
"@react-native/babel-preset": ^0.74.84
"@tamagui/build": ^1.100.0
metro-react-native-babel-preset: ^0.77.0
vite: 6.0.0-alpha.18
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -13086,55 +13086,6 @@ __metadata:
languageName: node
linkType: hard

"metro-react-native-babel-preset@npm:^0.77.0":
version: 0.77.0
resolution: "metro-react-native-babel-preset@npm:0.77.0"
dependencies:
"@babel/core": ^7.20.0
"@babel/plugin-proposal-async-generator-functions": ^7.0.0
"@babel/plugin-proposal-class-properties": ^7.18.0
"@babel/plugin-proposal-export-default-from": ^7.0.0
"@babel/plugin-proposal-nullish-coalescing-operator": ^7.18.0
"@babel/plugin-proposal-numeric-separator": ^7.0.0
"@babel/plugin-proposal-object-rest-spread": ^7.20.0
"@babel/plugin-proposal-optional-catch-binding": ^7.0.0
"@babel/plugin-proposal-optional-chaining": ^7.20.0
"@babel/plugin-syntax-dynamic-import": ^7.8.0
"@babel/plugin-syntax-export-default-from": ^7.0.0
"@babel/plugin-syntax-flow": ^7.18.0
"@babel/plugin-syntax-nullish-coalescing-operator": ^7.0.0
"@babel/plugin-syntax-optional-chaining": ^7.0.0
"@babel/plugin-transform-arrow-functions": ^7.0.0
"@babel/plugin-transform-async-to-generator": ^7.20.0
"@babel/plugin-transform-block-scoping": ^7.0.0
"@babel/plugin-transform-classes": ^7.0.0
"@babel/plugin-transform-computed-properties": ^7.0.0
"@babel/plugin-transform-destructuring": ^7.20.0
"@babel/plugin-transform-flow-strip-types": ^7.20.0
"@babel/plugin-transform-function-name": ^7.0.0
"@babel/plugin-transform-literals": ^7.0.0
"@babel/plugin-transform-modules-commonjs": ^7.0.0
"@babel/plugin-transform-named-capturing-groups-regex": ^7.0.0
"@babel/plugin-transform-parameters": ^7.0.0
"@babel/plugin-transform-react-display-name": ^7.0.0
"@babel/plugin-transform-react-jsx": ^7.0.0
"@babel/plugin-transform-react-jsx-self": ^7.0.0
"@babel/plugin-transform-react-jsx-source": ^7.0.0
"@babel/plugin-transform-runtime": ^7.0.0
"@babel/plugin-transform-shorthand-properties": ^7.0.0
"@babel/plugin-transform-spread": ^7.0.0
"@babel/plugin-transform-sticky-regex": ^7.0.0
"@babel/plugin-transform-typescript": ^7.5.0
"@babel/plugin-transform-unicode-regex": ^7.0.0
"@babel/template": ^7.0.0
babel-plugin-transform-flow-enums: ^0.0.2
react-refresh: ^0.4.0
peerDependencies:
"@babel/core": "*"
checksum: 09fb64735d4517f62cb0cbd386bdfa64d0de5a4f8c85b54c36b5799b242e897295d58c9d18e124033233841d8fcd33a109dda3dd9f1e5554e516f689eef14a0d
languageName: node
linkType: hard

"metro-resolver@npm:0.80.8":
version: 0.80.8
resolution: "metro-resolver@npm:0.80.8"
Expand Down Expand Up @@ -15029,13 +14980,6 @@ __metadata:
languageName: node
linkType: hard

"react-refresh@npm:^0.4.0":
version: 0.4.3
resolution: "react-refresh@npm:0.4.3"
checksum: 58d3b899ede4c890b1d06a2d02254a77d1c0dea400be139940e47b1c451ff1c4cbb3ca5d0a9d6ee9574e570075ab6c1bef15e77b7270d4a6f571847d2b26f4fc
languageName: node
linkType: hard

"react-remove-scroll-bar@npm:^2.3.3":
version: 2.3.6
resolution: "react-remove-scroll-bar@npm:2.3.6"
Expand Down

0 comments on commit de360bb

Please sign in to comment.