diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-01-12 17:04:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 17:04:08 -0800 |
commit | b3b818671e2e71648bccc87fc7d27ab81cc68aeb (patch) | |
tree | b2c8ef601781025d4757abbd1992ea02224d6224 /patches/metro+0.80.4.patch | |
parent | 8cc1bd0c40c5eb6ba6ef7949d33f80d79d75f410 (diff) | |
download | voidsky-b3b818671e2e71648bccc87fc7d27ab81cc68aeb.tar.zst |
Bump react-native@0.73.2 (#2519)
* Bump react-native@0.73.2 * Remove old patch
Diffstat (limited to 'patches/metro+0.80.4.patch')
-rw-r--r-- | patches/metro+0.80.4.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/patches/metro+0.80.4.patch b/patches/metro+0.80.4.patch new file mode 100644 index 000000000..f8ef67c84 --- /dev/null +++ b/patches/metro+0.80.4.patch @@ -0,0 +1,44 @@ +diff --git a/node_modules/metro/src/ModuleGraph/worker/JsFileWrapping.js b/node_modules/metro/src/ModuleGraph/worker/JsFileWrapping.js +index 48a1409..ef185c9 100644 +--- a/node_modules/metro/src/ModuleGraph/worker/JsFileWrapping.js ++++ b/node_modules/metro/src/ModuleGraph/worker/JsFileWrapping.js +@@ -70,14 +70,19 @@ function wrapModule( + importDefaultName, + importAllName, + dependencyMapName, +- globalPrefix ++ globalPrefix, ++ moduleFactoryName + ) { + const params = buildParameters( + importDefaultName, + importAllName, + dependencyMapName + ); +- const factory = functionFromProgram(fileAst.program, params); ++ const factory = functionFromProgram( ++ fileAst.program, ++ params, ++ moduleFactoryName ++ ); + const def = t.callExpression(t.identifier(`${globalPrefix}__d`), [factory]); + const ast = t.file(t.program([t.expressionStatement(def)])); + const requireName = renameRequires(ast); +@@ -107,7 +112,16 @@ function wrapJson(source, globalPrefix) { + "});", + ].join("\n"); + } +-function functionFromProgram(program, parameters) { ++const JS_INVALID_IDENT_RE = /[^a-zA-Z0-9$_]/g; ++function functionFromProgram(program, parameters, moduleFactoryName) { ++ let identifier; ++ if (typeof moduleFactoryName === "string" && moduleFactoryName !== "") { ++ // Keep the name readable so it shows up in profiler traces. ++ // Add an unlikely suffix to avoid collisions with the module code. ++ identifier = t.identifier( ++ `${moduleFactoryName.replace(JS_INVALID_IDENT_RE, "_")}__module_factory__` ++ ); ++ } + return t.functionExpression( + undefined, + parameters.map(makeIdentifier), |