vxrn 1.26.1 → 2.0.0-beta.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/patches/builtInDepPatches.mjs +23 -42
- package/dist/patches/builtInDepPatches.mjs.map +1 -1
- package/dist/patches/builtInDepPatches.native.js +23 -42
- package/dist/patches/builtInDepPatches.native.js.map +1 -1
- package/dist/plugins/reactNativeDevServer.mjs +15 -50
- package/dist/plugins/reactNativeDevServer.mjs.map +1 -1
- package/dist/plugins/reactNativeDevServer.native.js +17 -113
- package/dist/plugins/reactNativeDevServer.native.js.map +1 -1
- package/dist/utils/createNativeDevEngine.mjs +115 -59
- package/dist/utils/createNativeDevEngine.mjs.map +1 -1
- package/dist/utils/createNativeDevEngine.native.js +140 -79
- package/dist/utils/createNativeDevEngine.native.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.mjs +1 -3
- package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
- package/dist/utils/scanDepsToOptimize.native.js +1 -3
- package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
- package/expo-plugin.cjs +12 -6
- package/package.json +12 -12
- package/src/patches/builtInDepPatches.ts +24 -48
- package/src/plugins/reactNativeDevServer.ts +27 -67
- package/src/utils/createNativeDevEngine.ts +146 -82
- package/src/utils/scanDepsToOptimize.ts +0 -3
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
- package/types/plugins/reactNativeDevServer.d.ts.map +1 -1
- package/types/utils/createNativeDevEngine.d.ts +0 -1
- package/types/utils/createNativeDevEngine.d.ts.map +1 -1
- package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
|
@@ -13,9 +13,7 @@ const EXCLUDE_LIST = ["jsc-android", "react-shallow-renderer", "fsevents", "@swc
|
|
|
13
13
|
// not used by web anyway
|
|
14
14
|
// Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry
|
|
15
15
|
// /lib/module/Platform/Platform.web.js:132:20
|
|
16
|
-
"@shopify/react-native-skia",
|
|
17
|
-
// web breaks trying to scan deps
|
|
18
|
-
"react-native-bottom-tabs", "@react-native/virtualized-lists",
|
|
16
|
+
"@shopify/react-native-skia", "@react-native/virtualized-lists",
|
|
19
17
|
// Unexpected "typeof" in `node_modules/@react-native/virtualized-lists/index.js`
|
|
20
18
|
// Native only, we don't expect SSR to use these packages.
|
|
21
19
|
// Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createDebugger","FSExtra","path","dirname","extname","join","sep","debug","debugDetails","EXCLUDE_LIST","EXCLUDE_LIST_SET","Set","INCLUDE_LIST","INCLUDE_LIST_SET","rootOptions","scanDepsToOptimize","packageJsonPath","options","parentDepNames","proceededDeps","Map","pkgJsonContent","console","info","currentRoot","pkgJson","readPackageJsonSafe","deps","Object","keys","dependencies","hasReanimated","prebundleDeps","Promise","all","map","dep","includes","cachedResult","get","has","localPath","findDepPkgJsonPath","depPkgJsonPath","realpath","filter","depPkgJson","subDeps","shouldPreBundle","length","hasRequiredDep","peerDependencies","react","startsWith","depsToPreBundle","depPkgJsonExports","exports","definedExports","k","expData","imp","import","endsWith","match","replace","specialExports","n","mainExport","d","checkIfExportExists","unshift","result","JSON","stringify","set","flat","index","arr","indexOf","hasNativewind","Boolean","pathIn","paths","pathExists","readJson","e","error","dependent","root","possiblePkgJson","nextRoot","depName","peerDependenciesMeta","optional"],"sources":["../../src/utils/scanDepsToOptimize.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,cAAA,QAAsB;AAC/B,OAAOC,OAAA,MAAa;AACpB,OAAOC,IAAA,IAAQC,OAAA,EAASC,OAAA,EAASC,IAAA,EAAMC,GAAA,QAAW;AAElD,MAAM;EAAEC,KAAA;EAAOC;AAAa,IAAIR,cAAA,CAAe,yBAAyB;AASjE,MAAMS,YAAA,GAAe,CAC1B,eACA,0BAEA,YACA,aACA,0BACA,wBACA,iCACA,6BACA,8BACA,2BACA,4BACA,8BACA,6BACA,4BACA;AAAA;AAGA,OAEA,SAEA;AAAA;AAGA,aACA;AAAA;AAAA;AAAA;AAKA
|
|
1
|
+
{"version":3,"names":["createDebugger","FSExtra","path","dirname","extname","join","sep","debug","debugDetails","EXCLUDE_LIST","EXCLUDE_LIST_SET","Set","INCLUDE_LIST","INCLUDE_LIST_SET","rootOptions","scanDepsToOptimize","packageJsonPath","options","parentDepNames","proceededDeps","Map","pkgJsonContent","console","info","currentRoot","pkgJson","readPackageJsonSafe","deps","Object","keys","dependencies","hasReanimated","prebundleDeps","Promise","all","map","dep","includes","cachedResult","get","has","localPath","findDepPkgJsonPath","depPkgJsonPath","realpath","filter","depPkgJson","subDeps","shouldPreBundle","length","hasRequiredDep","peerDependencies","react","startsWith","depsToPreBundle","depPkgJsonExports","exports","definedExports","k","expData","imp","import","endsWith","match","replace","specialExports","n","mainExport","d","checkIfExportExists","unshift","result","JSON","stringify","set","flat","index","arr","indexOf","hasNativewind","Boolean","pathIn","paths","pathExists","readJson","e","error","dependent","root","possiblePkgJson","nextRoot","depName","peerDependenciesMeta","optional"],"sources":["../../src/utils/scanDepsToOptimize.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,cAAA,QAAsB;AAC/B,OAAOC,OAAA,MAAa;AACpB,OAAOC,IAAA,IAAQC,OAAA,EAASC,OAAA,EAASC,IAAA,EAAMC,GAAA,QAAW;AAElD,MAAM;EAAEC,KAAA;EAAOC;AAAa,IAAIR,cAAA,CAAe,yBAAyB;AASjE,MAAMS,YAAA,GAAe,CAC1B,eACA,0BAEA,YACA,aACA,0BACA,wBACA,iCACA,6BACA,8BACA,2BACA,4BACA,8BACA,6BACA,4BACA;AAAA;AAGA,OAEA,SAEA;AAAA;AAGA,aACA;AAAA;AAAA;AAAA;AAKA,8BAEA;AAAA;AAAA;AAAA;AAIA,yBACA,kBACA;AAAA;AAAA;AAAA;AAKA,QACA,2BACA,iBACA,cAEA,8BAC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O;IACxB,IAAI,MAAMjF,OAAA,CAAQkF,UAAA,CAAWjF,KAAI,GAAG;MAClC,OAAO;IACT;EACF;EACA,OAAO;AACT;AAEA,eAAewB,oBAAoBV,eAAA,EAAyB;EAC1D,IAAI;IACF,OAAO,MAAMf,OAAA,CAAQmF,QAAA,CAASpE,eAAe;EAC/C,SAASqE,CAAA,EAAG;IACV/D,OAAA,CAAQgE,KAAA,CACN,+DAA+DtE,eAAe,KAAKqE,CAAC,EACtF;IACA,OAAO,CAAC;EACV;AACF;AAEA,eAAsB3C,mBAAmBN,GAAA,EAAKmD,SAAA,EAAW;EACvD,IAAIC,IAAA,GAAOD,SAAA;EACX,OAAOC,IAAA,EAAM;IACX,MAAMC,eAAA,GAAkBvF,IAAA,CAAKG,IAAA,CAAKmF,IAAA,EAAM,gBAAgBpD,GAAA,EAAK,cAAc;IAE3E,IAAI,MAAMnC,OAAA,CAAQkF,UAAA,CAAWM,eAAe,GAAG;MAC7C,OAAOA,eAAA;IACT;IAEA,MAAMC,QAAA,GAAWxF,IAAA,CAAKC,OAAA,CAAQqF,IAAI;IAClC,IAAIE,QAAA,KAAaF,IAAA,EAAM;IACvBA,IAAA,GAAOE,QAAA;EACT;EAEApE,OAAA,CAAQgE,KAAA,CACN,wDAAwDlD,GAAG,8BAA8BmD,SAAS,EACpG;EAEA,OAAO;AACT;AAOA,SAASrC,eACPzB,OAAA,EACAkE,OAAA,EACA;EACA,OAAO,CAAC,EACNlE,OAAA,CAAQK,YAAA,GAAe6D,OAAO,KAC7BlE,OAAA,CAAQ0B,gBAAA,GAAmBwC,OAAO,KACjC,CAAClE,OAAA,CAAQmE,oBAAA,GAAuBD,OAAO,GAAGE,QAAA;AAEhD","ignoreList":[]}
|
|
@@ -13,9 +13,7 @@ var EXCLUDE_LIST = ["jsc-android", "react-shallow-renderer", "fsevents", "@swc/c
|
|
|
13
13
|
// not used by web anyway
|
|
14
14
|
// Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry
|
|
15
15
|
// /lib/module/Platform/Platform.web.js:132:20
|
|
16
|
-
"@shopify/react-native-skia",
|
|
17
|
-
// web breaks trying to scan deps
|
|
18
|
-
"react-native-bottom-tabs", "@react-native/virtualized-lists",
|
|
16
|
+
"@shopify/react-native-skia", "@react-native/virtualized-lists",
|
|
19
17
|
// Unexpected "typeof" in `node_modules/@react-native/virtualized-lists/index.js`
|
|
20
18
|
// Native only, we don't expect SSR to use these packages.
|
|
21
19
|
// Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createDebugger","FSExtra","path","dirname","extname","join","sep","debug","debugDetails","EXCLUDE_LIST","EXCLUDE_LIST_SET","Set","INCLUDE_LIST","INCLUDE_LIST_SET","rootOptions","scanDepsToOptimize","packageJsonPath","options","arguments","length","_pkgJson_dependencies","_pkgJson_dependencies1","parentDepNames","proceededDeps","Map","pkgJsonContent","console","info","currentRoot","pkgJson","readPackageJsonSafe","deps","Object","keys","dependencies","hasReanimated","prebundleDeps","Promise","all","map","dep","_depPkgJson_dependencies","_depPkgJson_peerDependencies","includes","cachedResult","get","has","localPath","findDepPkgJsonPath","depPkgJsonPath","realpath","filter","depPkgJson","subDeps","shouldPreBundle","hasRequiredDep","peerDependencies","react","startsWith","depsToPreBundle","depPkgJsonExports","exports","definedExports","k","expData","imp","import","endsWith","match","replace","specialExports","n","mainExport","d","checkIfExportExists","unshift","result","JSON","stringify","set","flat","index","arr","indexOf","hasNativewind","Boolean","pathIn","paths","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","path2","value","pathExists","err"],"sources":["../../src/utils/scanDepsToOptimize.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,cAAA,QAAsB;AAC/B,OAAOC,OAAA,MAAa;AACpB,OAAOC,IAAA,IAAQC,OAAA,EAASC,OAAA,EAASC,IAAA,EAAMC,GAAA,QAAW;AAElD;EAAMC,KAAE;EAAAC;AAAO,IAAaR,cAAI,0BAAe;AASxC,IAAAS,YAAM,IACX,eACA,0BAEA,YACA,aACA,0BACA,wBACA,iCACA,6BACA,8BACA,2BACA,4BACA,8BACA,6BACA,4BACA;AAAA;AAGA,OAEA,SAEA;AAAA;AAGA,aACA;AAAA;AAAA;AAAA;AAKA
|
|
1
|
+
{"version":3,"names":["createDebugger","FSExtra","path","dirname","extname","join","sep","debug","debugDetails","EXCLUDE_LIST","EXCLUDE_LIST_SET","Set","INCLUDE_LIST","INCLUDE_LIST_SET","rootOptions","scanDepsToOptimize","packageJsonPath","options","arguments","length","_pkgJson_dependencies","_pkgJson_dependencies1","parentDepNames","proceededDeps","Map","pkgJsonContent","console","info","currentRoot","pkgJson","readPackageJsonSafe","deps","Object","keys","dependencies","hasReanimated","prebundleDeps","Promise","all","map","dep","_depPkgJson_dependencies","_depPkgJson_peerDependencies","includes","cachedResult","get","has","localPath","findDepPkgJsonPath","depPkgJsonPath","realpath","filter","depPkgJson","subDeps","shouldPreBundle","hasRequiredDep","peerDependencies","react","startsWith","depsToPreBundle","depPkgJsonExports","exports","definedExports","k","expData","imp","import","endsWith","match","replace","specialExports","n","mainExport","d","checkIfExportExists","unshift","result","JSON","stringify","set","flat","index","arr","indexOf","hasNativewind","Boolean","pathIn","paths","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","path2","value","pathExists","err"],"sources":["../../src/utils/scanDepsToOptimize.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,cAAA,QAAsB;AAC/B,OAAOC,OAAA,MAAa;AACpB,OAAOC,IAAA,IAAQC,OAAA,EAASC,OAAA,EAASC,IAAA,EAAMC,GAAA,QAAW;AAElD;EAAMC,KAAE;EAAAC;AAAO,IAAaR,cAAI,0BAAe;AASxC,IAAAS,YAAM,IACX,eACA,0BAEA,YACA,aACA,0BACA,wBACA,iCACA,6BACA,8BACA,2BACA,4BACA,8BACA,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A,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;MACT,IAAAS,KAAA,GAAAH,KAAA,CAAAI,KAAA;MAEA,IAAQ,MAAAjG,OAAA,CAAAkG,UAAA,CAAAF,KAAA;QACN;MACF;IAEA;EACF,SAAAG,GAAA;IAOAX,iBAAS,GACP;IAGAC,cACE,GAAQU,GAAA;EAIZ","ignoreList":[]}
|
package/expo-plugin.cjs
CHANGED
|
@@ -385,6 +385,13 @@ function removeExpoDefaultsFromAppBuildGradle(appBuildGradleContents) {
|
|
|
385
385
|
// TODO: Get the content of this block from @react-native-community/template (for example, get https://registry.npmjs.org/@react-native-community/template/0.76.6, find the tarball, download it into a tmp dir, extract it, read template/android/app/build.gradle, parse out the react block) to ensure it stays up to date.
|
|
386
386
|
// Note that we need to add patches marked with [vxrn/one], not just copy the block from the template as is.
|
|
387
387
|
const ANDROID_APP_BUILD_GRADLE_REACT_BLOCK = `
|
|
388
|
+
def resolveNodePackage = { packageName ->
|
|
389
|
+
providers.exec {
|
|
390
|
+
workingDir(rootDir)
|
|
391
|
+
commandLine("node", "--print", "require.resolve('" + packageName + "')")
|
|
392
|
+
}.standardOutput.asText.get().trim()
|
|
393
|
+
}
|
|
394
|
+
|
|
388
395
|
react {
|
|
389
396
|
// [vxrn/one] the bundle command should find the entry file automatically,
|
|
390
397
|
// we are setting this to a file that will definitely exist to avoid
|
|
@@ -397,12 +404,11 @@ react {
|
|
|
397
404
|
/* Folders */
|
|
398
405
|
// The root of your project, i.e. where "package.json" lives. Default is '../..'
|
|
399
406
|
// root = file("../../")
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
// cliFile = file("../../node_modules/react-native/cli.js")
|
|
407
|
+
// [vxrn/one] resolve hoisted packages from the generated project instead of assuming
|
|
408
|
+
// the application has its own node_modules directory.
|
|
409
|
+
reactNativeDir = file(resolveNodePackage("react-native/package.json")).parentFile
|
|
410
|
+
codegenDir = file(resolveNodePackage("@react-native/codegen/package.json")).parentFile
|
|
411
|
+
cliFile = file(resolveNodePackage("react-native/cli.js"))
|
|
406
412
|
|
|
407
413
|
/* Variants */
|
|
408
414
|
// The list of variants to that are debuggable. For those we're going to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxrn",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.33.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
"@jridgewell/trace-mapping": "^0.3.25",
|
|
66
66
|
"@react-native/codegen": "^0.86.2",
|
|
67
67
|
"@react-native/dev-middleware": "^0.86.2",
|
|
68
|
-
"@vxrn/compiler": "
|
|
69
|
-
"@vxrn/debug": "
|
|
70
|
-
"@vxrn/query-string": "
|
|
71
|
-
"@vxrn/resolve": "
|
|
72
|
-
"@vxrn/safe-area": "
|
|
73
|
-
"@vxrn/url-parse": "
|
|
74
|
-
"@vxrn/utils": "
|
|
75
|
-
"@vxrn/vendor": "
|
|
76
|
-
"@vxrn/vite-flow": "
|
|
77
|
-
"@vxrn/vite-plugin-metro": "
|
|
68
|
+
"@vxrn/compiler": "2.0.0-beta.33.1",
|
|
69
|
+
"@vxrn/debug": "2.0.0-beta.33.1",
|
|
70
|
+
"@vxrn/query-string": "2.0.0-beta.33.1",
|
|
71
|
+
"@vxrn/resolve": "2.0.0-beta.33.1",
|
|
72
|
+
"@vxrn/safe-area": "2.0.0-beta.33.1",
|
|
73
|
+
"@vxrn/url-parse": "2.0.0-beta.33.1",
|
|
74
|
+
"@vxrn/utils": "2.0.0-beta.33.1",
|
|
75
|
+
"@vxrn/vendor": "2.0.0-beta.33.1",
|
|
76
|
+
"@vxrn/vite-flow": "2.0.0-beta.33.1",
|
|
77
|
+
"@vxrn/vite-plugin-metro": "2.0.0-beta.33.1",
|
|
78
78
|
"citty": "^0.1.6",
|
|
79
79
|
"dotenv": "^17.2.1",
|
|
80
80
|
"dotenv-expand": "^12.0.2",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"perfect-debounce": "^1.0.0",
|
|
96
96
|
"picocolors": "^1.0.0",
|
|
97
97
|
"pkg-types": "^1.0.3",
|
|
98
|
-
"rolldown": "^1.2.
|
|
98
|
+
"rolldown": "^1.2.8",
|
|
99
99
|
"semver": "^7.6.3",
|
|
100
100
|
"vite": "^8.2.2",
|
|
101
101
|
"ws": "^8.21.0"
|
|
@@ -268,36 +268,20 @@ ${contents}
|
|
|
268
268
|
},
|
|
269
269
|
},
|
|
270
270
|
|
|
271
|
-
// fix RNGH crash on RN 0.
|
|
271
|
+
// fix RNGH crash on RN 0.86+ new architecture
|
|
272
272
|
// getShadowNodeFromRef crashes when findHostInstance_DEPRECATED returns null
|
|
273
273
|
{
|
|
274
274
|
module: 'react-native-gesture-handler',
|
|
275
275
|
patchFiles: {
|
|
276
|
-
|
|
277
|
-
// exact unsafe line in all three targets, so the cap silently dropped the
|
|
278
|
-
// crash guard rather than retiring it. each replacement is a no-op when
|
|
279
|
-
// its target is absent, so an uncapped range retires itself.
|
|
280
|
-
version: '>=2.0.0',
|
|
276
|
+
version: '>=3.0.0',
|
|
281
277
|
|
|
282
278
|
'lib/module/getShadowNodeFromRef.js': (contents) => {
|
|
283
279
|
return contents?.replace(
|
|
284
|
-
`
|
|
285
|
-
`const hostInstance = findHostInstance_DEPRECATED(ref);
|
|
286
|
-
if (hostInstance === null || hostInstance === undefined) {
|
|
287
|
-
return null;
|
|
288
|
-
}
|
|
289
|
-
const internalHandle = getInternalInstanceHandleFromPublicInstance(hostInstance);
|
|
290
|
-
if (internalHandle === null || internalHandle === undefined) {
|
|
291
|
-
return null;
|
|
292
|
-
}
|
|
293
|
-
return internalHandle.stateNode?.node ?? null;`
|
|
294
|
-
)
|
|
295
|
-
},
|
|
280
|
+
`const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);
|
|
296
281
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
`
|
|
300
|
-
`const hostInstance = findHostInstance_DEPRECATED(ref);
|
|
282
|
+
// @ts-ignore Fabric
|
|
283
|
+
return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode.node;`,
|
|
284
|
+
`const hostInstance = isAlreadyHostInstance ? ref : findHostInstance_DEPRECATED(ref);
|
|
301
285
|
if (hostInstance === null || hostInstance === undefined) {
|
|
302
286
|
return null;
|
|
303
287
|
}
|
|
@@ -312,10 +296,16 @@ ${contents}
|
|
|
312
296
|
// metro uses src/ directly via "react-native" field in package.json
|
|
313
297
|
'src/getShadowNodeFromRef.ts': (contents) => {
|
|
314
298
|
return contents?.replace(
|
|
315
|
-
`
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
299
|
+
`const hostInstance = isAlreadyHostInstance
|
|
300
|
+
? ref
|
|
301
|
+
: findHostInstance_DEPRECATED(ref);
|
|
302
|
+
|
|
303
|
+
// @ts-ignore Fabric
|
|
304
|
+
return getInternalInstanceHandleFromPublicInstance(hostInstance).stateNode
|
|
305
|
+
.node;`,
|
|
306
|
+
`const hostInstance = isAlreadyHostInstance
|
|
307
|
+
? ref
|
|
308
|
+
: findHostInstance_DEPRECATED(ref);
|
|
319
309
|
if (hostInstance === null || hostInstance === undefined) {
|
|
320
310
|
return null;
|
|
321
311
|
}
|
|
@@ -507,10 +497,6 @@ install('URLSearchParams', () => URLSearchParams);
|
|
|
507
497
|
{
|
|
508
498
|
module: 'expo-video',
|
|
509
499
|
patchFiles: {
|
|
510
|
-
'build/index.js': (contents) => {
|
|
511
|
-
// bad type export that can't be auto-fixed
|
|
512
|
-
return contents?.replace(`export { VideoThumbnail } from './VideoThumbnail';`, ``)
|
|
513
|
-
},
|
|
514
500
|
'build/**/*.js': ['jsx'],
|
|
515
501
|
},
|
|
516
502
|
},
|
|
@@ -632,17 +618,13 @@ export const addCustomSourceTransformer = resolveAssetSource.addCustomSourceTran
|
|
|
632
618
|
},
|
|
633
619
|
|
|
634
620
|
// a void TurboModule method that throws an Obj-C NSException crashes the app
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
// single-threaded VM. only safe to build the JS error when the method runs
|
|
639
|
-
// sync (on the JS thread); otherwise log. mirrors the isSync guard added for
|
|
640
|
-
// value-returning methods in facebook/react-native#50193 (which never covered
|
|
641
|
-
// the void path). see tests/test/IOS_PROD_CRASH.md
|
|
621
|
+
// when React Native rethrows it on the TurboModule queue. there is no JS
|
|
622
|
+
// caller for an async void method to receive an error, so log it instead.
|
|
623
|
+
// see tests/test/IOS_PROD_CRASH.md
|
|
642
624
|
{
|
|
643
625
|
module: 'react-native',
|
|
644
626
|
patchFiles: {
|
|
645
|
-
version: '>=0.
|
|
627
|
+
version: '>=0.86.0',
|
|
646
628
|
|
|
647
629
|
'ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm': (
|
|
648
630
|
contents
|
|
@@ -652,20 +634,14 @@ export const addCustomSourceTransformer = resolveAssetSource.addCustomSourceTran
|
|
|
652
634
|
` @try {
|
|
653
635
|
[inv invokeWithTarget:strongModule];
|
|
654
636
|
} @catch (NSException *exception) {
|
|
655
|
-
|
|
637
|
+
// Void methods are always async, re-throw instead of converting to
|
|
638
|
+
// JSError, same as the async branch in performMethodInvocation.
|
|
639
|
+
@throw exception;
|
|
656
640
|
} @finally {`,
|
|
657
641
|
` @try {
|
|
658
642
|
[inv invokeWithTarget:strongModule];
|
|
659
643
|
} @catch (NSException *exception) {
|
|
660
|
-
|
|
661
|
-
// sync void methods run on the JS thread — safe to build the JS error.
|
|
662
|
-
throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
|
|
663
|
-
} else {
|
|
664
|
-
// async void methods run on the TurboModule method queue; building a JS
|
|
665
|
-
// error here touches the Hermes runtime off the JS thread and corrupts
|
|
666
|
-
// the VM (SIGSEGV). there is no JS caller to receive it, so log instead.
|
|
667
|
-
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
668
|
-
}
|
|
644
|
+
RCTLogError(@"Exception in %s.%s: %@", moduleName, methodNameStr.c_str(), exception.reason);
|
|
669
645
|
} @finally {`
|
|
670
646
|
)
|
|
671
647
|
},
|
|
@@ -83,6 +83,7 @@ export function createReactNativeDevServerPlugin(
|
|
|
83
83
|
> = {}
|
|
84
84
|
const devEngineCreating: Record<string, Promise<unknown> | null> = {}
|
|
85
85
|
const warnedProdBundleRequest = new Set<string>()
|
|
86
|
+
const pendingReloadPlatforms = new Set<'ios' | 'android'>()
|
|
86
87
|
|
|
87
88
|
const devToolsSocketEndpoints = ['/inspector/device', '/inspector/debug']
|
|
88
89
|
const reactNativeDevToolsUrl = `http://${host}:${getBoundPort(server)}`
|
|
@@ -210,6 +211,9 @@ export function createReactNativeDevServerPlugin(
|
|
|
210
211
|
return
|
|
211
212
|
}
|
|
212
213
|
addConnectedNativeClient()
|
|
214
|
+
if (pendingReloadPlatforms.has(socket.vxrnPlatform)) {
|
|
215
|
+
socket.send(JSON.stringify({ type: 'hmr:reload' }))
|
|
216
|
+
}
|
|
213
217
|
|
|
214
218
|
socket.on('message', (message) => {
|
|
215
219
|
const value = message.toString()
|
|
@@ -244,66 +248,6 @@ export function createReactNativeDevServerPlugin(
|
|
|
244
248
|
})
|
|
245
249
|
})
|
|
246
250
|
|
|
247
|
-
const reloadNativeClients = (platform: string) => {
|
|
248
|
-
const reload = JSON.stringify({ type: 'hmr:reload' })
|
|
249
|
-
hmrWSS.clients.forEach((client) => {
|
|
250
|
-
const nativeClient = client as NativeHmrSocket
|
|
251
|
-
if (nativeClient.readyState === 1 && nativeClient.vxrnPlatform === platform) {
|
|
252
|
-
nativeClient.send(reload)
|
|
253
|
-
}
|
|
254
|
-
})
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// a created route file: rolldown's addWatchFile on the route directories
|
|
258
|
-
// is supposed to report it, and the engine rebuilds only then. github's
|
|
259
|
-
// macos runners do not always surface that, so vite's watcher is the
|
|
260
|
-
// backup, still scoped to route files inside handleAddedFile.
|
|
261
|
-
//
|
|
262
|
-
// a deletion it cannot survive. rolldown's dev engine panics its worker
|
|
263
|
-
// when it retires a module that left the disk ("index out of bounds" out
|
|
264
|
-
// of oxc_index), and from then on every bundle request answers 500 even
|
|
265
|
-
// once the file comes back. that engine cannot be repaired, so drop it
|
|
266
|
-
// and let the next bundle request build a fresh one.
|
|
267
|
-
let deletionTimer: ReturnType<typeof setTimeout> | undefined
|
|
268
|
-
let addTimer: ReturnType<typeof setTimeout> | undefined
|
|
269
|
-
const addedFiles = new Set<string>()
|
|
270
|
-
server.watcher.on('add', (file) => {
|
|
271
|
-
if (file.split('/').some((segment) => segment.startsWith('.'))) return
|
|
272
|
-
addedFiles.add(file)
|
|
273
|
-
clearTimeout(addTimer)
|
|
274
|
-
addTimer = setTimeout(() => {
|
|
275
|
-
const files = [...addedFiles]
|
|
276
|
-
addedFiles.clear()
|
|
277
|
-
for (const platform of Object.keys(devEngines)) {
|
|
278
|
-
const devEngine = devEngines[platform]
|
|
279
|
-
if (!devEngine) continue
|
|
280
|
-
for (const added of files) {
|
|
281
|
-
devEngine.handleAddedFile(added).catch((error) => {
|
|
282
|
-
console.error(`[vxrn] handling added ${added} for ${platform} failed`, error)
|
|
283
|
-
})
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}, 50)
|
|
287
|
-
})
|
|
288
|
-
server.watcher.on('unlink', (file) => {
|
|
289
|
-
// vite's watcher already skips node_modules and .git. keep out the rest
|
|
290
|
-
// of what a dev server writes into a project while it runs: caches and
|
|
291
|
-
// build output under a dot directory, editor swap files.
|
|
292
|
-
if (file.split('/').some((segment) => segment.startsWith('.'))) return
|
|
293
|
-
// one pass for a burst (a branch switch, a generator, a rename)
|
|
294
|
-
clearTimeout(deletionTimer)
|
|
295
|
-
deletionTimer = setTimeout(() => {
|
|
296
|
-
for (const platform of Object.keys(devEngines)) {
|
|
297
|
-
const devEngine = devEngines[platform]
|
|
298
|
-
if (!devEngine) continue
|
|
299
|
-
devEngines[platform] = null
|
|
300
|
-
devEngineCreating[platform] = null
|
|
301
|
-
devEngine.close().catch(() => {})
|
|
302
|
-
reloadNativeClients(platform)
|
|
303
|
-
}
|
|
304
|
-
}, 500)
|
|
305
|
-
})
|
|
306
|
-
|
|
307
251
|
clientWSS.on('connection', (socket) => {
|
|
308
252
|
socket.on('message', (messageRaw) => {
|
|
309
253
|
const message = JSON.parse(messageRaw.toString()) as any as ClientMessage
|
|
@@ -335,10 +279,10 @@ export function createReactNativeDevServerPlugin(
|
|
|
335
279
|
})
|
|
336
280
|
|
|
337
281
|
const getDevEngine = async (platform: 'ios' | 'android') => {
|
|
338
|
-
|
|
282
|
+
while (!devEngines[platform]) {
|
|
339
283
|
// prevent duplicate creation from concurrent requests
|
|
340
284
|
if (!devEngineCreating[platform]) {
|
|
341
|
-
|
|
285
|
+
const creating = (async () => {
|
|
342
286
|
try {
|
|
343
287
|
console.info(`[vxrn] creating rolldown DevEngine for ${platform}...`)
|
|
344
288
|
devEngines[platform] = await createNativeDevEngine({
|
|
@@ -352,6 +296,12 @@ export function createReactNativeDevServerPlugin(
|
|
|
352
296
|
// an update with no clientId is for every client on the
|
|
353
297
|
// platform: an error, or a reload after a full rebuild
|
|
354
298
|
const target = 'clientId' in update ? update.clientId : undefined
|
|
299
|
+
if (update.type === 'hmr:reload' && !target) {
|
|
300
|
+
// keep this pending until the rebuilt bundle is served.
|
|
301
|
+
// a previous app instance can leave a live socket while
|
|
302
|
+
// its replacement is still mounting and connecting.
|
|
303
|
+
pendingReloadPlatforms.add(platform)
|
|
304
|
+
}
|
|
355
305
|
hmrWSS.clients.forEach((client) => {
|
|
356
306
|
const nativeClient = client as NativeHmrSocket
|
|
357
307
|
if (
|
|
@@ -365,12 +315,12 @@ export function createReactNativeDevServerPlugin(
|
|
|
365
315
|
},
|
|
366
316
|
})
|
|
367
317
|
console.info(`[vxrn] rolldown DevEngine ready for ${platform}`)
|
|
368
|
-
}
|
|
369
|
-
// clear so
|
|
318
|
+
} finally {
|
|
319
|
+
// clear so a failed creation can be retried.
|
|
370
320
|
devEngineCreating[platform] = null
|
|
371
|
-
throw err
|
|
372
321
|
}
|
|
373
322
|
})()
|
|
323
|
+
devEngineCreating[platform] = creating
|
|
374
324
|
}
|
|
375
325
|
await devEngineCreating[platform]
|
|
376
326
|
}
|
|
@@ -403,8 +353,18 @@ export function createReactNativeDevServerPlugin(
|
|
|
403
353
|
|
|
404
354
|
try {
|
|
405
355
|
const bundle = await (await getDevEngine(platform)).getBundle()
|
|
406
|
-
|
|
407
|
-
|
|
356
|
+
// a client that connects after this response starts from the current
|
|
357
|
+
// route map and does not need the pending reload intended for the
|
|
358
|
+
// previous runtime.
|
|
359
|
+
res.once('finish', () => pendingReloadPlatforms.delete(platform))
|
|
360
|
+
|
|
361
|
+
// a DevSettings reload requests this exact URL again. native URL
|
|
362
|
+
// loading may otherwise reuse the first response and restart the app
|
|
363
|
+
// on a route map from before a file was added or removed.
|
|
364
|
+
res.writeHead(200, {
|
|
365
|
+
'Cache-Control': 'no-store',
|
|
366
|
+
'Content-Type': 'text/javascript',
|
|
367
|
+
})
|
|
408
368
|
res.end(bundle.code)
|
|
409
369
|
} catch (err) {
|
|
410
370
|
console.error(` Error building React Native bundle`)
|