vxrn 2.13.6 → 2.13.8
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/exports/build.mjs +1 -4
- package/dist/exports/build.mjs.map +1 -1
- package/dist/exports/build.native.js +1 -4
- package/dist/exports/build.native.js.map +1 -1
- 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/exports/build.ts +0 -7
- package/src/patches/builtInDepPatches.ts +30 -1
- package/src/utils/patches.test.ts +32 -0
- package/types/exports/build.d.ts.map +1 -1
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
package/dist/exports/build.mjs
CHANGED
|
@@ -140,10 +140,7 @@ const build = async (optionsIn, buildArgs = {}) => {
|
|
|
140
140
|
outDir: `${outDir}/client`,
|
|
141
141
|
sourcemap: false,
|
|
142
142
|
manifest: true,
|
|
143
|
-
rolldownOptions: {
|
|
144
|
-
input: ["virtual:one-entry"],
|
|
145
|
-
output: { codeSplitting: { minSize: 42e3 } }
|
|
146
|
-
}
|
|
143
|
+
rolldownOptions: { input: ["virtual:one-entry"] }
|
|
147
144
|
}
|
|
148
145
|
});
|
|
149
146
|
if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","names":["viteBuild"],"sources":["exports/build.js"],"sourcesContent":["import FSExtra from \"fs-extra\";\nimport { rm } from \"node:fs/promises\";\nimport { sep } from \"node:path\";\nimport {\n loadConfigFromFile,\n mergeConfig,\n build as viteBuild\n} from \"vite\";\nimport { getBaseViteConfigWithPlugins } from \"../config/getBaseViteConfigWithPlugins\";\nimport { getOptimizeDeps } from \"../config/getOptimizeDeps\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { mergeUserConfig } from \"../config/mergeUserConfig\";\nimport { getServerCJSSetting, getServerEntry } from \"../utils/getServerEntry\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport { loadEnv } from \"./loadEnv\";\nconst disableOptimizationConfig = {\n optimizeDeps: {},\n build: {\n minify: false,\n rolldownOptions: {\n treeshake: false,\n output: {\n minifyInternalExports: false\n }\n }\n }\n};\nconst build = async (optionsIn, buildArgs = {}) => {\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`\n );\n }\n const skipEnv = optionsIn.skipEnv ?? false;\n const [envResult, options, userViteConfig] = await Promise.all([\n skipEnv ? { serverEnv: {}, clientEnv: {}, clientEnvDefine: {} } : loadEnv(\"production\"),\n fillOptions(optionsIn, { mode: \"prod\" }),\n loadConfigFromFile({\n command: \"build\",\n mode: \"prod\"\n }).then((_) => _?.config)\n ]);\n if (!process.env.ONE_SERVER_URL) {\n console.warn(\n `\\u26A0\\uFE0F No ONE_SERVER_URL environment set, set it in your .env to your target deploy URL`\n );\n }\n const processEnvDefines = Object.fromEntries(\n Object.entries(envResult.serverEnv).map(([key, value]) => {\n return [`process.env.${key}`, JSON.stringify(value)];\n })\n );\n await applyBuiltInPatches(options).catch((err) => {\n console.error(`\n \\u{1F97A} error applying built-in patches`, err);\n });\n const outDir = userViteConfig?.build?.outDir ?? \"dist\";\n const platform = buildArgs.platform;\n const isNativeBuild = platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\";\n const cleanDir = buildArgs.step === \"generate\" && !isNativeBuild ? `${outDir}/server` : outDir;\n await rm(cleanDir, { recursive: true, force: true });\n if (isNativeBuild) {\n const { buildBundle } = await import(\"../rn-commands/bundle/buildBundle\");\n return buildBundle(\n [],\n // only an entry the app named: without one the bundle starts at the\n // generated route entry, as the xcode bundle phase does. the filled\n // default (./src/entry-native.tsx) exists only in plain vxrn apps.\n { root: options.root, vxrnEntries: optionsIn.entries },\n {\n platform,\n bundleOutput: `${outDir}${sep}${platform}.js`,\n // every native build emits imported assets beside its bundle\n assetsDest: outDir,\n dev: false,\n entryFile: \"\",\n resetCache: true,\n resetGlobalCache: true,\n sourcemapUseAbsolutePath: true,\n verbose: false,\n unstableTransformProfile: \"default\"\n }\n );\n }\n const { optimizeDeps } = getOptimizeDeps(\"build\");\n const { rolldownOptions: optimizeDepsRolldownOptions, ...optimizeDepsWithoutRolldown } = optimizeDeps;\n let webBuildConfig = mergeConfig(\n await getBaseViteConfigWithPlugins({\n ...options,\n mode: \"production\"\n }),\n {\n plugins: globalThis.__vxrnAddWebPluginsProd,\n clearScreen: false,\n configFile: false,\n ...skipEnv && { envFile: false },\n // rolldownOptions goes on environments.client to avoid Vite compat-proxy bug\n optimizeDeps: optimizeDepsWithoutRolldown,\n environments: {\n client: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n logLevel: \"warn\",\n build: {\n rolldownOptions: {\n // react-native packages import native-only exports (codegenNativeComponent etc.)\n // from react-native, which is aliased to react-native-web on web. react-native-web\n // doesn't export these, so rolldown would error. shimMissingExports creates\n // undefined shims instead, matching esbuild's lenient behavior.\n shimMissingExports: true,\n onwarn(warning, defaultHandler) {\n if (warning.code === \"MODULE_LEVEL_DIRECTIVE\" && warning.message.includes(\"use client\")) {\n return;\n }\n if (warning.code === \"SOURCEMAP_ERROR\" && warning.message.includes(`Can't resolve original location of error.`)) {\n return;\n }\n if (warning.code === \"EVAL\") {\n warning.message = warning.message.replace(\n /(\\.+\\/){0,}node_modules/,\n \"node_modules\"\n );\n }\n if (warning.code === \"INVALID_ANNOTATION\") {\n return;\n }\n defaultHandler(warning);\n }\n }\n }\n }\n );\n const rerouteNoExternalConfig = userViteConfig?.ssr?.noExternal === true;\n if (rerouteNoExternalConfig) {\n delete userViteConfig.ssr.noExternal;\n }\n webBuildConfig = mergeUserConfig(optimizeDeps, webBuildConfig, userViteConfig);\n const excludeAPIAndMiddlewareRoutesPlugin = {\n enforce: \"pre\",\n name: \"omit-api-routes\",\n transform: {\n order: \"pre\",\n // both patterns as one rust-side filter, so only api/middleware files\n // cross into js instead of every module in the client bundle\n filter: { id: /(?:\\+api|_middleware)\\.tsx?$/ },\n handler() {\n return ``;\n }\n }\n };\n let clientOutput;\n let clientBuildPromise;\n if (buildArgs.step !== \"generate\") {\n let clientBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [excludeAPIAndMiddlewareRoutesPlugin],\n define: {\n \"process.env.VITE_ENVIRONMENT\": '\"client\"',\n ...process.env.ONE_SERVER_URL && {\n \"process.env.ONE_SERVER_URL\": JSON.stringify(process.env.ONE_SERVER_URL)\n }\n },\n build: {\n ssrManifest: true,\n outDir: `${outDir}/client`,\n sourcemap: false,\n manifest: true,\n rolldownOptions: {\n input: [\"virtual:one-entry\"],\n output: {\n codeSplitting: {\n // merge tiny chunks to reduce HTTP requests and total chunk count\n minSize: 42e3\n }\n }\n }\n }\n });\n if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {\n clientBuildConfig = mergeConfig(clientBuildConfig, disableOptimizationConfig);\n }\n console.info(\n `\n \\u{1F528} build ${options.build?.server !== false ? \"client + server\" : \"client\"}\n`\n );\n clientBuildPromise = viteBuild(clientBuildConfig);\n }\n const serverOptions = options.build?.server;\n const webConfig = optionsIn.web;\n const deployTarget = typeof webConfig?.deploy === \"string\" ? webConfig.deploy : webConfig?.deploy?.target;\n const isCloudflareDeploy = deployTarget === \"cloudflare\";\n const shouldOutputCJS = getServerCJSSetting(options);\n const isUnified = typeof serverOptions === \"object\" && serverOptions !== null && serverOptions.unified === true;\n let serverBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [excludeAPIAndMiddlewareRoutesPlugin, ...globalThis.__vxrnAddWebPluginsProd],\n define: {\n \"process.env.TAMAGUI_IS_SERVER\": '\"1\"',\n \"process.env.VITE_ENVIRONMENT\": '\"ssr\"',\n ...processEnvDefines,\n ...webBuildConfig.define\n },\n ssr: {\n ...isCloudflareDeploy && {\n target: \"webworker\"\n },\n noExternal: isUnified ? [\"react\", \"react-dom\"] : true,\n optimizeDeps: optimizeDepsWithoutRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n build: {\n // we want one big file of css\n cssCodeSplit: false,\n ssr: true,\n sourcemap: false,\n outDir: `${outDir}/server`,\n rolldownOptions: {\n treeshake: true,\n // fixes some weird issues with optimizing tamagui and other packages\n // external: (id) => {\n // if (serverExternals.has(id)) return true\n // return false\n // // return /^@tamagui/.test(id)\n // },\n input: [\"virtual:one-entry\"],\n output: {\n ...isCloudflareDeploy && {\n codeSplitting: true\n },\n ...shouldOutputCJS && {\n format: \"cjs\",\n entryFileNames: \"[name].cjs\"\n }\n }\n }\n }\n });\n if (rerouteNoExternalConfig) {\n serverBuildConfig.ssr.noExternal = true;\n }\n const serverEntry = getServerEntry(options, outDir);\n let serverOutput;\n let clientManifest;\n let serverBuildPromise;\n if (serverOptions !== false) {\n if (!clientBuildPromise) {\n console.info(`\n \\u{1F528} build server\n`);\n }\n const userServerConf = optionsIn.build?.server;\n const userServerBuildConf = typeof userServerConf === \"boolean\" ? null : userServerConf?.config;\n serverBuildPromise = viteBuild(\n userServerBuildConf ? mergeConfig(serverBuildConfig, userServerBuildConf) : serverBuildConfig\n );\n }\n if (clientBuildPromise && serverBuildPromise) {\n const [clientResult, serverResult] = await Promise.all([\n clientBuildPromise,\n serverBuildPromise\n ]);\n clientOutput = clientResult.output;\n serverOutput = serverResult.output;\n } else if (clientBuildPromise) {\n const clientResult = await clientBuildPromise;\n clientOutput = clientResult.output;\n } else if (serverBuildPromise) {\n const serverResult = await serverBuildPromise;\n serverOutput = serverResult.output;\n }\n if (serverOptions !== false) {\n clientManifest = await FSExtra.readJSON(`${outDir}/client/.vite/manifest.json`);\n const old = await FSExtra.readFile(serverEntry, \"utf-8\");\n await FSExtra.writeFile(\n serverEntry,\n old.replace(\n `import { hydrate as hydrate$1, unmountComponentAtNode, render as render$1 } from \"react-dom\";`,\n \"\"\n ).replace(\n `import ReactDOM__default, { render as render$2, unmountComponentAtNode as unmountComponentAtNode$1, hydrate as hydrate$1 } from \"react-dom\";`,\n 'import ReactDOM__default from \"react-dom\";'\n )\n );\n }\n return {\n outDir,\n processEnvDefines,\n options,\n buildArgs,\n serverEntry,\n clientOutput,\n serverOutput,\n serverBuildConfig,\n webBuildConfig,\n clientManifest\n };\n};\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,4BAA4B;CAChC,cAAc,CAAC;CACf,OAAO;EACL,QAAQ;EACR,iBAAiB;GACf,WAAW;GACX,QAAQ,EACN,uBAAuB,MACzB;EACF;CACF;AACF;AACA,MAAM,QAAQ,OAAO,WAAW,YAAY,CAAC,MAAM;CACjD,QAAQ,IAAI,cAAc;CAC1B,IAAI,CAAC,QAAQ,IAAI,UAAU;EACzB,QAAQ,IAAI,WAAW;CACzB,OAAO,IAAI,QAAQ,IAAI,aAAa,cAAc;EAChD,QAAQ,KACN;8CACwC,QAAQ,IAAI,SAAS;CAE/D;CACF;CACA,MAAM,UAAU,UAAU,WAAW;CACrC,MAAM,CAAC,WAAW,SAAS,kBAAkB,MAAM,QAAQ,IAAI;EAC7D,UAAU;GAAE,WAAW,CAAC;GAAG,WAAW,CAAC;GAAG,iBAAiB,CAAC;EAAE,IAAI,QAAQ,YAAY;EACtF,YAAY,WAAW,EAAE,MAAM,OAAO,CAAC;EACvC,mBAAmB;GACjB,SAAS;GACT,MAAM;EACR,CAAC,CAAC,CAAC,MAAM,MAAM,GAAG,MAAM;CAC1B,CAAC;CACD,IAAI,CAAC,QAAQ,IAAI,gBAAgB;EAC/B,QAAQ,KACN,+FACF;CACF;CACA,MAAM,oBAAoB,OAAO,YAC/B,OAAO,QAAQ,UAAU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aAAa;CAC9B,OAAO,IAAI,oBAAoB;EAC7B,MAAM,eAAe,MAAM;EAC3B,eAAe,aAAa;CAC9B,OAAO,IAAI,oBAAoB;EAC7B,MAAM,eAAe,MAAM;EAC3B,eAAe,aAAa;CAC9B;CACA,IAAI,kBAAkB,OAAO;EAC3B,iBAAiB,MAAM,QAAQ,SAAS,GAAG,OAAO,4BAA4B;EAC9E,MAAM,MAAM,MAAM,QAAQ,SAAS,aAAa,OAAO;EACvD,MAAM,QAAQ,UACZ,aACA,IAAI,QACF,iGACA,EACF,CAAC,CAAC,QACA,gJACA,8CACF,CACF;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"build.js","names":["viteBuild"],"sources":["exports/build.js"],"sourcesContent":["import FSExtra from \"fs-extra\";\nimport { rm } from \"node:fs/promises\";\nimport { sep } from \"node:path\";\nimport {\n loadConfigFromFile,\n mergeConfig,\n build as viteBuild\n} from \"vite\";\nimport { getBaseViteConfigWithPlugins } from \"../config/getBaseViteConfigWithPlugins\";\nimport { getOptimizeDeps } from \"../config/getOptimizeDeps\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { mergeUserConfig } from \"../config/mergeUserConfig\";\nimport { getServerCJSSetting, getServerEntry } from \"../utils/getServerEntry\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport { loadEnv } from \"./loadEnv\";\nconst disableOptimizationConfig = {\n optimizeDeps: {},\n build: {\n minify: false,\n rolldownOptions: {\n treeshake: false,\n output: {\n minifyInternalExports: false\n }\n }\n }\n};\nconst build = async (optionsIn, buildArgs = {}) => {\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`\n );\n }\n const skipEnv = optionsIn.skipEnv ?? false;\n const [envResult, options, userViteConfig] = await Promise.all([\n skipEnv ? { serverEnv: {}, clientEnv: {}, clientEnvDefine: {} } : loadEnv(\"production\"),\n fillOptions(optionsIn, { mode: \"prod\" }),\n loadConfigFromFile({\n command: \"build\",\n mode: \"prod\"\n }).then((_) => _?.config)\n ]);\n if (!process.env.ONE_SERVER_URL) {\n console.warn(\n `\\u26A0\\uFE0F No ONE_SERVER_URL environment set, set it in your .env to your target deploy URL`\n );\n }\n const processEnvDefines = Object.fromEntries(\n Object.entries(envResult.serverEnv).map(([key, value]) => {\n return [`process.env.${key}`, JSON.stringify(value)];\n })\n );\n await applyBuiltInPatches(options).catch((err) => {\n console.error(`\n \\u{1F97A} error applying built-in patches`, err);\n });\n const outDir = userViteConfig?.build?.outDir ?? \"dist\";\n const platform = buildArgs.platform;\n const isNativeBuild = platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\";\n const cleanDir = buildArgs.step === \"generate\" && !isNativeBuild ? `${outDir}/server` : outDir;\n await rm(cleanDir, { recursive: true, force: true });\n if (isNativeBuild) {\n const { buildBundle } = await import(\"../rn-commands/bundle/buildBundle\");\n return buildBundle(\n [],\n // only an entry the app named: without one the bundle starts at the\n // generated route entry, as the xcode bundle phase does. the filled\n // default (./src/entry-native.tsx) exists only in plain vxrn apps.\n { root: options.root, vxrnEntries: optionsIn.entries },\n {\n platform,\n bundleOutput: `${outDir}${sep}${platform}.js`,\n // every native build emits imported assets beside its bundle\n assetsDest: outDir,\n dev: false,\n entryFile: \"\",\n resetCache: true,\n resetGlobalCache: true,\n sourcemapUseAbsolutePath: true,\n verbose: false,\n unstableTransformProfile: \"default\"\n }\n );\n }\n const { optimizeDeps } = getOptimizeDeps(\"build\");\n const { rolldownOptions: optimizeDepsRolldownOptions, ...optimizeDepsWithoutRolldown } = optimizeDeps;\n let webBuildConfig = mergeConfig(\n await getBaseViteConfigWithPlugins({\n ...options,\n mode: \"production\"\n }),\n {\n plugins: globalThis.__vxrnAddWebPluginsProd,\n clearScreen: false,\n configFile: false,\n ...skipEnv && { envFile: false },\n // rolldownOptions goes on environments.client to avoid Vite compat-proxy bug\n optimizeDeps: optimizeDepsWithoutRolldown,\n environments: {\n client: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n logLevel: \"warn\",\n build: {\n rolldownOptions: {\n // react-native packages import native-only exports (codegenNativeComponent etc.)\n // from react-native, which is aliased to react-native-web on web. react-native-web\n // doesn't export these, so rolldown would error. shimMissingExports creates\n // undefined shims instead, matching esbuild's lenient behavior.\n shimMissingExports: true,\n onwarn(warning, defaultHandler) {\n if (warning.code === \"MODULE_LEVEL_DIRECTIVE\" && warning.message.includes(\"use client\")) {\n return;\n }\n if (warning.code === \"SOURCEMAP_ERROR\" && warning.message.includes(`Can't resolve original location of error.`)) {\n return;\n }\n if (warning.code === \"EVAL\") {\n warning.message = warning.message.replace(\n /(\\.+\\/){0,}node_modules/,\n \"node_modules\"\n );\n }\n if (warning.code === \"INVALID_ANNOTATION\") {\n return;\n }\n defaultHandler(warning);\n }\n }\n }\n }\n );\n const rerouteNoExternalConfig = userViteConfig?.ssr?.noExternal === true;\n if (rerouteNoExternalConfig) {\n delete userViteConfig.ssr.noExternal;\n }\n webBuildConfig = mergeUserConfig(optimizeDeps, webBuildConfig, userViteConfig);\n const excludeAPIAndMiddlewareRoutesPlugin = {\n enforce: \"pre\",\n name: \"omit-api-routes\",\n transform: {\n order: \"pre\",\n // both patterns as one rust-side filter, so only api/middleware files\n // cross into js instead of every module in the client bundle\n filter: { id: /(?:\\+api|_middleware)\\.tsx?$/ },\n handler() {\n return ``;\n }\n }\n };\n let clientOutput;\n let clientBuildPromise;\n if (buildArgs.step !== \"generate\") {\n let clientBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [excludeAPIAndMiddlewareRoutesPlugin],\n define: {\n \"process.env.VITE_ENVIRONMENT\": '\"client\"',\n ...process.env.ONE_SERVER_URL && {\n \"process.env.ONE_SERVER_URL\": JSON.stringify(process.env.ONE_SERVER_URL)\n }\n },\n build: {\n ssrManifest: true,\n outDir: `${outDir}/client`,\n sourcemap: false,\n manifest: true,\n rolldownOptions: {\n input: [\"virtual:one-entry\"]\n }\n }\n });\n if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {\n clientBuildConfig = mergeConfig(clientBuildConfig, disableOptimizationConfig);\n }\n console.info(\n `\n \\u{1F528} build ${options.build?.server !== false ? \"client + server\" : \"client\"}\n`\n );\n clientBuildPromise = viteBuild(clientBuildConfig);\n }\n const serverOptions = options.build?.server;\n const webConfig = optionsIn.web;\n const deployTarget = typeof webConfig?.deploy === \"string\" ? webConfig.deploy : webConfig?.deploy?.target;\n const isCloudflareDeploy = deployTarget === \"cloudflare\";\n const shouldOutputCJS = getServerCJSSetting(options);\n const isUnified = typeof serverOptions === \"object\" && serverOptions !== null && serverOptions.unified === true;\n let serverBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [excludeAPIAndMiddlewareRoutesPlugin, ...globalThis.__vxrnAddWebPluginsProd],\n define: {\n \"process.env.TAMAGUI_IS_SERVER\": '\"1\"',\n \"process.env.VITE_ENVIRONMENT\": '\"ssr\"',\n ...processEnvDefines,\n ...webBuildConfig.define\n },\n ssr: {\n ...isCloudflareDeploy && {\n target: \"webworker\"\n },\n noExternal: isUnified ? [\"react\", \"react-dom\"] : true,\n optimizeDeps: optimizeDepsWithoutRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n build: {\n // we want one big file of css\n cssCodeSplit: false,\n ssr: true,\n sourcemap: false,\n outDir: `${outDir}/server`,\n rolldownOptions: {\n treeshake: true,\n // fixes some weird issues with optimizing tamagui and other packages\n // external: (id) => {\n // if (serverExternals.has(id)) return true\n // return false\n // // return /^@tamagui/.test(id)\n // },\n input: [\"virtual:one-entry\"],\n output: {\n ...isCloudflareDeploy && {\n codeSplitting: true\n },\n ...shouldOutputCJS && {\n format: \"cjs\",\n entryFileNames: \"[name].cjs\"\n }\n }\n }\n }\n });\n if (rerouteNoExternalConfig) {\n serverBuildConfig.ssr.noExternal = true;\n }\n const serverEntry = getServerEntry(options, outDir);\n let serverOutput;\n let clientManifest;\n let serverBuildPromise;\n if (serverOptions !== false) {\n if (!clientBuildPromise) {\n console.info(`\n \\u{1F528} build server\n`);\n }\n const userServerConf = optionsIn.build?.server;\n const userServerBuildConf = typeof userServerConf === \"boolean\" ? null : userServerConf?.config;\n serverBuildPromise = viteBuild(\n userServerBuildConf ? mergeConfig(serverBuildConfig, userServerBuildConf) : serverBuildConfig\n );\n }\n if (clientBuildPromise && serverBuildPromise) {\n const [clientResult, serverResult] = await Promise.all([\n clientBuildPromise,\n serverBuildPromise\n ]);\n clientOutput = clientResult.output;\n serverOutput = serverResult.output;\n } else if (clientBuildPromise) {\n const clientResult = await clientBuildPromise;\n clientOutput = clientResult.output;\n } else if (serverBuildPromise) {\n const serverResult = await serverBuildPromise;\n serverOutput = serverResult.output;\n }\n if (serverOptions !== false) {\n clientManifest = await FSExtra.readJSON(`${outDir}/client/.vite/manifest.json`);\n const old = await FSExtra.readFile(serverEntry, \"utf-8\");\n await FSExtra.writeFile(\n serverEntry,\n old.replace(\n `import { hydrate as hydrate$1, unmountComponentAtNode, render as render$1 } from \"react-dom\";`,\n \"\"\n ).replace(\n `import ReactDOM__default, { render as render$2, unmountComponentAtNode as unmountComponentAtNode$1, hydrate as hydrate$1 } from \"react-dom\";`,\n 'import ReactDOM__default from \"react-dom\";'\n )\n );\n }\n return {\n outDir,\n processEnvDefines,\n options,\n buildArgs,\n serverEntry,\n clientOutput,\n serverOutput,\n serverBuildConfig,\n webBuildConfig,\n clientManifest\n };\n};\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,4BAA4B;CAChC,cAAc,CAAC;CACf,OAAO;EACL,QAAQ;EACR,iBAAiB;GACf,WAAW;GACX,QA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B;IACf,WAAW;IAOX,OAAO,CAAC,mBAAmB;IAC3B,QAAQ;KACN,GAAG,sBAAsB,EACvB,eAAe,KACjB;KACA,GAAG,mBAAmB;MACpB,QAAQ;MACR,gBAAgB;KAClB;IACF;GACF;EACF;CACF,CAAC;CACD,IAAI,yBAAyB;EAC3B,kBAAkB,IAAI,aAAa;CACrC;CACA,MAAM,cAAc,eAAe,SAAS,MAAM;CAClD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,kBAAkB,OAAO;EAC3B,IAAI,CAAC,oBAAoB;GACvB,QAAQ,KAAK;;CAElB;EACG;EACA,MAAM,iBAAiB,UAAU,OAAO;EACxC,MAAM,sBAAsB,OAAO,mBAAmB,YAAY,OAAO,gBAAgB;EACzF,qBAAqBA,QACnB,sBAAsB,YAAY,mBAAmB,mBAAmB,IAAI,iBAC9E;CACF;CACA,IAAI,sBAAsB,oBAAoB;EAC5C,MAAM,CAAC,cAAc,gBAAgB,MAAM,QAAQ,IAAI,CACrD,oBACA,kBACF,CAAC;EACD,eAAe,aAAa;EAC5B,eAAe,aAAa;CAC9B,OAAO,IAAI,oBAAoB;EAC7B,MAAM,eAAe,MAAM;EAC3B,eAAe,aAAa;CAC9B,OAAO,IAAI,oBAAoB;EAC7B,MAAM,eAAe,MAAM;EAC3B,eAAe,aAAa;CAC9B;CACA,IAAI,kBAAkB,OAAO;EAC3B,iBAAiB,MAAM,QAAQ,SAAS,GAAG,OAAO,4BAA4B;EAC9E,MAAM,MAAM,MAAM,QAAQ,SAAS,aAAa,OAAO;EACvD,MAAM,QAAQ,UACZ,aACA,IAAI,QACF,iGACA,EACF,CAAC,CAAC,QACA,gJACA,8CACF,CACF;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -147,10 +147,7 @@ var build = async function build2(optionsIn) {
|
|
|
147
147
|
outDir: `${outDir}/client`,
|
|
148
148
|
sourcemap: false,
|
|
149
149
|
manifest: true,
|
|
150
|
-
rolldownOptions: {
|
|
151
|
-
input: ["virtual:one-entry"],
|
|
152
|
-
output: { codeSplitting: { minSize: 42e3 } }
|
|
153
|
-
}
|
|
150
|
+
rolldownOptions: { input: ["virtual:one-entry"] }
|
|
154
151
|
}
|
|
155
152
|
});
|
|
156
153
|
if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.native.js","names":["viteBuild"],"sources":["exports/build.native.js"],"sourcesContent":["import FSExtra from \"fs-extra\";\nimport { rm } from \"fs/promises\";\nimport { sep } from \"path\";\nimport { loadConfigFromFile, mergeConfig, build as viteBuild } from \"vite\";\nimport { getBaseViteConfigWithPlugins } from \"../config/getBaseViteConfigWithPlugins\";\nimport { getOptimizeDeps } from \"../config/getOptimizeDeps\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { mergeUserConfig } from \"../config/mergeUserConfig\";\nimport { getServerCJSSetting, getServerEntry } from \"../utils/getServerEntry\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport { loadEnv } from \"./loadEnv\";\nvar disableOptimizationConfig = {\n optimizeDeps: {},\n build: {\n minify: false,\n rolldownOptions: {\n treeshake: false,\n output: {\n minifyInternalExports: false\n }\n }\n }\n};\nvar build = async function build2(optionsIn) {\n var buildArgs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var _optionsIn_skipEnv, _ref;\n var _userViteConfig_build, _userViteConfig_ssr, _options_build, _webConfig_deploy;\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(`\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`);\n }\n var skipEnv = (_optionsIn_skipEnv = optionsIn.skipEnv) !== null && _optionsIn_skipEnv !== void 0 ? _optionsIn_skipEnv : false;\n var [envResult, options, userViteConfig] = await Promise.all([\n skipEnv ? {\n serverEnv: {},\n clientEnv: {},\n clientEnvDefine: {}\n } : loadEnv(\"production\"),\n fillOptions(optionsIn, {\n mode: \"prod\"\n }),\n loadConfigFromFile({\n command: \"build\",\n mode: \"prod\"\n }).then(function(_) {\n return _ === null || _ === void 0 ? void 0 : _.config;\n })\n ]);\n if (!process.env.ONE_SERVER_URL) {\n console.warn(`\\u26A0\\uFE0F No ONE_SERVER_URL environment set, set it in your .env to your target deploy URL`);\n }\n var processEnvDefines = Object.fromEntries(Object.entries(envResult.serverEnv).map(function(param) {\n var [key, value] = param;\n return [\n `process.env.${key}`,\n JSON.stringify(value)\n ];\n }));\n await applyBuiltInPatches(options).catch(function(err) {\n console.error(`\n \\u{1F97A} error applying built-in patches`, err);\n });\n var outDir = (_ref = userViteConfig === null || userViteConfig === void 0 ? void 0 : (_userViteConfig_build = userViteConfig.build) === null || _userViteConfig_build === void 0 ? void 0 : _userViteConfig_build.outDir) !== null && _ref !== void 0 ? _ref : \"dist\";\n var platform = buildArgs.platform;\n var isNativeBuild = platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\";\n var cleanDir = buildArgs.step === \"generate\" && !isNativeBuild ? `${outDir}/server` : outDir;\n await rm(cleanDir, {\n recursive: true,\n force: true\n });\n if (isNativeBuild) {\n var { buildBundle } = await import(\"../rn-commands/bundle/buildBundle\");\n return buildBundle(\n [],\n // only an entry the app named: without one the bundle starts at the\n // generated route entry, as the xcode bundle phase does. the filled\n // default (./src/entry-native.tsx) exists only in plain vxrn apps.\n {\n root: options.root,\n vxrnEntries: optionsIn.entries\n },\n {\n platform,\n bundleOutput: `${outDir}${sep}${platform}.js`,\n // every native build emits imported assets beside its bundle\n assetsDest: outDir,\n dev: false,\n entryFile: \"\",\n resetCache: true,\n resetGlobalCache: true,\n sourcemapUseAbsolutePath: true,\n verbose: false,\n unstableTransformProfile: \"default\"\n }\n );\n }\n var { optimizeDeps } = getOptimizeDeps(\"build\");\n var { rolldownOptions: optimizeDepsRolldownOptions, ...optimizeDepsWithoutRolldown } = optimizeDeps;\n var webBuildConfig = mergeConfig(await getBaseViteConfigWithPlugins({\n ...options,\n mode: \"production\"\n }), {\n plugins: globalThis.__vxrnAddWebPluginsProd,\n clearScreen: false,\n configFile: false,\n ...skipEnv && {\n envFile: false\n },\n // rolldownOptions goes on environments.client to avoid Vite compat-proxy bug\n optimizeDeps: optimizeDepsWithoutRolldown,\n environments: {\n client: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n logLevel: \"warn\",\n build: {\n rolldownOptions: {\n // react-native packages import native-only exports (codegenNativeComponent etc.)\n // from react-native, which is aliased to react-native-web on web. react-native-web\n // doesn't export these, so rolldown would error. shimMissingExports creates\n // undefined shims instead, matching esbuild's lenient behavior.\n shimMissingExports: true,\n onwarn(warning, defaultHandler) {\n if (warning.code === \"MODULE_LEVEL_DIRECTIVE\" && warning.message.includes(\"use client\")) {\n return;\n }\n if (warning.code === \"SOURCEMAP_ERROR\" && warning.message.includes(`Can't resolve original location of error.`)) {\n return;\n }\n if (warning.code === \"EVAL\") {\n warning.message = warning.message.replace(/(\\.+\\/){0,}node_modules/, \"node_modules\");\n }\n if (warning.code === \"INVALID_ANNOTATION\") {\n return;\n }\n defaultHandler(warning);\n }\n }\n }\n });\n var rerouteNoExternalConfig = (userViteConfig === null || userViteConfig === void 0 ? void 0 : (_userViteConfig_ssr = userViteConfig.ssr) === null || _userViteConfig_ssr === void 0 ? void 0 : _userViteConfig_ssr.noExternal) === true;\n if (rerouteNoExternalConfig) {\n delete userViteConfig.ssr.noExternal;\n }\n webBuildConfig = mergeUserConfig(optimizeDeps, webBuildConfig, userViteConfig);\n var excludeAPIAndMiddlewareRoutesPlugin = {\n enforce: \"pre\",\n name: \"omit-api-routes\",\n transform: {\n order: \"pre\",\n // both patterns as one rust-side filter, so only api/middleware files\n // cross into js instead of every module in the client bundle\n filter: {\n id: /(?:\\+api|_middleware)\\.tsx?$/\n },\n handler() {\n return ``;\n }\n }\n };\n var clientOutput;\n var clientBuildPromise;\n if (buildArgs.step !== \"generate\") {\n var _options_build1;\n var clientBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [\n excludeAPIAndMiddlewareRoutesPlugin\n ],\n define: {\n \"process.env.VITE_ENVIRONMENT\": '\"client\"',\n ...process.env.ONE_SERVER_URL && {\n \"process.env.ONE_SERVER_URL\": JSON.stringify(process.env.ONE_SERVER_URL)\n }\n },\n build: {\n ssrManifest: true,\n outDir: `${outDir}/client`,\n sourcemap: false,\n manifest: true,\n rolldownOptions: {\n input: [\n \"virtual:one-entry\"\n ],\n output: {\n codeSplitting: {\n // merge tiny chunks to reduce HTTP requests and total chunk count\n minSize: 42e3\n }\n }\n }\n }\n });\n if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {\n clientBuildConfig = mergeConfig(clientBuildConfig, disableOptimizationConfig);\n }\n console.info(`\n \\u{1F528} build ${((_options_build1 = options.build) === null || _options_build1 === void 0 ? void 0 : _options_build1.server) !== false ? \"client + server\" : \"client\"}\n`);\n clientBuildPromise = viteBuild(clientBuildConfig);\n }\n var serverOptions = (_options_build = options.build) === null || _options_build === void 0 ? void 0 : _options_build.server;\n var webConfig = optionsIn.web;\n var deployTarget = typeof (webConfig === null || webConfig === void 0 ? void 0 : webConfig.deploy) === \"string\" ? webConfig.deploy : webConfig === null || webConfig === void 0 ? void 0 : (_webConfig_deploy = webConfig.deploy) === null || _webConfig_deploy === void 0 ? void 0 : _webConfig_deploy.target;\n var isCloudflareDeploy = deployTarget === \"cloudflare\";\n var shouldOutputCJS = getServerCJSSetting(options);\n var isUnified = typeof serverOptions === \"object\" && serverOptions !== null && serverOptions.unified === true;\n var serverBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [\n excludeAPIAndMiddlewareRoutesPlugin,\n ...globalThis.__vxrnAddWebPluginsProd\n ],\n define: {\n \"process.env.TAMAGUI_IS_SERVER\": '\"1\"',\n \"process.env.VITE_ENVIRONMENT\": '\"ssr\"',\n ...processEnvDefines,\n ...webBuildConfig.define\n },\n ssr: {\n ...isCloudflareDeploy && {\n target: \"webworker\"\n },\n noExternal: isUnified ? [\n \"react\",\n \"react-dom\"\n ] : true,\n optimizeDeps: optimizeDepsWithoutRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n build: {\n // we want one big file of css\n cssCodeSplit: false,\n ssr: true,\n sourcemap: false,\n outDir: `${outDir}/server`,\n rolldownOptions: {\n treeshake: true,\n // fixes some weird issues with optimizing tamagui and other packages\n // external: (id) => {\n // if (serverExternals.has(id)) return true\n // return false\n // // return /^@tamagui/.test(id)\n // },\n input: [\n \"virtual:one-entry\"\n ],\n output: {\n ...isCloudflareDeploy && {\n codeSplitting: true\n },\n ...shouldOutputCJS && {\n format: \"cjs\",\n entryFileNames: \"[name].cjs\"\n }\n }\n }\n }\n });\n if (rerouteNoExternalConfig) {\n serverBuildConfig.ssr.noExternal = true;\n }\n var serverEntry = getServerEntry(options, outDir);\n var serverOutput;\n var clientManifest;\n var serverBuildPromise;\n if (serverOptions !== false) {\n var _optionsIn_build;\n if (!clientBuildPromise) {\n console.info(`\n \\u{1F528} build server\n`);\n }\n var userServerConf = (_optionsIn_build = optionsIn.build) === null || _optionsIn_build === void 0 ? void 0 : _optionsIn_build.server;\n var userServerBuildConf = typeof userServerConf === \"boolean\" ? null : userServerConf === null || userServerConf === void 0 ? void 0 : userServerConf.config;\n serverBuildPromise = viteBuild(userServerBuildConf ? mergeConfig(serverBuildConfig, userServerBuildConf) : serverBuildConfig);\n }\n if (clientBuildPromise && serverBuildPromise) {\n var [clientResult, serverResult] = await Promise.all([\n clientBuildPromise,\n serverBuildPromise\n ]);\n clientOutput = clientResult.output;\n serverOutput = serverResult.output;\n } else if (clientBuildPromise) {\n var clientResult1 = await clientBuildPromise;\n clientOutput = clientResult1.output;\n } else if (serverBuildPromise) {\n var serverResult1 = await serverBuildPromise;\n serverOutput = serverResult1.output;\n }\n if (serverOptions !== false) {\n clientManifest = await FSExtra.readJSON(`${outDir}/client/.vite/manifest.json`);\n var old = await FSExtra.readFile(serverEntry, \"utf-8\");\n await FSExtra.writeFile(serverEntry, old.replace(`import { hydrate as hydrate$1, unmountComponentAtNode, render as render$1 } from \"react-dom\";`, \"\").replace(`import ReactDOM__default, { render as render$2, unmountComponentAtNode as unmountComponentAtNode$1, hydrate as hydrate$1 } from \"react-dom\";`, 'import ReactDOM__default from \"react-dom\";'));\n }\n return {\n outDir,\n processEnvDefines,\n options,\n buildArgs,\n serverEntry,\n clientOutput,\n serverOutput,\n serverBuildConfig,\n webBuildConfig,\n clientManifest\n };\n};\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,4BAA4B;CAC9B,cAAc,CAAC;CACf,OAAO;EACL,QAAQ;EACR,iBAAiB;GACf,WAAW;GACX,QAAQ,EACN,uBAAuB,MACzB;EACF;CACF;AACF;AACA,IAAI,QAAQ,eAAe,OAAO,WAAW;CAC3C,IAAI,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAClF,IAAI,oBAAoB;CACxB,IAAI,uBAAuB,qBAAqB,gBAAgB;CAChE,QAAQ,IAAI,cAAc;CAC1B,IAAI,CAAC,QAAQ,IAAI,UAAU;EACzB,QAAQ,IAAI,WAAW;CACzB,OAAO,IAAI,QAAQ,IAAI,aAAa,cAAc;EAChD,QAAQ,KAAK;8CAC6B,QAAQ,IAAI,SAAS;CAClE;CACC;CACA,IAAI,WAAW,qBAAqB,UAAU,aAAa,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB;CACxH,IAAI,CAAC,WAAW,SAAS,kBAAkB,MAAM,QAAQ,IAAI;EAC3D,UAAU;GACR,WAAW,CAAC;GACZ,WAAW,CAAC;GACZ,iBAAiB,CAAC;EACpB,IAAI,QAAQ,YAAY;EACxB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;EACrD,MAAM,QAAQ,UAAU,aAAa,IAAI,QAAQ,iGAAiG,EAAE,CAAC,CAAC,QAAQ,gJAAgJ,8CAA4C,CAAC;CAC7V;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"build.native.js","names":["viteBuild"],"sources":["exports/build.native.js"],"sourcesContent":["import FSExtra from \"fs-extra\";\nimport { rm } from \"fs/promises\";\nimport { sep } from \"path\";\nimport { loadConfigFromFile, mergeConfig, build as viteBuild } from \"vite\";\nimport { getBaseViteConfigWithPlugins } from \"../config/getBaseViteConfigWithPlugins\";\nimport { getOptimizeDeps } from \"../config/getOptimizeDeps\";\nimport { fillOptions } from \"../config/getOptionsFilled\";\nimport { mergeUserConfig } from \"../config/mergeUserConfig\";\nimport { getServerCJSSetting, getServerEntry } from \"../utils/getServerEntry\";\nimport { applyBuiltInPatches } from \"../utils/patches\";\nimport { loadEnv } from \"./loadEnv\";\nvar disableOptimizationConfig = {\n optimizeDeps: {},\n build: {\n minify: false,\n rolldownOptions: {\n treeshake: false,\n output: {\n minifyInternalExports: false\n }\n }\n }\n};\nvar build = async function build2(optionsIn) {\n var buildArgs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var _optionsIn_skipEnv, _ref;\n var _userViteConfig_build, _userViteConfig_ssr, _options_build, _webConfig_deploy;\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(`\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`);\n }\n var skipEnv = (_optionsIn_skipEnv = optionsIn.skipEnv) !== null && _optionsIn_skipEnv !== void 0 ? _optionsIn_skipEnv : false;\n var [envResult, options, userViteConfig] = await Promise.all([\n skipEnv ? {\n serverEnv: {},\n clientEnv: {},\n clientEnvDefine: {}\n } : loadEnv(\"production\"),\n fillOptions(optionsIn, {\n mode: \"prod\"\n }),\n loadConfigFromFile({\n command: \"build\",\n mode: \"prod\"\n }).then(function(_) {\n return _ === null || _ === void 0 ? void 0 : _.config;\n })\n ]);\n if (!process.env.ONE_SERVER_URL) {\n console.warn(`\\u26A0\\uFE0F No ONE_SERVER_URL environment set, set it in your .env to your target deploy URL`);\n }\n var processEnvDefines = Object.fromEntries(Object.entries(envResult.serverEnv).map(function(param) {\n var [key, value] = param;\n return [\n `process.env.${key}`,\n JSON.stringify(value)\n ];\n }));\n await applyBuiltInPatches(options).catch(function(err) {\n console.error(`\n \\u{1F97A} error applying built-in patches`, err);\n });\n var outDir = (_ref = userViteConfig === null || userViteConfig === void 0 ? void 0 : (_userViteConfig_build = userViteConfig.build) === null || _userViteConfig_build === void 0 ? void 0 : _userViteConfig_build.outDir) !== null && _ref !== void 0 ? _ref : \"dist\";\n var platform = buildArgs.platform;\n var isNativeBuild = platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\";\n var cleanDir = buildArgs.step === \"generate\" && !isNativeBuild ? `${outDir}/server` : outDir;\n await rm(cleanDir, {\n recursive: true,\n force: true\n });\n if (isNativeBuild) {\n var { buildBundle } = await import(\"../rn-commands/bundle/buildBundle\");\n return buildBundle(\n [],\n // only an entry the app named: without one the bundle starts at the\n // generated route entry, as the xcode bundle phase does. the filled\n // default (./src/entry-native.tsx) exists only in plain vxrn apps.\n {\n root: options.root,\n vxrnEntries: optionsIn.entries\n },\n {\n platform,\n bundleOutput: `${outDir}${sep}${platform}.js`,\n // every native build emits imported assets beside its bundle\n assetsDest: outDir,\n dev: false,\n entryFile: \"\",\n resetCache: true,\n resetGlobalCache: true,\n sourcemapUseAbsolutePath: true,\n verbose: false,\n unstableTransformProfile: \"default\"\n }\n );\n }\n var { optimizeDeps } = getOptimizeDeps(\"build\");\n var { rolldownOptions: optimizeDepsRolldownOptions, ...optimizeDepsWithoutRolldown } = optimizeDeps;\n var webBuildConfig = mergeConfig(await getBaseViteConfigWithPlugins({\n ...options,\n mode: \"production\"\n }), {\n plugins: globalThis.__vxrnAddWebPluginsProd,\n clearScreen: false,\n configFile: false,\n ...skipEnv && {\n envFile: false\n },\n // rolldownOptions goes on environments.client to avoid Vite compat-proxy bug\n optimizeDeps: optimizeDepsWithoutRolldown,\n environments: {\n client: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n logLevel: \"warn\",\n build: {\n rolldownOptions: {\n // react-native packages import native-only exports (codegenNativeComponent etc.)\n // from react-native, which is aliased to react-native-web on web. react-native-web\n // doesn't export these, so rolldown would error. shimMissingExports creates\n // undefined shims instead, matching esbuild's lenient behavior.\n shimMissingExports: true,\n onwarn(warning, defaultHandler) {\n if (warning.code === \"MODULE_LEVEL_DIRECTIVE\" && warning.message.includes(\"use client\")) {\n return;\n }\n if (warning.code === \"SOURCEMAP_ERROR\" && warning.message.includes(`Can't resolve original location of error.`)) {\n return;\n }\n if (warning.code === \"EVAL\") {\n warning.message = warning.message.replace(/(\\.+\\/){0,}node_modules/, \"node_modules\");\n }\n if (warning.code === \"INVALID_ANNOTATION\") {\n return;\n }\n defaultHandler(warning);\n }\n }\n }\n });\n var rerouteNoExternalConfig = (userViteConfig === null || userViteConfig === void 0 ? void 0 : (_userViteConfig_ssr = userViteConfig.ssr) === null || _userViteConfig_ssr === void 0 ? void 0 : _userViteConfig_ssr.noExternal) === true;\n if (rerouteNoExternalConfig) {\n delete userViteConfig.ssr.noExternal;\n }\n webBuildConfig = mergeUserConfig(optimizeDeps, webBuildConfig, userViteConfig);\n var excludeAPIAndMiddlewareRoutesPlugin = {\n enforce: \"pre\",\n name: \"omit-api-routes\",\n transform: {\n order: \"pre\",\n // both patterns as one rust-side filter, so only api/middleware files\n // cross into js instead of every module in the client bundle\n filter: {\n id: /(?:\\+api|_middleware)\\.tsx?$/\n },\n handler() {\n return ``;\n }\n }\n };\n var clientOutput;\n var clientBuildPromise;\n if (buildArgs.step !== \"generate\") {\n var _options_build1;\n var clientBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [\n excludeAPIAndMiddlewareRoutesPlugin\n ],\n define: {\n \"process.env.VITE_ENVIRONMENT\": '\"client\"',\n ...process.env.ONE_SERVER_URL && {\n \"process.env.ONE_SERVER_URL\": JSON.stringify(process.env.ONE_SERVER_URL)\n }\n },\n build: {\n ssrManifest: true,\n outDir: `${outDir}/client`,\n sourcemap: false,\n manifest: true,\n rolldownOptions: {\n input: [\n \"virtual:one-entry\"\n ]\n }\n }\n });\n if (process.env.VXRN_DISABLE_PROD_OPTIMIZATION) {\n clientBuildConfig = mergeConfig(clientBuildConfig, disableOptimizationConfig);\n }\n console.info(`\n \\u{1F528} build ${((_options_build1 = options.build) === null || _options_build1 === void 0 ? void 0 : _options_build1.server) !== false ? \"client + server\" : \"client\"}\n`);\n clientBuildPromise = viteBuild(clientBuildConfig);\n }\n var serverOptions = (_options_build = options.build) === null || _options_build === void 0 ? void 0 : _options_build.server;\n var webConfig = optionsIn.web;\n var deployTarget = typeof (webConfig === null || webConfig === void 0 ? void 0 : webConfig.deploy) === \"string\" ? webConfig.deploy : webConfig === null || webConfig === void 0 ? void 0 : (_webConfig_deploy = webConfig.deploy) === null || _webConfig_deploy === void 0 ? void 0 : _webConfig_deploy.target;\n var isCloudflareDeploy = deployTarget === \"cloudflare\";\n var shouldOutputCJS = getServerCJSSetting(options);\n var isUnified = typeof serverOptions === \"object\" && serverOptions !== null && serverOptions.unified === true;\n var serverBuildConfig = mergeConfig(webBuildConfig, {\n plugins: [\n excludeAPIAndMiddlewareRoutesPlugin,\n ...globalThis.__vxrnAddWebPluginsProd\n ],\n define: {\n \"process.env.TAMAGUI_IS_SERVER\": '\"1\"',\n \"process.env.VITE_ENVIRONMENT\": '\"ssr\"',\n ...processEnvDefines,\n ...webBuildConfig.define\n },\n ssr: {\n ...isCloudflareDeploy && {\n target: \"webworker\"\n },\n noExternal: isUnified ? [\n \"react\",\n \"react-dom\"\n ] : true,\n optimizeDeps: optimizeDepsWithoutRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: {\n rolldownOptions: optimizeDepsRolldownOptions\n }\n }\n },\n build: {\n // we want one big file of css\n cssCodeSplit: false,\n ssr: true,\n sourcemap: false,\n outDir: `${outDir}/server`,\n rolldownOptions: {\n treeshake: true,\n // fixes some weird issues with optimizing tamagui and other packages\n // external: (id) => {\n // if (serverExternals.has(id)) return true\n // return false\n // // return /^@tamagui/.test(id)\n // },\n input: [\n \"virtual:one-entry\"\n ],\n output: {\n ...isCloudflareDeploy && {\n codeSplitting: true\n },\n ...shouldOutputCJS && {\n format: \"cjs\",\n entryFileNames: \"[name].cjs\"\n }\n }\n }\n }\n });\n if (rerouteNoExternalConfig) {\n serverBuildConfig.ssr.noExternal = true;\n }\n var serverEntry = getServerEntry(options, outDir);\n var serverOutput;\n var clientManifest;\n var serverBuildPromise;\n if (serverOptions !== false) {\n var _optionsIn_build;\n if (!clientBuildPromise) {\n console.info(`\n \\u{1F528} build server\n`);\n }\n var userServerConf = (_optionsIn_build = optionsIn.build) === null || _optionsIn_build === void 0 ? void 0 : _optionsIn_build.server;\n var userServerBuildConf = typeof userServerConf === \"boolean\" ? null : userServerConf === null || userServerConf === void 0 ? void 0 : userServerConf.config;\n serverBuildPromise = viteBuild(userServerBuildConf ? mergeConfig(serverBuildConfig, userServerBuildConf) : serverBuildConfig);\n }\n if (clientBuildPromise && serverBuildPromise) {\n var [clientResult, serverResult] = await Promise.all([\n clientBuildPromise,\n serverBuildPromise\n ]);\n clientOutput = clientResult.output;\n serverOutput = serverResult.output;\n } else if (clientBuildPromise) {\n var clientResult1 = await clientBuildPromise;\n clientOutput = clientResult1.output;\n } else if (serverBuildPromise) {\n var serverResult1 = await serverBuildPromise;\n serverOutput = serverResult1.output;\n }\n if (serverOptions !== false) {\n clientManifest = await FSExtra.readJSON(`${outDir}/client/.vite/manifest.json`);\n var old = await FSExtra.readFile(serverEntry, \"utf-8\");\n await FSExtra.writeFile(serverEntry, old.replace(`import { hydrate as hydrate$1, unmountComponentAtNode, render as render$1 } from \"react-dom\";`, \"\").replace(`import ReactDOM__default, { render as render$2, unmountComponentAtNode as unmountComponentAtNode$1, hydrate as hydrate$1 } from \"react-dom\";`, 'import ReactDOM__default from \"react-dom\";'));\n }\n return {\n outDir,\n processEnvDefines,\n options,\n buildArgs,\n serverEntry,\n clientOutput,\n serverOutput,\n serverBuildConfig,\n webBuildConfig,\n clientManifest\n };\n};\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,4BAA4B;CAC9B,cAAc,CAAC;CACf,OAAO;EACL,QAAQ;EACR,iBAAiB;GACf,WAAW;GACX,QAAQ,EACN,uBAAuB,MACzB;EACF;CACF;AACF;AACA,IAAI,QAAQ,eAAe,OAAO,WAAW;CAC3C,IAAI,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAClF,IAAI,oBAAoB;CACxB,IAAI,uBAAuB,qBAAqB,gBAAgB;CAChE,QAAQ,IAAI,cAAc;CAC1B,IAAI,CAAC,QAAQ,IAAI,UAAU;EACzB,QAAQ,IAAI,WAAW;CACzB,OAAO,IAAI,QAAQ,IAAI,aAAa,cAAc;EAChD,QAAQ,KAAK;8CAC6B,QAAQ,IAAI,SAAS;CAClE;CACC;CACA,IAAI,WAAW,qBAAqB,UAAU,aAAa,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB;CACxH,IAAI,CAAC,WAAW,SAAS,kBAAkB,MAAM,QAAQ,IAAI;EAC3D,UAAU;GACR,WAAW,CAAC;GACZ,WAAW,CAAC;GACZ,iBAAiB,CAAC;EACpB,IAAI,QAAQ,YAAY;EACxB,YAAY,WAAW,EACrB,MAAM,OACR,CAAC;EACD,mBAAmB;GACjB,SAAS;GACT,MAAM;EACR,CAAC,CAAC,CAAC,KAAK,SAAS,GAAG;GAClB,OAAO,MAAM,QAAQ,MAAM,KAAK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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,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,aAAa,QAAQ;IACrB,MAAM,MAAM,KAAK,MAAM,QAAQ;IAC/B,IAAI,IAAI,QAAQ,WAAW,KAAK,GAAG;KACjC;IACF;IACA,MAAM,kBAAkB,EAAE,GAA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;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 built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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,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,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Q;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,SAA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AAQ,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.8",
|
|
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.8",
|
|
84
|
+
"@vxrn/debug": "2.13.8",
|
|
85
|
+
"@vxrn/query-string": "2.13.8",
|
|
86
|
+
"@vxrn/resolve": "2.13.8",
|
|
87
|
+
"@vxrn/url-parse": "2.13.8",
|
|
88
|
+
"@vxrn/utils": "2.13.8",
|
|
89
|
+
"@vxrn/vendor": "2.13.8",
|
|
90
|
+
"@vxrn/vite-flow": "2.13.8",
|
|
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.8"
|
|
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.8"
|
|
137
137
|
},
|
|
138
138
|
"peerDependenciesMeta": {
|
|
139
139
|
"@vxrn/vite-plugin-metro": {
|
|
140
140
|
"optional": true
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
"releaseSourceCommit": "
|
|
143
|
+
"releaseSourceCommit": "2a379b5922aff42ba8f245121e858ef29fb21e70",
|
|
144
144
|
"repository": {
|
|
145
145
|
"type": "git",
|
|
146
146
|
"url": "git+https://github.com/onejs/one.git",
|
package/src/exports/build.ts
CHANGED
|
@@ -221,13 +221,6 @@ export const build = async (optionsIn: VXRNOptions, buildArgs: BuildArgs = {}) =
|
|
|
221
221
|
manifest: true,
|
|
222
222
|
rolldownOptions: {
|
|
223
223
|
input: ['virtual:one-entry'],
|
|
224
|
-
|
|
225
|
-
output: {
|
|
226
|
-
codeSplitting: {
|
|
227
|
-
// merge tiny chunks to reduce HTTP requests and total chunk count
|
|
228
|
-
minSize: 42_000,
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
224
|
},
|
|
232
225
|
},
|
|
233
226
|
} satisfies UserConfig)
|
|
@@ -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":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAA;AAaxE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAmBtD,eAAO,MAAM,KAAK,cAAqB,WAAW,cAAa,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAA;AAaxE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAmBtD,eAAO,MAAM,KAAK,cAAqB,WAAW,cAAa,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgWvE,CAAA"}
|
|
@@ -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"}
|