babel-preset-expo 13.1.11 → 13.2.0
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/README.md +2 -2
- package/build/index.d.ts +1 -0
- package/build/index.js +5 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Settings to pass to `babel-plugin-react-compiler`. Set as `false` to disable the
|
|
|
33
33
|
|
|
34
34
|
### `minifyTypeofWindow`
|
|
35
35
|
|
|
36
|
-
Set `minifyTypeofWindow:
|
|
36
|
+
Set `minifyTypeofWindow: true` to transform `typeof window` checks in your code, e.g. `if (typeof window === 'object')` -> `if (true)` in clients. This is useful when you're using libraries that mock the window object on native or in the server.
|
|
37
37
|
|
|
38
38
|
```js
|
|
39
39
|
[
|
|
@@ -47,7 +47,7 @@ Set `minifyTypeofWindow: false` to preserve the `typeof window` check in your co
|
|
|
47
47
|
];
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Defaults to `
|
|
50
|
+
Defaults to `true` for server environments, and `false` for client environments to support legacy browser polyfills and web workers.
|
|
51
51
|
|
|
52
52
|
### `reanimated`
|
|
53
53
|
|
package/build/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ type BabelPresetExpoPlatformOptions = {
|
|
|
15
15
|
jsxImportSource?: string;
|
|
16
16
|
lazyImports?: boolean;
|
|
17
17
|
disableImportExportTransform?: boolean;
|
|
18
|
+
disableDeepImportWarnings?: boolean;
|
|
18
19
|
disableFlowStripTypesTransform?: boolean;
|
|
19
20
|
enableBabelRuntime?: boolean;
|
|
20
21
|
unstable_transformProfile?: 'default' | 'hermes-stable' | 'hermes-canary';
|
package/build/index.js
CHANGED
|
@@ -117,7 +117,9 @@ function babelPresetExpo(api, options = {}) {
|
|
|
117
117
|
'process.env.EXPO_SERVER': !!isServerEnv,
|
|
118
118
|
};
|
|
119
119
|
// `typeof window` is left in place for native + client environments.
|
|
120
|
-
|
|
120
|
+
// NOTE(@kitten): We're temporarily disabling this default optimization for Web targets due to Web Workers
|
|
121
|
+
// We're currently not passing metadata to indicate we're transforming for a Web Worker to disable this automatically
|
|
122
|
+
const minifyTypeofWindow = platformOptions.minifyTypeofWindow ?? isServerEnv;
|
|
121
123
|
if (minifyTypeofWindow !== false) {
|
|
122
124
|
// This nets out slightly faster in development when considering the cost of bundling server dependencies.
|
|
123
125
|
inlines['typeof window'] = isServerEnv ? 'undefined' : 'object';
|
|
@@ -205,12 +207,13 @@ function babelPresetExpo(api, options = {}) {
|
|
|
205
207
|
// Otherwise, you'll sometime get errors like the following (starting in Expo SDK 43, React Native 64, React 17):
|
|
206
208
|
//
|
|
207
209
|
// TransformError App.js: /path/to/App.js: Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin.
|
|
208
|
-
// Both __source and __self are automatically set when using the automatic jsxRuntime.
|
|
210
|
+
// Both __source and __self are automatically set when using the automatic jsxRuntime. Remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.
|
|
209
211
|
useTransformReactJSXExperimental: true,
|
|
210
212
|
// This will never be used regardless because `useTransformReactJSXExperimental` is set to `true`.
|
|
211
213
|
// https://github.com/facebook/react-native/blob/a4a8695cec640e5cf12be36a0c871115fbce9c87/packages/react-native-babel-preset/src/configs/main.js#L151
|
|
212
214
|
withDevTools: false,
|
|
213
215
|
disableImportExportTransform: platformOptions.disableImportExportTransform,
|
|
216
|
+
disableDeepImportWarnings: platformOptions.disableDeepImportWarnings,
|
|
214
217
|
lazyImportExportTransform: lazyImportsOption === true
|
|
215
218
|
? (importModuleSpecifier) => {
|
|
216
219
|
// Do not lazy-initialize packages that are local imports (similar to `lazy: true`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-preset-expo",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "The Babel preset for Expo projects",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/plugin-transform-parameters": "^7.24.7",
|
|
56
56
|
"@babel/preset-react": "^7.22.15",
|
|
57
57
|
"@babel/preset-typescript": "^7.23.0",
|
|
58
|
-
"@react-native/babel-preset": "0.79.
|
|
58
|
+
"@react-native/babel-preset": "0.79.3",
|
|
59
59
|
"babel-plugin-react-native-web": "~0.19.13",
|
|
60
60
|
"babel-plugin-transform-flow-enums": "^0.0.2",
|
|
61
61
|
"babel-plugin-syntax-hermes-parser": "^0.25.1",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@babel/traverse": "^7.9.0",
|
|
77
77
|
"@babel/types": "^7.9.0",
|
|
78
78
|
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
|
|
79
|
-
"expo-module-scripts": "^4.1.
|
|
79
|
+
"expo-module-scripts": "^4.1.7",
|
|
80
80
|
"jest": "^29.2.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7638c800b57fe78f57cc7f129022f58e84a523c5"
|
|
83
83
|
}
|