metro-transform-worker 0.80.8 → 0.80.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro-transform-worker",
3
- "version": "0.80.8",
3
+ "version": "0.80.9",
4
4
  "description": "🚇 Transform worker for Metro.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -17,17 +17,17 @@
17
17
  "@babel/generator": "^7.20.0",
18
18
  "@babel/parser": "^7.20.0",
19
19
  "@babel/types": "^7.20.0",
20
- "metro": "0.80.8",
21
- "metro-babel-transformer": "0.80.8",
22
- "metro-cache": "0.80.8",
23
- "metro-cache-key": "0.80.8",
24
- "metro-minify-terser": "0.80.8",
25
- "metro-source-map": "0.80.8",
26
- "metro-transform-plugins": "0.80.8",
20
+ "metro": "0.80.9",
21
+ "metro-babel-transformer": "0.80.9",
22
+ "metro-cache": "0.80.9",
23
+ "metro-cache-key": "0.80.9",
24
+ "metro-minify-terser": "0.80.9",
25
+ "metro-source-map": "0.80.9",
26
+ "metro-transform-plugins": "0.80.9",
27
27
  "nullthrows": "^1.1.1"
28
28
  },
29
29
  "devDependencies": {
30
- "metro-memory-fs": "0.80.8",
30
+ "metro-memory-fs": "0.80.9",
31
31
  "@react-native/metro-babel-transformer": "0.73.11"
32
32
  },
33
33
  "engines": {
package/src/index.d.ts CHANGED
@@ -64,6 +64,8 @@ export type JsTransformerConfig = Readonly<{
64
64
  unstable_compactOutput: boolean;
65
65
  /** Enable `require.context` statements which can be used to import multiple files in a directory. */
66
66
  unstable_allowRequireContext: boolean;
67
+ /** Whether to rename scoped `require` functions to `_$$_REQUIRE`, usually an extraneous operation when serializing to iife (default). */
68
+ unstable_renameRequire?: boolean;
67
69
  }>;
68
70
 
69
71
  export {CustomTransformOptions} from 'metro-babel-transformer';
package/src/index.js CHANGED
@@ -198,7 +198,8 @@ async function transformJS(file, { config, options, projectRoot }) {
198
198
  importDefault,
199
199
  importAll,
200
200
  dependencyMapName,
201
- config.globalPrefix
201
+ config.globalPrefix,
202
+ config.unstable_renameRequire === false
202
203
  ));
203
204
  }
204
205
  }
package/src/index.js.flow CHANGED
@@ -96,6 +96,8 @@ export type JsTransformerConfig = $ReadOnly<{
96
96
  unstable_compactOutput: boolean,
97
97
  /** Enable `require.context` statements which can be used to import multiple files in a directory. */
98
98
  unstable_allowRequireContext: boolean,
99
+ /** Whether to rename scoped `require` functions to `_$$_REQUIRE`, usually an extraneous operation when serializing to iife (default). */
100
+ unstable_renameRequire?: boolean,
99
101
  }>;
100
102
 
101
103
  export type {CustomTransformOptions} from 'metro-babel-transformer';
@@ -387,6 +389,10 @@ async function transformJS(
387
389
  importAll,
388
390
  dependencyMapName,
389
391
  config.globalPrefix,
392
+ // TODO: This config is optional to allow its introduction in a minor
393
+ // release. It should be made non-optional in ConfigT or removed in
394
+ // future.
395
+ config.unstable_renameRequire === false,
390
396
  ));
391
397
  }
392
398
  }