babel-preset-expo 54.0.7-canary-20251031-b135dff → 54.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common.js +3 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +4 -3
- package/package.json +6 -5
package/build/common.js
CHANGED
|
@@ -92,7 +92,9 @@ function getIsFastRefreshEnabled(caller) {
|
|
|
92
92
|
assertExpoBabelCaller(caller);
|
|
93
93
|
if (!caller)
|
|
94
94
|
return false;
|
|
95
|
-
|
|
95
|
+
// NOTE(@kitten): `isHMREnabled` is always true in `@expo/metro-config`.
|
|
96
|
+
// However, we still use this option to ensure fast refresh is only enabled in supported runtimes (Metro + Expo)
|
|
97
|
+
return !!caller.isHMREnabled && !caller.isServer && !caller.isNodeModule && getIsDev(caller);
|
|
96
98
|
}
|
|
97
99
|
function getIsProd(caller) {
|
|
98
100
|
assertExpoBabelCaller(caller);
|
package/build/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type BabelPresetExpoPlatformOptions = {
|
|
|
26
26
|
unstable_transformProfile?: 'default' | 'hermes-stable' | 'hermes-canary';
|
|
27
27
|
/** Settings to pass to `babel-plugin-react-compiler`. Set as `false` to disable the plugin. */
|
|
28
28
|
'react-compiler'?: false | ReactCompilerOptions;
|
|
29
|
+
/** Only set to `false` to disable `react-refresh/babel` forcefully, defaults to `undefined` */
|
|
30
|
+
enableReactFastRefresh?: boolean;
|
|
29
31
|
/** Enable `typeof window` runtime checks. The default behavior is to minify `typeof window` on web clients to `"object"` and `"undefined"` on servers. */
|
|
30
32
|
minifyTypeofWindow?: boolean;
|
|
31
33
|
/**
|
package/build/index.js
CHANGED
|
@@ -176,12 +176,13 @@ function babelPresetExpo(api, options = {}) {
|
|
|
176
176
|
}
|
|
177
177
|
// This plugin is fine to run whenever as the server-only imports were introduced as part of RSC and shouldn't be used in any client code.
|
|
178
178
|
extraPlugins.push(environment_restricted_imports_1.environmentRestrictedImportsPlugin);
|
|
179
|
-
if (
|
|
179
|
+
if (platformOptions.enableReactFastRefresh ||
|
|
180
|
+
(isFastRefreshEnabled && platformOptions.enableReactFastRefresh !== false)) {
|
|
180
181
|
extraPlugins.push([
|
|
181
182
|
require('react-refresh/babel'),
|
|
182
183
|
{
|
|
183
|
-
// We perform the env check to enable `isFastRefreshEnabled
|
|
184
|
-
skipEnvCheck: true,
|
|
184
|
+
// We perform the env check to enable `isFastRefreshEnabled`, unless the plugin is force-enabled
|
|
185
|
+
skipEnvCheck: platformOptions.enableReactFastRefresh !== true,
|
|
185
186
|
},
|
|
186
187
|
]);
|
|
187
188
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-preset-expo",
|
|
3
|
-
"version": "54.0.7
|
|
3
|
+
"version": "54.0.7",
|
|
4
4
|
"description": "The Babel preset for Expo projects",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@babel/runtime": "^7.20.0",
|
|
45
45
|
"react-refresh": ">=0.14.0 <1.0.0",
|
|
46
|
-
"expo": "
|
|
46
|
+
"expo": "*"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@babel/runtime": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@babel/plugin-transform-parameters": "^7.24.7",
|
|
70
70
|
"@babel/preset-react": "^7.22.15",
|
|
71
71
|
"@babel/preset-typescript": "^7.23.0",
|
|
72
|
-
"@react-native/babel-preset": "0.
|
|
72
|
+
"@react-native/babel-preset": "0.81.5",
|
|
73
73
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
74
74
|
"babel-plugin-react-native-web": "~0.21.0",
|
|
75
75
|
"babel-plugin-transform-flow-enums": "^0.0.2",
|
|
@@ -81,8 +81,9 @@
|
|
|
81
81
|
"@babel/core": "^7.26.0",
|
|
82
82
|
"@types/babel__core": "^7.20.5",
|
|
83
83
|
"@expo/metro": "~54.1.0",
|
|
84
|
-
"expo-module-scripts": "5.0.
|
|
84
|
+
"expo-module-scripts": "^5.0.7",
|
|
85
85
|
"jest": "^29.2.1",
|
|
86
86
|
"react-refresh": "^0.14.2"
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
|
+
"gitHead": "d3e95a82fd9d48b0b751c4290216083244b360d2"
|
|
88
89
|
}
|