vxrn 2.13.6 → 2.13.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/dist/patches/builtInDepPatches.mjs +21 -1
- package/dist/patches/builtInDepPatches.mjs.map +1 -1
- package/dist/patches/builtInDepPatches.native.js +21 -1
- package/dist/patches/builtInDepPatches.native.js.map +1 -1
- package/package.json +12 -12
- package/src/patches/builtInDepPatches.ts +30 -1
- package/src/utils/patches.test.ts +32 -0
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
|
@@ -272,7 +272,7 @@ const RNV = Platform.constants.reactNativeVersion;
|
|
|
272
272
|
{
|
|
273
273
|
module: "react-native",
|
|
274
274
|
patchFiles: {
|
|
275
|
-
version: ">=0.86.0",
|
|
275
|
+
version: ">=0.86.0 <0.88.0",
|
|
276
276
|
"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm": (contents) => {
|
|
277
277
|
if (!contents) return;
|
|
278
278
|
return contents.replace(` @try {
|
|
@@ -285,6 +285,26 @@ const RNV = Platform.constants.reactNativeVersion;
|
|
|
285
285
|
[inv invokeWithTarget:strongModule];
|
|
286
286
|
} @catch (NSException *exception) {
|
|
287
287
|
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
288
|
+
} @finally {`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
module: "react-native",
|
|
294
|
+
patchFiles: {
|
|
295
|
+
version: ">=0.88.0",
|
|
296
|
+
"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm": (contents) => {
|
|
297
|
+
if (!contents) return;
|
|
298
|
+
return contents.replace(` @try {
|
|
299
|
+
[inv invokeWithTarget:strongModule];
|
|
300
|
+
} @catch (NSException *exception) {
|
|
301
|
+
// Void methods are always async, re-throw instead of converting to
|
|
302
|
+
// JSError, same as the async branch in performMethodInvocation.
|
|
303
|
+
@throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);
|
|
304
|
+
} @finally {`, ` @try {
|
|
305
|
+
[inv invokeWithTarget:strongModule];
|
|
306
|
+
} @catch (NSException *exception) {
|
|
307
|
+
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
288
308
|
} @finally {`);
|
|
289
309
|
}
|
|
290
310
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInDepPatches.js","names":[],"sources":["patches/builtInDepPatches.js"],"sourcesContent":["import { assertString } from \"../utils/assert\";\nimport { bailIfExists, bailIfUnchanged } from \"../utils/patches\";\nconst builtInDepPatches = [\n // @react-navigation/core 7.17 renamed createComponentForStaticNavigation to\n // createComponentForStaticConfigDeprecated, breaking @react-navigation/native\n // which still imports the old name. re-export the old name as an alias.\n {\n module: \"@react-navigation/core\",\n patchFiles: {\n version: \">=7.17.0 <8.0.0\",\n \"lib/module/index.js\": (contents) => {\n assertString(contents);\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(\n /export \\{ createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/,\n \"export { createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\"\n );\n },\n \"lib/commonjs/index.js\": (contents) => {\n if (!contents) return;\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(\n /createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/,\n \"createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\"\n );\n }\n }\n },\n // react-native-maps ships TypeScript source, and every map child component\n // declares the members decorateMapComponent installs on the prototype as\n // definite-assignment class fields (`getNativeComponent!: () => ...`). oxc\n // keeps a field declaration that has no initializer, so constructing the\n // component gives each instance its own `undefined` property that shadows the\n // prototype method, and the first render throws \"this.getNativeComponent is\n // not a function\". babel's loose class properties erase these on native, so\n // only the vite side breaks. oxc ignores useDefineForClassFields, so no\n // tsconfig or oxc option reaches this; `declare` is what the declaration\n // always meant and every transform erases it.\n {\n module: \"react-native-maps\",\n patchFiles: {\n \"src/*.tsx\": (contents) => {\n assertString(contents);\n const patched = contents.replace(\n /^(\\s*)(context|getNativeComponent|getMapManagerCommand|getUIManagerCommand)!:/gm,\n \"$1declare $2:\"\n );\n bailIfUnchanged(patched, contents);\n return patched;\n }\n }\n },\n // react-native-web doesn't export unstable_batchedUpdates but react-native does,\n // so libraries like @legendapp/list break when aliased to rnw on web\n {\n module: \"react-native-web\",\n patchFiles: {\n \"dist/index.js\": (contents) => {\n assertString(contents);\n bailIfExists(contents, \"unstable_batchedUpdates\");\n return `${contents}\nexport { unstable_batchedUpdates } from 'react-dom';\n`;\n }\n }\n },\n {\n module: \"react\",\n patchFiles: {\n version: \"18.*\",\n \"compiler-runtime.js\": `module.exports = require('@vxrn/vendor/react-19-compiler-runtime');`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-19');`,\n \"jsx-dev-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-dev-19');`,\n \"jsx-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-19');`,\n \"package.json\": (contents) => {\n assertString(contents);\n const pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n const existingExports = { ...pkg.exports };\n if (!pkg.exports[\".\"]) {\n throw new Error(\n `Expected a version of React that has package.json exports defined`\n );\n }\n pkg.exports[\".\"] = {\n \"react-server\": \"./react.shared-subset.js\",\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./jsx-runtime\"] = {\n \"vxrn-web\": \"./jsx-runtime.vxrn-web.js\",\n default: \"./jsx-runtime.js\"\n };\n pkg.exports[\"./compiler-runtime\"] = {\n default: \"./compiler-runtime.js\"\n };\n pkg.exports[\"./jsx-dev-runtime\"] = {\n \"vxrn-web\": \"./jsx-dev-runtime.vxrn-web.js\",\n default: \"./jsx-dev-runtime.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n },\n // for prod builds we have to actually change the entries:\n // to avoid terrible metro we have to eval :(\n \"index.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-19')\")) } else {\n ${contents}\n}`;\n },\n // to avoid terrible metro we have to eval :(\n \"jsx-runtime.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-jsx-19')\")) } else {\n ${contents}\n}`;\n }\n }\n },\n {\n module: \"react-dom\",\n patchFiles: {\n version: \"18.*\",\n // for prod builds we have to actually change the entries:\n \"index.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-19')\")) } else {\n${contents}\n}`;\n },\n \"client.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-client-19')\")) } else {\n${contents}\n}`;\n },\n \"server.browser.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, require('@vxrn/vendor/react-dom-server.browser-19')) } else {\n${contents}\n}`;\n },\n \"client.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-client-19')`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-19')`,\n \"server.browser.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-server.browser-19')`,\n \"test-utils.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-test-utils-19')`,\n \"package.json\": (contents) => {\n assertString(contents);\n const pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n const existingExports = { ...pkg.exports };\n if (!pkg.exports[\".\"]) {\n throw new Error(\n `Expected a version of React that has package.json exports defined`\n );\n }\n pkg.exports[\".\"] = {\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./client\"] = {\n \"vxrn-web\": \"./client.vxrn-web.js\",\n default: \"./client.js\"\n };\n pkg.exports[\"./server.browser\"] = {\n \"vxrn-web\": \"./server.browser.vxrn-web.js\",\n default: \"./server.browser.js\"\n };\n pkg.exports[\"./test-utils\"] = {\n \"vxrn-web\": \"./test-utils.vxrn-web.js\",\n default: \"./test-utils.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n }\n }\n },\n // Older versions of the cli-config package will not look for `.cjs` files when loading the config. This isn't necessary for v14.x (which comes with RN 0.75). See: https://hackmd.io/@z/SJghMPN6C.\n {\n module: \"@react-native-community/cli-config\",\n patchFiles: {\n version: \">=13.0.0 <16.0.0\",\n \"build/readConfigFromDisk.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `['react-native.config.js']`,\n `['react-native.config.js', 'react-native.config.cjs']`\n ).replace(\n \"searchPlaces,\",\n `searchPlaces, loaders: { '.cjs': _cosmiconfig().default.loadJs },`\n ).replace(\n \"stopDir: rootFolder,\",\n `stopDir: rootFolder, loaders: { '.cjs': _cosmiconfig().default.loadJs },`\n );\n }\n }\n },\n {\n module: \"react-native-reanimated\",\n patchFiles: {\n // reanimated 4 ships no JSX in its `.js`. Measured against 4.5.1: all 374\n // files parse with SWC at `jsx: false`, and the only JSX-shaped text is\n // inside comments. The transform still rewrote and reformatted every one\n // of them, which is how a patch aimed at reanimated ended up re-printing\n // its nested `semver` and giving one package@version two contents on\n // disk. Left in place below 4 rather than deleted, because we verified 4\n // and not the 3.x line.\n version: \"<4.0.0\",\n \"**/*.js\": [\"jsx\"]\n }\n },\n // fix RNGH crash on RN 0.86+ new architecture\n // getShadowNodeFromRef crashes when findHostInstance_DEPRECATED returns null\n {\n module: \"react-native-gesture-handler\",\n patchFiles: {\n version: \">=3.0.0\",\n \"lib/module/getShadowNodeFromRef.js\": (contents) => {\n return contents?.replace(\n `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode.node;`,\n `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`\n );\n },\n // metro uses src/ directly via \"react-native\" field in package.json\n \"src/getShadowNodeFromRef.ts\": (contents) => {\n return contents?.replace(\n `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode\n .node;`,\n `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`\n );\n }\n }\n },\n {\n module: \"@react-native-masked-view/masked-view\",\n patchFiles: {\n \"**/*.js\": [\"flow\", \"swc\"]\n }\n },\n {\n module: \"react-native-vector-icons\",\n patchFiles: {\n \"**/*.js\": [\"jsx\", \"flow\"]\n }\n },\n {\n module: \"react-native-webview\",\n patchFiles: {\n \"**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@react-native/assets-registry\",\n patchFiles: {\n \"**/*.js\": [\"flow\"]\n }\n },\n {\n module: \"react-native-css-interop\",\n patchFiles: {\n // 2 of 53 dist files genuinely need JSX parsing, so this one is real.\n //\n // Two sibling patches were removed here, both dead. A `wrap-jsx.js` entry\n // tried to hoist `require(\"./components\")` out of the function so\n // cssInterop registration runs, but `patches.ts` selects with\n // `filePatches.find(relativePath)` and `dist/**/*.js` is declared first,\n // so the glob shadowed it and the hoist never executed once: the patched\n // file on disk still has the require inside the function. A `package.json`\n // entry set `sideEffects` to keep components.js from being tree-shaken,\n // and 0.2.6 already ships exactly that value.\n //\n // So nativewind registration has never actually been hoisted by this\n // patch. Anyone deciding whether to keep the CSS-on-native path should\n // start from that, not from the assumption that it works today.\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.6.0\",\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.0.0 <5.6.0\",\n \"dist/js/utils/environment.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';`,\n `import { Platform } from 'react-native';\nconst RNV = Platform.constants.reactNativeVersion;\n`\n );\n },\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"qrcode\",\n patchFiles: {\n version: \"<=1.5.1\",\n \"lib/server.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `const TerminalRenderer = require('./renderer/terminal')`,\n `const TerminalRenderer = require('./renderer/terminal.js')`\n );\n }\n }\n },\n {\n module: \"whatwg-url-without-unicode\",\n // https://github.com/onejs/one/issues/258\n patchFiles: {\n \"**/*.js\": (contents) => contents?.replace(\n /punycode\\.ucs2\\.decode/gm,\n \"(punycode.ucs2decode || punycode.ucs2.decode)\"\n )?.replace(\n /punycode\\.ucs2\\.encode/gm,\n \"(punycode.ucs2encode || punycode.ucs2.encode)\"\n )\n }\n },\n {\n module: \"@hot-updater/plugin-core\",\n patchFiles: {\n version: \"0.*\",\n \"dist/index.cjs\": (contents) => {\n return contents?.replace(\n 'let mime = require(\"mime\");',\n 'let mime = { getType: () => \"application/octet-stream\", getExtension: () => null };'\n );\n }\n }\n },\n // a void TurboModule method that throws an Obj-C NSException crashes the app\n // when React Native rethrows it on the TurboModule queue. there is no JS\n // caller for an async void method to receive an error, so log it instead.\n // see tests/test/IOS_PROD_CRASH.md\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.86.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": (contents) => {\n if (!contents) return;\n return contents.replace(\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw exception;\n } @finally {`,\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`\n );\n }\n }\n }\n];\nexport {\n builtInDepPatches\n};\n//# sourceMappingURL=builtInDepPatches.js.map\n"],"mappings":";;;;AAEA,MAAM,oBAAoB;CAIxB;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,wBAAwB,aAAa;IACnC,aAAa,QAAQ;IACrB,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QACd,yFACA,sKACF;GACF;GACA,0BAA0B,aAAa;IACrC,IAAI,CAAC,UAAU;IACf,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QACd,+EACA,6JACF;GACF;EACF;CACF;CAWA;EACE,QAAQ;EACR,YAAY,EACV,cAAc,aAAa;GACzB,aAAa,QAAQ;GACrB,MAAM,UAAU,SAAS,QACvB,mFACA,eACF;GACA,gBAAgB,SAAS,QAAQ;GACjC,OAAO;EACT,EACF;CACF;CAGA;EACE,QAAQ;EACR,YAAY,EACV,kBAAkB,a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CAAC,MAAM,EACpB;CACF;CACA;EACE,QAAQ;EACR,YAAY,EAeV,gBAAgB,CAAC,KAAK,EACxB;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,gBAAgB,CAAC,KAAK;EACxB;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,iCAAiC,aAAa;IAC5C,aAAa,QAAQ;IACrB,OAAO,SAAS,QACd,oFACA;;CAGF;GACF;GACA,gBAAgB,CAAC,KAAK;EACxB;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kBAAkB,aAAa;IAC7B,aAAa,QAAQ;IACrB,OAAO,SAAS,QACd,2DACA,4DACF;GACF;EACF;CACF;CACA;EACE,QAAQ;EAER,YAAY,EACV,YAAY,aAAa,UAAU,QACjC,4BACA,+CACF,CAAC,EAAE,QACD,4BACA,+CACF,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,mBAAmB,aAAa;IAC9B,OAAO,UAAU,QACf,iCACA,uFACF;GACF;EACF;CACF;CAKA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,mFAAmF,aAAa;IAC9F,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QACd;;;;;;mBAOA;;;;iBAKF;GACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"builtInDepPatches.js","names":[],"sources":["patches/builtInDepPatches.js"],"sourcesContent":["import { assertString } from \"../utils/assert\";\nimport { bailIfExists, bailIfUnchanged } from \"../utils/patches\";\nconst builtInDepPatches = [\n // @react-navigation/core 7.17 renamed createComponentForStaticNavigation to\n // createComponentForStaticConfigDeprecated, breaking @react-navigation/native\n // which still imports the old name. re-export the old name as an alias.\n {\n module: \"@react-navigation/core\",\n patchFiles: {\n version: \">=7.17.0 <8.0.0\",\n \"lib/module/index.js\": (contents) => {\n assertString(contents);\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(\n /export \\{ createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/,\n \"export { createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\"\n );\n },\n \"lib/commonjs/index.js\": (contents) => {\n if (!contents) return;\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(\n /createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/,\n \"createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\"\n );\n }\n }\n },\n // react-native-maps ships TypeScript source, and every map child component\n // declares the members decorateMapComponent installs on the prototype as\n // definite-assignment class fields (`getNativeComponent!: () => ...`). oxc\n // keeps a field declaration that has no initializer, so constructing the\n // component gives each instance its own `undefined` property that shadows the\n // prototype method, and the first render throws \"this.getNativeComponent is\n // not a function\". babel's loose class properties erase these on native, so\n // only the vite side breaks. oxc ignores useDefineForClassFields, so no\n // tsconfig or oxc option reaches this; `declare` is what the declaration\n // always meant and every transform erases it.\n {\n module: \"react-native-maps\",\n patchFiles: {\n \"src/*.tsx\": (contents) => {\n assertString(contents);\n const patched = contents.replace(\n /^(\\s*)(context|getNativeComponent|getMapManagerCommand|getUIManagerCommand)!:/gm,\n \"$1declare $2:\"\n );\n bailIfUnchanged(patched, contents);\n return patched;\n }\n }\n },\n // react-native-web doesn't export unstable_batchedUpdates but react-native does,\n // so libraries like @legendapp/list break when aliased to rnw on web\n {\n module: \"react-native-web\",\n patchFiles: {\n \"dist/index.js\": (contents) => {\n assertString(contents);\n bailIfExists(contents, \"unstable_batchedUpdates\");\n return `${contents}\nexport { unstable_batchedUpdates } from 'react-dom';\n`;\n }\n }\n },\n {\n module: \"react\",\n patchFiles: {\n version: \"18.*\",\n \"compiler-runtime.js\": `module.exports = require('@vxrn/vendor/react-19-compiler-runtime');`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-19');`,\n \"jsx-dev-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-dev-19');`,\n \"jsx-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-19');`,\n \"package.json\": (contents) => {\n assertString(contents);\n const pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n const existingExports = { ...pkg.exports };\n if (!pkg.exports[\".\"]) {\n throw new Error(\n `Expected a version of React that has package.json exports defined`\n );\n }\n pkg.exports[\".\"] = {\n \"react-server\": \"./react.shared-subset.js\",\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./jsx-runtime\"] = {\n \"vxrn-web\": \"./jsx-runtime.vxrn-web.js\",\n default: \"./jsx-runtime.js\"\n };\n pkg.exports[\"./compiler-runtime\"] = {\n default: \"./compiler-runtime.js\"\n };\n pkg.exports[\"./jsx-dev-runtime\"] = {\n \"vxrn-web\": \"./jsx-dev-runtime.vxrn-web.js\",\n default: \"./jsx-dev-runtime.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n },\n // for prod builds we have to actually change the entries:\n // to avoid terrible metro we have to eval :(\n \"index.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-19')\")) } else {\n ${contents}\n}`;\n },\n // to avoid terrible metro we have to eval :(\n \"jsx-runtime.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-jsx-19')\")) } else {\n ${contents}\n}`;\n }\n }\n },\n {\n module: \"react-dom\",\n patchFiles: {\n version: \"18.*\",\n // for prod builds we have to actually change the entries:\n \"index.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-19')\")) } else {\n${contents}\n}`;\n },\n \"client.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-client-19')\")) } else {\n${contents}\n}`;\n },\n \"server.browser.js\": (contents) => {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, require('@vxrn/vendor/react-dom-server.browser-19')) } else {\n${contents}\n}`;\n },\n \"client.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-client-19')`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-19')`,\n \"server.browser.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-server.browser-19')`,\n \"test-utils.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-test-utils-19')`,\n \"package.json\": (contents) => {\n assertString(contents);\n const pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n const existingExports = { ...pkg.exports };\n if (!pkg.exports[\".\"]) {\n throw new Error(\n `Expected a version of React that has package.json exports defined`\n );\n }\n pkg.exports[\".\"] = {\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./client\"] = {\n \"vxrn-web\": \"./client.vxrn-web.js\",\n default: \"./client.js\"\n };\n pkg.exports[\"./server.browser\"] = {\n \"vxrn-web\": \"./server.browser.vxrn-web.js\",\n default: \"./server.browser.js\"\n };\n pkg.exports[\"./test-utils\"] = {\n \"vxrn-web\": \"./test-utils.vxrn-web.js\",\n default: \"./test-utils.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n }\n }\n },\n // Older versions of the cli-config package will not look for `.cjs` files when loading the config. This isn't necessary for v14.x (which comes with RN 0.75). See: https://hackmd.io/@z/SJghMPN6C.\n {\n module: \"@react-native-community/cli-config\",\n patchFiles: {\n version: \">=13.0.0 <16.0.0\",\n \"build/readConfigFromDisk.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `['react-native.config.js']`,\n `['react-native.config.js', 'react-native.config.cjs']`\n ).replace(\n \"searchPlaces,\",\n `searchPlaces, loaders: { '.cjs': _cosmiconfig().default.loadJs },`\n ).replace(\n \"stopDir: rootFolder,\",\n `stopDir: rootFolder, loaders: { '.cjs': _cosmiconfig().default.loadJs },`\n );\n }\n }\n },\n {\n module: \"react-native-reanimated\",\n patchFiles: {\n // reanimated 4 ships no JSX in its `.js`. Measured against 4.5.1: all 374\n // files parse with SWC at `jsx: false`, and the only JSX-shaped text is\n // inside comments. The transform still rewrote and reformatted every one\n // of them, which is how a patch aimed at reanimated ended up re-printing\n // its nested `semver` and giving one package@version two contents on\n // disk. Left in place below 4 rather than deleted, because we verified 4\n // and not the 3.x line.\n version: \"<4.0.0\",\n \"**/*.js\": [\"jsx\"]\n }\n },\n // fix RNGH crash on RN 0.86+ new architecture\n // getShadowNodeFromRef crashes when findHostInstance_DEPRECATED returns null\n {\n module: \"react-native-gesture-handler\",\n patchFiles: {\n version: \">=3.0.0\",\n \"lib/module/getShadowNodeFromRef.js\": (contents) => {\n return contents?.replace(\n `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode.node;`,\n `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`\n );\n },\n // metro uses src/ directly via \"react-native\" field in package.json\n \"src/getShadowNodeFromRef.ts\": (contents) => {\n return contents?.replace(\n `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode\n .node;`,\n `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`\n );\n }\n }\n },\n {\n module: \"@react-native-masked-view/masked-view\",\n patchFiles: {\n \"**/*.js\": [\"flow\", \"swc\"]\n }\n },\n {\n module: \"react-native-vector-icons\",\n patchFiles: {\n \"**/*.js\": [\"jsx\", \"flow\"]\n }\n },\n {\n module: \"react-native-webview\",\n patchFiles: {\n \"**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@react-native/assets-registry\",\n patchFiles: {\n \"**/*.js\": [\"flow\"]\n }\n },\n {\n module: \"react-native-css-interop\",\n patchFiles: {\n // 2 of 53 dist files genuinely need JSX parsing, so this one is real.\n //\n // Two sibling patches were removed here, both dead. A `wrap-jsx.js` entry\n // tried to hoist `require(\"./components\")` out of the function so\n // cssInterop registration runs, but `patches.ts` selects with\n // `filePatches.find(relativePath)` and `dist/**/*.js` is declared first,\n // so the glob shadowed it and the hoist never executed once: the patched\n // file on disk still has the require inside the function. A `package.json`\n // entry set `sideEffects` to keep components.js from being tree-shaken,\n // and 0.2.6 already ships exactly that value.\n //\n // So nativewind registration has never actually been hoisted by this\n // patch. Anyone deciding whether to keep the CSS-on-native path should\n // start from that, not from the assumption that it works today.\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.6.0\",\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.0.0 <5.6.0\",\n \"dist/js/utils/environment.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';`,\n `import { Platform } from 'react-native';\nconst RNV = Platform.constants.reactNativeVersion;\n`\n );\n },\n \"dist/**/*.js\": [\"jsx\"]\n }\n },\n {\n module: \"qrcode\",\n patchFiles: {\n version: \"<=1.5.1\",\n \"lib/server.js\": (contents) => {\n assertString(contents);\n return contents.replace(\n `const TerminalRenderer = require('./renderer/terminal')`,\n `const TerminalRenderer = require('./renderer/terminal.js')`\n );\n }\n }\n },\n {\n module: \"whatwg-url-without-unicode\",\n // https://github.com/onejs/one/issues/258\n patchFiles: {\n \"**/*.js\": (contents) => contents?.replace(\n /punycode\\.ucs2\\.decode/gm,\n \"(punycode.ucs2decode || punycode.ucs2.decode)\"\n )?.replace(\n /punycode\\.ucs2\\.encode/gm,\n \"(punycode.ucs2encode || punycode.ucs2.encode)\"\n )\n }\n },\n {\n module: \"@hot-updater/plugin-core\",\n patchFiles: {\n version: \"0.*\",\n \"dist/index.cjs\": (contents) => {\n return contents?.replace(\n 'let mime = require(\"mime\");',\n 'let mime = { getType: () => \"application/octet-stream\", getExtension: () => null };'\n );\n }\n }\n },\n // a void TurboModule method that throws an Obj-C NSException crashes the app\n // when React Native rethrows it on the TurboModule queue. there is no JS\n // caller for an async void method to receive an error, so log it instead.\n // see tests/test/IOS_PROD_CRASH.md\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.86.0 <0.88.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": (contents) => {\n if (!contents) return;\n return contents.replace(\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw exception;\n } @finally {`,\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`\n );\n }\n }\n },\n // 0.88 wraps the same rethrow. the old string matches nothing, so the\n // exception reaches the process handler again.\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.88.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": (contents) => {\n if (!contents) return;\n return contents.replace(\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);\n } @finally {`,\n ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`\n );\n }\n }\n }\n];\nexport {\n builtInDepPatches\n};\n//# sourceMappingURL=builtInDepPatches.js.map\n"],"mappings":";;;;AAEA,MAAM,oBAAoB;CAIxB;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,wBAAwB,aAAa;IACnC,aAAa,QAAQ;IACrB,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QACd,yFACA,sKACF;GACF;GACA,0BAA0B,aAAa;IACrC,IAAI,CAAC,UAAU;IACf,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QACd,+EACA,6JACF;GACF;EACF;CACF;CAWA;EACE,QAAQ;EACR,YAAY,EACV,cAAc,aAAa;GACzB,aAAa,QAAQ;GACrB,MAAM,UAAU,SAAS,QACvB,mFACA,eACF;GACA,gBAAgB,SAAS,QAAQ;GACjC,OAAO;EACT,EACF;CACF;CAGA;EACE,QAAQ;EACR,YAAY,EACV,kBAAkB,aAAa;GAC7B,aAAa,QAAQ;GACrB,aAAa,UAAU,yBAAyB;GAChD,OAAO,GAAG,SAAS;;;EAGrB,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,uBAAuB;GACvB,qBAAqB;GACrB,+BAA+B;GAC/B,2BAA2B;GAC3B,iBAAiB,aAAa;IAC5B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;IAC5C,aAAa,QAAQ;IACrB,OAAO,SAAS,QACd,oFACA;;CAGF;GACF;GACA,gBAAgB,CAAC,KAAK;EACxB;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kBAAkB,aAAa;IAC7B,aAAa,QAAQ;IACrB,OAAO,SAAS,QACd,2DACA,4DACF;GACF;EACF;CACF;CACA;EACE,QAAQ;EAER,YAAY,EACV,YAAY,aAAa,UAAU,QACjC,4BACA,+CACF,CAAC,EAAE,QACD,4BACA,+CACF,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,mBAAmB,aAAa;IAC9B,OAAO,UAAU,QACf,iCACA,uFACF;GACF;EACF;CACF;CAKA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,mFAAmF,aAAa;IAC9F,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QACd;;;;;;mBAOA;;;;iBAKF;GACF;EACF;CACF;CAGA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,mFAAmF,aAAa;IAC9F,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QACd;;;;;;mBAOA;;;;iBAKF;GACF;EACF;CACF;AACF"}
|
|
@@ -275,7 +275,7 @@ const RNV = Platform.constants.reactNativeVersion;
|
|
|
275
275
|
{
|
|
276
276
|
module: "react-native",
|
|
277
277
|
patchFiles: {
|
|
278
|
-
version: ">=0.86.0",
|
|
278
|
+
version: ">=0.86.0 <0.88.0",
|
|
279
279
|
"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm": function(contents) {
|
|
280
280
|
if (!contents) return;
|
|
281
281
|
return contents.replace(` @try {
|
|
@@ -288,6 +288,26 @@ const RNV = Platform.constants.reactNativeVersion;
|
|
|
288
288
|
[inv invokeWithTarget:strongModule];
|
|
289
289
|
} @catch (NSException *exception) {
|
|
290
290
|
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
291
|
+
} @finally {`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
module: "react-native",
|
|
297
|
+
patchFiles: {
|
|
298
|
+
version: ">=0.88.0",
|
|
299
|
+
"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm": function(contents) {
|
|
300
|
+
if (!contents) return;
|
|
301
|
+
return contents.replace(` @try {
|
|
302
|
+
[inv invokeWithTarget:strongModule];
|
|
303
|
+
} @catch (NSException *exception) {
|
|
304
|
+
// Void methods are always async, re-throw instead of converting to
|
|
305
|
+
// JSError, same as the async branch in performMethodInvocation.
|
|
306
|
+
@throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);
|
|
307
|
+
} @finally {`, ` @try {
|
|
308
|
+
[inv invokeWithTarget:strongModule];
|
|
309
|
+
} @catch (NSException *exception) {
|
|
310
|
+
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
291
311
|
} @finally {`);
|
|
292
312
|
}
|
|
293
313
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInDepPatches.native.js","names":[],"sources":["patches/builtInDepPatches.native.js"],"sourcesContent":["import { assertString } from \"../utils/assert\";\nimport { bailIfExists, bailIfUnchanged } from \"../utils/patches\";\nvar builtInDepPatches = [\n // @react-navigation/core 7.17 renamed createComponentForStaticNavigation to\n // createComponentForStaticConfigDeprecated, breaking @react-navigation/native\n // which still imports the old name. re-export the old name as an alias.\n {\n module: \"@react-navigation/core\",\n patchFiles: {\n version: \">=7.17.0 <8.0.0\",\n \"lib/module/index.js\": function(contents) {\n assertString(contents);\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(/export \\{ createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/, \"export { createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\");\n },\n \"lib/commonjs/index.js\": function(contents) {\n if (!contents) return;\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(/createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/, \"createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\");\n }\n }\n },\n // react-native-maps ships TypeScript source, and every map child component\n // declares the members decorateMapComponent installs on the prototype as\n // definite-assignment class fields (`getNativeComponent!: () => ...`). oxc\n // keeps a field declaration that has no initializer, so constructing the\n // component gives each instance its own `undefined` property that shadows the\n // prototype method, and the first render throws \"this.getNativeComponent is\n // not a function\". babel's loose class properties erase these on native, so\n // only the vite side breaks. oxc ignores useDefineForClassFields, so no\n // tsconfig or oxc option reaches this; `declare` is what the declaration\n // always meant and every transform erases it.\n {\n module: \"react-native-maps\",\n patchFiles: {\n \"src/*.tsx\": function(contents) {\n assertString(contents);\n var patched = contents.replace(/^(\\s*)(context|getNativeComponent|getMapManagerCommand|getUIManagerCommand)!:/gm, \"$1declare $2:\");\n bailIfUnchanged(patched, contents);\n return patched;\n }\n }\n },\n // react-native-web doesn't export unstable_batchedUpdates but react-native does,\n // so libraries like @legendapp/list break when aliased to rnw on web\n {\n module: \"react-native-web\",\n patchFiles: {\n \"dist/index.js\": function(contents) {\n assertString(contents);\n bailIfExists(contents, \"unstable_batchedUpdates\");\n return `${contents}\nexport { unstable_batchedUpdates } from 'react-dom';\n`;\n }\n }\n },\n {\n module: \"react\",\n patchFiles: {\n version: \"18.*\",\n \"compiler-runtime.js\": `module.exports = require('@vxrn/vendor/react-19-compiler-runtime');`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-19');`,\n \"jsx-dev-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-dev-19');`,\n \"jsx-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-19');`,\n \"package.json\": function(contents) {\n assertString(contents);\n var pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n var existingExports = {\n ...pkg.exports\n };\n if (!pkg.exports[\".\"]) {\n throw new Error(`Expected a version of React that has package.json exports defined`);\n }\n pkg.exports[\".\"] = {\n \"react-server\": \"./react.shared-subset.js\",\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./jsx-runtime\"] = {\n \"vxrn-web\": \"./jsx-runtime.vxrn-web.js\",\n default: \"./jsx-runtime.js\"\n };\n pkg.exports[\"./compiler-runtime\"] = {\n default: \"./compiler-runtime.js\"\n };\n pkg.exports[\"./jsx-dev-runtime\"] = {\n \"vxrn-web\": \"./jsx-dev-runtime.vxrn-web.js\",\n default: \"./jsx-dev-runtime.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n },\n // for prod builds we have to actually change the entries:\n // to avoid terrible metro we have to eval :(\n \"index.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-19')\")) } else {\n ${contents}\n}`;\n },\n // to avoid terrible metro we have to eval :(\n \"jsx-runtime.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-jsx-19')\")) } else {\n ${contents}\n}`;\n }\n }\n },\n {\n module: \"react-dom\",\n patchFiles: {\n version: \"18.*\",\n // for prod builds we have to actually change the entries:\n \"index.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-19')\")) } else {\n${contents}\n}`;\n },\n \"client.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-client-19')\")) } else {\n${contents}\n}`;\n },\n \"server.browser.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, require('@vxrn/vendor/react-dom-server.browser-19')) } else {\n${contents}\n}`;\n },\n \"client.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-client-19')`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-19')`,\n \"server.browser.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-server.browser-19')`,\n \"test-utils.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-test-utils-19')`,\n \"package.json\": function(contents) {\n assertString(contents);\n var pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n var existingExports = {\n ...pkg.exports\n };\n if (!pkg.exports[\".\"]) {\n throw new Error(`Expected a version of React that has package.json exports defined`);\n }\n pkg.exports[\".\"] = {\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./client\"] = {\n \"vxrn-web\": \"./client.vxrn-web.js\",\n default: \"./client.js\"\n };\n pkg.exports[\"./server.browser\"] = {\n \"vxrn-web\": \"./server.browser.vxrn-web.js\",\n default: \"./server.browser.js\"\n };\n pkg.exports[\"./test-utils\"] = {\n \"vxrn-web\": \"./test-utils.vxrn-web.js\",\n default: \"./test-utils.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n }\n }\n },\n // Older versions of the cli-config package will not look for `.cjs` files when loading the config. This isn't necessary for v14.x (which comes with RN 0.75). See: https://hackmd.io/@z/SJghMPN6C.\n {\n module: \"@react-native-community/cli-config\",\n patchFiles: {\n version: \">=13.0.0 <16.0.0\",\n \"build/readConfigFromDisk.js\": function(contents) {\n assertString(contents);\n return contents.replace(`['react-native.config.js']`, `['react-native.config.js', 'react-native.config.cjs']`).replace(\"searchPlaces,\", `searchPlaces, loaders: { '.cjs': _cosmiconfig().default.loadJs },`).replace(\"stopDir: rootFolder,\", `stopDir: rootFolder, loaders: { '.cjs': _cosmiconfig().default.loadJs },`);\n }\n }\n },\n {\n module: \"react-native-reanimated\",\n patchFiles: {\n // reanimated 4 ships no JSX in its `.js`. Measured against 4.5.1: all 374\n // files parse with SWC at `jsx: false`, and the only JSX-shaped text is\n // inside comments. The transform still rewrote and reformatted every one\n // of them, which is how a patch aimed at reanimated ended up re-printing\n // its nested `semver` and giving one package@version two contents on\n // disk. Left in place below 4 rather than deleted, because we verified 4\n // and not the 3.x line.\n version: \"<4.0.0\",\n \"**/*.js\": [\n \"jsx\"\n ]\n }\n },\n // fix RNGH crash on RN 0.86+ new architecture\n // getShadowNodeFromRef crashes when findHostInstance_DEPRECATED returns null\n {\n module: \"react-native-gesture-handler\",\n patchFiles: {\n version: \">=3.0.0\",\n \"lib/module/getShadowNodeFromRef.js\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace(`const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode.node;`, `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`);\n },\n // metro uses src/ directly via \"react-native\" field in package.json\n \"src/getShadowNodeFromRef.ts\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace(`const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode\n .node;`, `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`);\n }\n }\n },\n {\n module: \"@react-native-masked-view/masked-view\",\n patchFiles: {\n \"**/*.js\": [\n \"flow\",\n \"swc\"\n ]\n }\n },\n {\n module: \"react-native-vector-icons\",\n patchFiles: {\n \"**/*.js\": [\n \"jsx\",\n \"flow\"\n ]\n }\n },\n {\n module: \"react-native-webview\",\n patchFiles: {\n \"**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@react-native/assets-registry\",\n patchFiles: {\n \"**/*.js\": [\n \"flow\"\n ]\n }\n },\n {\n module: \"react-native-css-interop\",\n patchFiles: {\n // 2 of 53 dist files genuinely need JSX parsing, so this one is real.\n //\n // Two sibling patches were removed here, both dead. A `wrap-jsx.js` entry\n // tried to hoist `require(\"./components\")` out of the function so\n // cssInterop registration runs, but `patches.ts` selects with\n // `filePatches.find(relativePath)` and `dist/**/*.js` is declared first,\n // so the glob shadowed it and the hoist never executed once: the patched\n // file on disk still has the require inside the function. A `package.json`\n // entry set `sideEffects` to keep components.js from being tree-shaken,\n // and 0.2.6 already ships exactly that value.\n //\n // So nativewind registration has never actually been hoisted by this\n // patch. Anyone deciding whether to keep the CSS-on-native path should\n // start from that, not from the assumption that it works today.\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.6.0\",\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.0.0 <5.6.0\",\n \"dist/js/utils/environment.js\": function(contents) {\n assertString(contents);\n return contents.replace(`import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';`, `import { Platform } from 'react-native';\nconst RNV = Platform.constants.reactNativeVersion;\n`);\n },\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"qrcode\",\n patchFiles: {\n version: \"<=1.5.1\",\n \"lib/server.js\": function(contents) {\n assertString(contents);\n return contents.replace(`const TerminalRenderer = require('./renderer/terminal')`, `const TerminalRenderer = require('./renderer/terminal.js')`);\n }\n }\n },\n {\n module: \"whatwg-url-without-unicode\",\n // https://github.com/onejs/one/issues/258\n patchFiles: {\n \"**/*.js\": function(contents) {\n var _contents_replace;\n return contents === null || contents === void 0 ? void 0 : (_contents_replace = contents.replace(/punycode\\.ucs2\\.decode/gm, \"(punycode.ucs2decode || punycode.ucs2.decode)\")) === null || _contents_replace === void 0 ? void 0 : _contents_replace.replace(/punycode\\.ucs2\\.encode/gm, \"(punycode.ucs2encode || punycode.ucs2.encode)\");\n }\n }\n },\n {\n module: \"@hot-updater/plugin-core\",\n patchFiles: {\n version: \"0.*\",\n \"dist/index.cjs\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace('let mime = require(\"mime\");', 'let mime = { getType: () => \"application/octet-stream\", getExtension: () => null };');\n }\n }\n },\n // a void TurboModule method that throws an Obj-C NSException crashes the app\n // when React Native rethrows it on the TurboModule queue. there is no JS\n // caller for an async void method to receive an error, so log it instead.\n // see tests/test/IOS_PROD_CRASH.md\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.86.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": function(contents) {\n if (!contents) return;\n return contents.replace(` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw exception;\n } @finally {`, ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`);\n }\n }\n }\n];\nexport {\n builtInDepPatches\n};\n//# sourceMappingURL=builtInDepPatches.js.map\n"],"mappings":";;;;AAEA,IAAI,oBAAoB;CAItB;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,uBAAuB,SAAS,UAAU;IACxC,aAAa,QAAQ;IACrB,IAA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AAa,QAAQ,aAAa,KAAK,IAAI,KAAK,KAAK,oBAAoB,SAAS,QAAQ,4BAA4B,+CAA+C,OAAO,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,QAAQ,4BAA4B,+CAA+C;EAC1U,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kBAAkB,SAAS,UAAU;IACnC,OAAO,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ,iCAA+B,uFAAqF;GAClM;EACF;CACF;CAKA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kFAAkF,SAAS,UAAU;IACnG,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QAAQ;;;;;;mBAMb;;;;iBAIF;GACX;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"builtInDepPatches.native.js","names":[],"sources":["patches/builtInDepPatches.native.js"],"sourcesContent":["import { assertString } from \"../utils/assert\";\nimport { bailIfExists, bailIfUnchanged } from \"../utils/patches\";\nvar builtInDepPatches = [\n // @react-navigation/core 7.17 renamed createComponentForStaticNavigation to\n // createComponentForStaticConfigDeprecated, breaking @react-navigation/native\n // which still imports the old name. re-export the old name as an alias.\n {\n module: \"@react-navigation/core\",\n patchFiles: {\n version: \">=7.17.0 <8.0.0\",\n \"lib/module/index.js\": function(contents) {\n assertString(contents);\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(/export \\{ createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/, \"export { createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\");\n },\n \"lib/commonjs/index.js\": function(contents) {\n if (!contents) return;\n if (contents.includes(\"createComponentForStaticNavigation\")) return;\n if (!contents.includes(\"createComponentForStaticConfigDeprecated\")) return;\n return contents.replace(/createComponentForStaticConfigDeprecated as createComponentForStaticConfig,/, \"createComponentForStaticConfigDeprecated as createComponentForStaticConfig, createComponentForStaticConfigDeprecated as createComponentForStaticNavigation,\");\n }\n }\n },\n // react-native-maps ships TypeScript source, and every map child component\n // declares the members decorateMapComponent installs on the prototype as\n // definite-assignment class fields (`getNativeComponent!: () => ...`). oxc\n // keeps a field declaration that has no initializer, so constructing the\n // component gives each instance its own `undefined` property that shadows the\n // prototype method, and the first render throws \"this.getNativeComponent is\n // not a function\". babel's loose class properties erase these on native, so\n // only the vite side breaks. oxc ignores useDefineForClassFields, so no\n // tsconfig or oxc option reaches this; `declare` is what the declaration\n // always meant and every transform erases it.\n {\n module: \"react-native-maps\",\n patchFiles: {\n \"src/*.tsx\": function(contents) {\n assertString(contents);\n var patched = contents.replace(/^(\\s*)(context|getNativeComponent|getMapManagerCommand|getUIManagerCommand)!:/gm, \"$1declare $2:\");\n bailIfUnchanged(patched, contents);\n return patched;\n }\n }\n },\n // react-native-web doesn't export unstable_batchedUpdates but react-native does,\n // so libraries like @legendapp/list break when aliased to rnw on web\n {\n module: \"react-native-web\",\n patchFiles: {\n \"dist/index.js\": function(contents) {\n assertString(contents);\n bailIfExists(contents, \"unstable_batchedUpdates\");\n return `${contents}\nexport { unstable_batchedUpdates } from 'react-dom';\n`;\n }\n }\n },\n {\n module: \"react\",\n patchFiles: {\n version: \"18.*\",\n \"compiler-runtime.js\": `module.exports = require('@vxrn/vendor/react-19-compiler-runtime');`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-19');`,\n \"jsx-dev-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-dev-19');`,\n \"jsx-runtime.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-jsx-19');`,\n \"package.json\": function(contents) {\n assertString(contents);\n var pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n var existingExports = {\n ...pkg.exports\n };\n if (!pkg.exports[\".\"]) {\n throw new Error(`Expected a version of React that has package.json exports defined`);\n }\n pkg.exports[\".\"] = {\n \"react-server\": \"./react.shared-subset.js\",\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./jsx-runtime\"] = {\n \"vxrn-web\": \"./jsx-runtime.vxrn-web.js\",\n default: \"./jsx-runtime.js\"\n };\n pkg.exports[\"./compiler-runtime\"] = {\n default: \"./compiler-runtime.js\"\n };\n pkg.exports[\"./jsx-dev-runtime\"] = {\n \"vxrn-web\": \"./jsx-dev-runtime.vxrn-web.js\",\n default: \"./jsx-dev-runtime.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n },\n // for prod builds we have to actually change the entries:\n // to avoid terrible metro we have to eval :(\n \"index.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-19')\")) } else {\n ${contents}\n}`;\n },\n // to avoid terrible metro we have to eval :(\n \"jsx-runtime.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-jsx-19')\")) } else {\n ${contents}\n}`;\n }\n }\n },\n {\n module: \"react-dom\",\n patchFiles: {\n version: \"18.*\",\n // for prod builds we have to actually change the entries:\n \"index.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-19')\")) } else {\n${contents}\n}`;\n },\n \"client.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, eval(\"require('@vxrn/vendor/react-dom-client-19')\")) } else {\n${contents}\n}`;\n },\n \"server.browser.js\": function(contents) {\n assertString(contents);\n return `\nif (process.env.VXRN_REACT_19) { Object.assign(exports, require('@vxrn/vendor/react-dom-server.browser-19')) } else {\n${contents}\n}`;\n },\n \"client.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-client-19')`,\n \"index.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-19')`,\n \"server.browser.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-server.browser-19')`,\n \"test-utils.vxrn-web.js\": `module.exports = require('@vxrn/vendor/react-dom-test-utils-19')`,\n \"package.json\": function(contents) {\n assertString(contents);\n var pkg = JSON.parse(contents);\n if (pkg.version.startsWith(\"19.\")) {\n return;\n }\n var existingExports = {\n ...pkg.exports\n };\n if (!pkg.exports[\".\"]) {\n throw new Error(`Expected a version of React that has package.json exports defined`);\n }\n pkg.exports[\".\"] = {\n \"vxrn-web\": \"./index.vxrn-web.js\",\n default: \"./index.js\"\n };\n pkg.exports[\"./client\"] = {\n \"vxrn-web\": \"./client.vxrn-web.js\",\n default: \"./client.js\"\n };\n pkg.exports[\"./server.browser\"] = {\n \"vxrn-web\": \"./server.browser.vxrn-web.js\",\n default: \"./server.browser.js\"\n };\n pkg.exports[\"./test-utils\"] = {\n \"vxrn-web\": \"./test-utils.vxrn-web.js\",\n default: \"./test-utils.js\"\n };\n bailIfUnchanged(existingExports, pkg.exports);\n return JSON.stringify(pkg, null, 2);\n }\n }\n },\n // Older versions of the cli-config package will not look for `.cjs` files when loading the config. This isn't necessary for v14.x (which comes with RN 0.75). See: https://hackmd.io/@z/SJghMPN6C.\n {\n module: \"@react-native-community/cli-config\",\n patchFiles: {\n version: \">=13.0.0 <16.0.0\",\n \"build/readConfigFromDisk.js\": function(contents) {\n assertString(contents);\n return contents.replace(`['react-native.config.js']`, `['react-native.config.js', 'react-native.config.cjs']`).replace(\"searchPlaces,\", `searchPlaces, loaders: { '.cjs': _cosmiconfig().default.loadJs },`).replace(\"stopDir: rootFolder,\", `stopDir: rootFolder, loaders: { '.cjs': _cosmiconfig().default.loadJs },`);\n }\n }\n },\n {\n module: \"react-native-reanimated\",\n patchFiles: {\n // reanimated 4 ships no JSX in its `.js`. Measured against 4.5.1: all 374\n // files parse with SWC at `jsx: false`, and the only JSX-shaped text is\n // inside comments. The transform still rewrote and reformatted every one\n // of them, which is how a patch aimed at reanimated ended up re-printing\n // its nested `semver` and giving one package@version two contents on\n // disk. Left in place below 4 rather than deleted, because we verified 4\n // and not the 3.x line.\n version: \"<4.0.0\",\n \"**/*.js\": [\n \"jsx\"\n ]\n }\n },\n // fix RNGH crash on RN 0.86+ new architecture\n // getShadowNodeFromRef crashes when findHostInstance_DEPRECATED returns null\n {\n module: \"react-native-gesture-handler\",\n patchFiles: {\n version: \">=3.0.0\",\n \"lib/module/getShadowNodeFromRef.js\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace(`const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode.node;`, `const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`);\n },\n // metro uses src/ directly via \"react-native\" field in package.json\n \"src/getShadowNodeFromRef.ts\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace(`const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode\n .node;`, `const hostInstance = isAlreadyHostInstance\n ? ref\n : findHostInstance_DEPRECATED(ref);\n if (hostInstance === null || hostInstance === undefined) {\n return null;\n }\n const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);\n if (internalHandle === null || internalHandle === undefined) {\n return null;\n }\n return internalHandle.stateNode?.node ?? null;`);\n }\n }\n },\n {\n module: \"@react-native-masked-view/masked-view\",\n patchFiles: {\n \"**/*.js\": [\n \"flow\",\n \"swc\"\n ]\n }\n },\n {\n module: \"react-native-vector-icons\",\n patchFiles: {\n \"**/*.js\": [\n \"jsx\",\n \"flow\"\n ]\n }\n },\n {\n module: \"react-native-webview\",\n patchFiles: {\n \"**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@react-native/assets-registry\",\n patchFiles: {\n \"**/*.js\": [\n \"flow\"\n ]\n }\n },\n {\n module: \"react-native-css-interop\",\n patchFiles: {\n // 2 of 53 dist files genuinely need JSX parsing, so this one is real.\n //\n // Two sibling patches were removed here, both dead. A `wrap-jsx.js` entry\n // tried to hoist `require(\"./components\")` out of the function so\n // cssInterop registration runs, but `patches.ts` selects with\n // `filePatches.find(relativePath)` and `dist/**/*.js` is declared first,\n // so the glob shadowed it and the hoist never executed once: the patched\n // file on disk still has the require inside the function. A `package.json`\n // entry set `sideEffects` to keep components.js from being tree-shaken,\n // and 0.2.6 already ships exactly that value.\n //\n // So nativewind registration has never actually been hoisted by this\n // patch. Anyone deciding whether to keep the CSS-on-native path should\n // start from that, not from the assumption that it works today.\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.6.0\",\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"@sentry/react-native\",\n patchFiles: {\n version: \">=5.0.0 <5.6.0\",\n \"dist/js/utils/environment.js\": function(contents) {\n assertString(contents);\n return contents.replace(`import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';`, `import { Platform } from 'react-native';\nconst RNV = Platform.constants.reactNativeVersion;\n`);\n },\n \"dist/**/*.js\": [\n \"jsx\"\n ]\n }\n },\n {\n module: \"qrcode\",\n patchFiles: {\n version: \"<=1.5.1\",\n \"lib/server.js\": function(contents) {\n assertString(contents);\n return contents.replace(`const TerminalRenderer = require('./renderer/terminal')`, `const TerminalRenderer = require('./renderer/terminal.js')`);\n }\n }\n },\n {\n module: \"whatwg-url-without-unicode\",\n // https://github.com/onejs/one/issues/258\n patchFiles: {\n \"**/*.js\": function(contents) {\n var _contents_replace;\n return contents === null || contents === void 0 ? void 0 : (_contents_replace = contents.replace(/punycode\\.ucs2\\.decode/gm, \"(punycode.ucs2decode || punycode.ucs2.decode)\")) === null || _contents_replace === void 0 ? void 0 : _contents_replace.replace(/punycode\\.ucs2\\.encode/gm, \"(punycode.ucs2encode || punycode.ucs2.encode)\");\n }\n }\n },\n {\n module: \"@hot-updater/plugin-core\",\n patchFiles: {\n version: \"0.*\",\n \"dist/index.cjs\": function(contents) {\n return contents === null || contents === void 0 ? void 0 : contents.replace('let mime = require(\"mime\");', 'let mime = { getType: () => \"application/octet-stream\", getExtension: () => null };');\n }\n }\n },\n // a void TurboModule method that throws an Obj-C NSException crashes the app\n // when React Native rethrows it on the TurboModule queue. there is no JS\n // caller for an async void method to receive an error, so log it instead.\n // see tests/test/IOS_PROD_CRASH.md\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.86.0 <0.88.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": function(contents) {\n if (!contents) return;\n return contents.replace(` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw exception;\n } @finally {`, ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`);\n }\n }\n },\n // 0.88 wraps the same rethrow. the old string matches nothing, so the\n // exception reaches the process handler again.\n {\n module: \"react-native\",\n patchFiles: {\n version: \">=0.88.0\",\n \"ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm\": function(contents) {\n if (!contents) return;\n return contents.replace(` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n // Void methods are always async, re-throw instead of converting to\n // JSError, same as the async branch in performMethodInvocation.\n @throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);\n } @finally {`, ` @try {\n [inv invokeWithTarget:strongModule];\n } @catch (NSException *exception) {\n RCTLogError(@\"Exception in %s.%s: %@\", moduleName, methodNameStr.c_str(), exception.reason);\n } @finally {`);\n }\n }\n }\n];\nexport {\n builtInDepPatches\n};\n//# sourceMappingURL=builtInDepPatches.js.map\n"],"mappings":";;;;AAEA,IAAI,oBAAoB;CAItB;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,uBAAuB,SAAS,UAAU;IACxC,aAAa,QAAQ;IACrB,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QAAQ,yFAAyF,sKAAsK;GACzR;GACA,yBAAyB,SAAS,UAAU;IAC1C,IAAI,CAAC,UAAU;IACf,IAAI,SAAS,SAAS,oCAAoC,GAAG;IAC7D,IAAI,CAAC,SAAS,SAAS,0CAA0C,GAAG;IACpE,OAAO,SAAS,QAAQ,+EAA+E,6JAA6J;GACtQ;EACF;CACF;CAWA;EACE,QAAQ;EACR,YAAY,EACV,aAAa,SAAS,UAAU;GAC9B,aAAa,QAAQ;GACrB,IAAI,UAAU,SAAS,QAAQ,mFAAmF,eAAe;GACjI,gBAAgB,SAAS,QAAQ;GACjC,OAAO;EACT,EACF;CACF;CAGA;EACE,QAAQ;EACR,YAAY,EACV,iBAAiB,SAAS,UAAU;GAClC,aAAa,QAAQ;GACrB,aAAa,UAAU,yBAAyB;GAChD,OAAO,GAAG,SAAS;;;EAGrB,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,uBAAuB;GACvB,qBAAqB;GACrB,+BAA+B;GAC/B,2BAA2B;GAC3B,gBAAgB,SAAS,UAAU;IACjC,aAAa,QAAQ;IACrB,IAAI,MAAM,KAAK,MAAM,QAAQ;IAC7B,IAAI,IAAI,QAAQ,WAAW,KAAK,GAAG;KACjC;IACF;IACA,IAAI,kBAAkB,EACpB,GAAG,IAAI,QACT;IACA,IAAI,CAAC,IAAI,QAA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ACrB,OAAO,SAAS,QAAQ,oFAAoF;;CAEnH;GACK;GACA,gBAAgB,CACd,KACF;EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,iBAAiB,SAAS,UAAU;IAClC,aAAa,QAAQ;IACrB,OAAO,SAAS,QAAQ,2DAA2D,4DAA4D;GACjJ;EACF;CACF;CACA;EACE,QAAQ;EAER,YAAY,EACV,WAAW,SAAS,UAAU;GAC5B,IAAI;GACJ,OAAO,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,KAAK,oBAAoB,SAAS,QAAQ,4BAA4B,+CAA+C,OAAO,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,QAAQ,4BAA4B,+CAA+C;EAC1U,EACF;CACF;CACA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kBAAkB,SAAS,UAAU;IACnC,OAAO,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ,iCAA+B,uFAAqF;GAClM;EACF;CACF;CAKA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kFAAkF,SAAS,UAAU;IACnG,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QAAQ;;;;;;mBAMb;;;;iBAIF;GACX;EACF;CACF;CAGA;EACE,QAAQ;EACR,YAAY;GACV,SAAS;GACT,kFAAkF,SAAS,UAAU;IACnG,IAAI,CAAC,UAAU;IACf,OAAO,SAAS,QAAQ;;;;;;mBAMb;;;;iBAIF;GACX;EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxrn",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.7",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -80,14 +80,14 @@
|
|
|
80
80
|
"@react-native-community/cli": "^20.2.0",
|
|
81
81
|
"@react-native-community/cli-config": "^20.2.0",
|
|
82
82
|
"@react-native/dev-middleware": "^0.88.0",
|
|
83
|
-
"@vxrn/compiler": "2.13.
|
|
84
|
-
"@vxrn/debug": "2.13.
|
|
85
|
-
"@vxrn/query-string": "2.13.
|
|
86
|
-
"@vxrn/resolve": "2.13.
|
|
87
|
-
"@vxrn/url-parse": "2.13.
|
|
88
|
-
"@vxrn/utils": "2.13.
|
|
89
|
-
"@vxrn/vendor": "2.13.
|
|
90
|
-
"@vxrn/vite-flow": "2.13.
|
|
83
|
+
"@vxrn/compiler": "2.13.7",
|
|
84
|
+
"@vxrn/debug": "2.13.7",
|
|
85
|
+
"@vxrn/query-string": "2.13.7",
|
|
86
|
+
"@vxrn/resolve": "2.13.7",
|
|
87
|
+
"@vxrn/url-parse": "2.13.7",
|
|
88
|
+
"@vxrn/utils": "2.13.7",
|
|
89
|
+
"@vxrn/vendor": "2.13.7",
|
|
90
|
+
"@vxrn/vite-flow": "2.13.7",
|
|
91
91
|
"citty": "^0.1.6",
|
|
92
92
|
"dotenv": "^17.2.1",
|
|
93
93
|
"dotenv-expand": "^12.0.2",
|
|
@@ -127,20 +127,20 @@
|
|
|
127
127
|
"react-native": "0.88.0",
|
|
128
128
|
"typescript": "7.0.2",
|
|
129
129
|
"vitest": "^4.1.0",
|
|
130
|
-
"@vxrn/vite-plugin-metro": "2.13.
|
|
130
|
+
"@vxrn/vite-plugin-metro": "2.13.7"
|
|
131
131
|
},
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@vxrn/vite-plugin-metro": "2.13.
|
|
136
|
+
"@vxrn/vite-plugin-metro": "2.13.7"
|
|
137
137
|
},
|
|
138
138
|
"peerDependenciesMeta": {
|
|
139
139
|
"@vxrn/vite-plugin-metro": {
|
|
140
140
|
"optional": true
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
"releaseSourceCommit": "
|
|
143
|
+
"releaseSourceCommit": "973e91ad36ed35d5b78aaa5a235c0bfadea51e69",
|
|
144
144
|
"repository": {
|
|
145
145
|
"type": "git",
|
|
146
146
|
"url": "git+https://github.com/onejs/one.git",
|
|
@@ -446,7 +446,7 @@ ${contents}
|
|
|
446
446
|
{
|
|
447
447
|
module: 'react-native',
|
|
448
448
|
patchFiles: {
|
|
449
|
-
version: '>=0.86.0',
|
|
449
|
+
version: '>=0.86.0 <0.88.0',
|
|
450
450
|
|
|
451
451
|
'ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm': (
|
|
452
452
|
contents
|
|
@@ -469,4 +469,33 @@ ${contents}
|
|
|
469
469
|
},
|
|
470
470
|
},
|
|
471
471
|
},
|
|
472
|
+
|
|
473
|
+
// 0.88 wraps the same rethrow. the old string matches nothing, so the
|
|
474
|
+
// exception reaches the process handler again.
|
|
475
|
+
{
|
|
476
|
+
module: 'react-native',
|
|
477
|
+
patchFiles: {
|
|
478
|
+
version: '>=0.88.0',
|
|
479
|
+
|
|
480
|
+
'ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm': (
|
|
481
|
+
contents
|
|
482
|
+
) => {
|
|
483
|
+
if (!contents) return
|
|
484
|
+
return contents.replace(
|
|
485
|
+
` @try {
|
|
486
|
+
[inv invokeWithTarget:strongModule];
|
|
487
|
+
} @catch (NSException *exception) {
|
|
488
|
+
// Void methods are always async, re-throw instead of converting to
|
|
489
|
+
// JSError, same as the async branch in performMethodInvocation.
|
|
490
|
+
@throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);
|
|
491
|
+
} @finally {`,
|
|
492
|
+
` @try {
|
|
493
|
+
[inv invokeWithTarget:strongModule];
|
|
494
|
+
} @catch (NSException *exception) {
|
|
495
|
+
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
496
|
+
} @finally {`
|
|
497
|
+
)
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
472
501
|
]
|
|
@@ -11,6 +11,7 @@ vi.mock('@vxrn/compiler', () => ({ transformSWC: vi.fn() }))
|
|
|
11
11
|
vi.mock('@vxrn/vite-flow', () => ({ transformFlowBabel: vi.fn() }))
|
|
12
12
|
|
|
13
13
|
import { transformSWC } from '@vxrn/compiler'
|
|
14
|
+
import { builtInDepPatches } from '../patches/builtInDepPatches'
|
|
14
15
|
import {
|
|
15
16
|
type DepPatch,
|
|
16
17
|
applyDependencyPatches,
|
|
@@ -338,6 +339,37 @@ describe('applyDependencyPatches', () => {
|
|
|
338
339
|
warn.mockRestore()
|
|
339
340
|
})
|
|
340
341
|
|
|
342
|
+
it('logs a throwing void TurboModule on both the old and 0.88 catch blocks', () => {
|
|
343
|
+
const path =
|
|
344
|
+
'ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm'
|
|
345
|
+
const logged =
|
|
346
|
+
'RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);'
|
|
347
|
+
const older = ` @try {
|
|
348
|
+
[inv invokeWithTarget:strongModule];
|
|
349
|
+
} @catch (NSException *exception) {
|
|
350
|
+
// Void methods are always async, re-throw instead of converting to
|
|
351
|
+
// JSError, same as the async branch in performMethodInvocation.
|
|
352
|
+
@throw exception;
|
|
353
|
+
} @finally {`
|
|
354
|
+
const current = older.replace(
|
|
355
|
+
'@throw exception;',
|
|
356
|
+
'@throw addModuleIdentityToException(exception, std::string{moduleName}, methodNameStr);'
|
|
357
|
+
)
|
|
358
|
+
const apply = (version: string, source: string) => {
|
|
359
|
+
const patch = builtInDepPatches.find(
|
|
360
|
+
(entry) => entry.module === 'react-native' && entry.patchFiles.version === version
|
|
361
|
+
)
|
|
362
|
+
const transform = patch?.patchFiles[path]
|
|
363
|
+
if (typeof transform !== 'function') throw new Error(version)
|
|
364
|
+
return transform(source)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
expect(apply('>=0.86.0 <0.88.0', older)).toContain(logged)
|
|
368
|
+
expect(apply('>=0.86.0 <0.88.0', older)).not.toContain('@throw exception;')
|
|
369
|
+
expect(apply('>=0.88.0', current)).toContain(logged)
|
|
370
|
+
expect(apply('>=0.88.0', current)).not.toContain('@throw addModuleIdentityToException')
|
|
371
|
+
})
|
|
372
|
+
|
|
341
373
|
// a patch is written to node_modules once and then read by every later build,
|
|
342
374
|
// so it must be transformed as production. the dev JSX runtime emits `jsxDEV`,
|
|
343
375
|
// which React's production build exports as `void 0`, so a patched dependency
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInDepPatches.d.ts","sourceRoot":"","sources":["../../src/patches/builtInDepPatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAiC,MAAM,kBAAkB,CAAA;AAE/E,eAAO,MAAM,iBAAiB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"builtInDepPatches.d.ts","sourceRoot":"","sources":["../../src/patches/builtInDepPatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAiC,MAAM,kBAAkB,CAAA;AAE/E,eAAO,MAAM,iBAAiB,EAAE,QAAQ,EAifvC,CAAA"}
|