vxrn 1.1.535 → 1.1.536
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/utils/expoRun.js +0 -6
- package/dist/utils/expoRun.js.map +1 -1
- package/dist/utils/expoRun.mjs +0 -2
- package/dist/utils/expoRun.mjs.map +1 -1
- package/dist/utils/expoRun.native.js +7 -9
- package/dist/utils/expoRun.native.js.map +1 -1
- package/expo-plugin.cjs +108 -1
- package/package.json +14 -14
- package/src/utils/expoRun.ts +0 -9
- package/types/utils/expoRun.d.ts.map +1 -1
package/dist/utils/expoRun.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
import { fillOptions } from "../config/getOptionsFilled";
|
|
3
3
|
import { applyBuiltInPatches } from "../utils/patches";
|
|
4
|
-
import picocolors from "picocolors";
|
|
5
4
|
async function expoRun({
|
|
6
5
|
root,
|
|
7
6
|
platform,
|
|
8
7
|
port
|
|
9
8
|
}) {
|
|
10
|
-
platform !== "ios" && console.warn(
|
|
11
|
-
picocolors.yellow(
|
|
12
|
-
`\u{1F6A7} The ${platform} platform is less tested and you might encounter unexpected errors. Let us know if anything breaks.`
|
|
13
|
-
)
|
|
14
|
-
);
|
|
15
9
|
const options = await fillOptions({ root });
|
|
16
10
|
applyBuiltInPatches(options).catch((err) => {
|
|
17
11
|
console.error(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/expoRun.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;
|
|
4
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AAEpC,eAAsB,QAAQ;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACF,GAAiE;AAC/D,QAAM,UAAU,MAAM,YAAY,EAAE,KAAK,CAAC;AAE1C,sBAAoB,OAAO,EAAE,MAAM,CAAC,QAAQ;AAC1C,YAAQ,MAAM;AAAA,6CAAyC,GAAG;AAAA,EAC5D,CAAC;AAED,MAAI;AAMF,UAAMA,YAAW,MAAM,OAJP,OAAO,cAAc,IAAI,EACd,QAAQ,2BAA2B,QAAQ,aAAa;AAAA,MACjF,OAAO,CAAC,IAAI;AAAA,IACd,CAAC,IAC0C,QACzC,UAAU,SAAS,OAAO,CAAC,EAAE,YAAY,IAAI,SAAS,MAAM,CAAC,CAAC,EAChE;AACA,UAAMA,SAAQ;AAAA;AAAA,MAEZ;AAAA;AAAA;AAAA;AAAA,IAIF,CAAC;AAAA,EACH,SAAS,GAAG;AACV,YAAQ,MAAM,iCAAiC,CAAC;AAAA,uCAA0C;AAAA,EAC5F;AACF;",
|
|
5
5
|
"names": ["expoRun"]
|
|
6
6
|
}
|
package/dist/utils/expoRun.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
import { fillOptions } from "../config/getOptionsFilled.mjs";
|
|
3
3
|
import { applyBuiltInPatches } from "../utils/patches.mjs";
|
|
4
|
-
import picocolors from "picocolors";
|
|
5
4
|
async function expoRun({
|
|
6
5
|
root,
|
|
7
6
|
platform,
|
|
8
7
|
port
|
|
9
8
|
}) {
|
|
10
|
-
platform !== "ios" && console.warn(picocolors.yellow(`\u{1F6A7} The ${platform} platform is less tested and you might encounter unexpected errors. Let us know if anything breaks.`));
|
|
11
9
|
const options = await fillOptions({
|
|
12
10
|
root
|
|
13
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["module","fillOptions","applyBuiltInPatches","
|
|
1
|
+
{"version":3,"names":["module","fillOptions","applyBuiltInPatches","expoRun","root","platform","port","options","catch","err","console","error","expoRun2","createRequire","resolve","paths","default","charAt","toUpperCase","slice","e"],"sources":["../../src/utils/expoRun.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,MAAA,MAAY;AACnB,SAASC,WAAA,QAAmB;AAC5B,SAASC,mBAAA,QAA2B;AAEpC,eAAsBC,QAAQ;EAC5BC,IAAA;EACAC,QAAA;EACAC;AACF,GAAiE;EAC/D,MAAMC,OAAA,GAAU,MAAMN,WAAA,CAAY;IAAEG;EAAK,CAAC;EAE1CF,mBAAA,CAAoBK,OAAO,EAAEC,KAAA,CAAOC,GAAA,IAAQ;IAC1CC,OAAA,CAAQC,KAAA,CAAM;AAAA,6CAAyCF,GAAG;EAC5D,CAAC;EAED,IAAI;IAMF,MAAMG,QAAA,IAAW,MAAM,OAJPZ,MAAA,CAAOa,aAAA,CAAcT,IAAI,EACdU,OAAA,CAAQ,2BAA2BT,QAAQ,aAAa;MACjFU,KAAA,EAAO,CAACX,IAAI;IACd,CAAC,IAC0CY,OAAA,CACzC,UAAUX,QAAA,CAASY,MAAA,CAAO,CAAC,EAAEC,WAAA,CAAY,IAAIb,QAAA,CAASc,KAAA,CAAM,CAAC,CAAC,EAChE;IACA,MAAMP,QAAA,CAAQ;IAAA;IAEZ;IAAA;IAAA;IAAA;IAAA,CAID;EACH,SAASQ,CAAA,EAAG;IACVV,OAAA,CAAQC,KAAA,CAAM,iCAAiCS,CAAC;AAAA,uCAA0C;EAC5F;AACF","ignoreList":[]}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import module from "node:module";
|
|
2
2
|
import { fillOptions } from "../config/getOptionsFilled.native.js";
|
|
3
3
|
import { applyBuiltInPatches } from "../utils/patches.native.js";
|
|
4
|
-
import picocolors from "picocolors";
|
|
5
4
|
async function expoRun(param) {
|
|
6
5
|
var {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
6
|
+
root,
|
|
7
|
+
platform,
|
|
8
|
+
port
|
|
9
|
+
} = param,
|
|
10
|
+
options = await fillOptions({
|
|
11
|
+
root
|
|
12
|
+
});
|
|
15
13
|
applyBuiltInPatches(options).catch(function (err) {
|
|
16
14
|
console.error(`
|
|
17
15
|
\u{1F97A} error applying built-in patches`, err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["module","fillOptions","applyBuiltInPatches","
|
|
1
|
+
{"version":3,"names":["module","fillOptions","applyBuiltInPatches","expoRun","param","root","platform","port","options","catch","err","console","error","require2","createRequire","importPath","resolve","paths","expoRun2","default","charAt","toUpperCase","slice","e"],"sources":["../../src/utils/expoRun.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,MAAA,MAAY;AACnB,SAASC,WAAA,QAAmB;AAC5B,SAASC,mBAAA,QAA2B;AAEpC,eAAsBC,QAAQC,KAAA;EAC5B;MAAAC,IAAA;MAAAC,QAAA;MAAAC;IAAA,IAAAH,KAAA;IAAAI,OAAA,SAAAP,WAAA;MACAI;IACA;EACFH,mBAAiE,CAAAM,OAAA,EAAAC,KAAA,WAAAC,GAAA;IAC/DC,OAAM,CAAAC,KAAA,CAAU;AAEhB,2CAAoC,EAAAF,GAAQ;EAC1C;EAAc;IACf,IAAAG,QAAA,GAAAb,MAAA,CAAAc,aAAA,CAAAT,IAAA;MAAAU,UAAA,GAAAF,QAAA,CAAAG,OAAA,4BAAAV,QAAA;QAEGW,KAAA,GAMFZ,IAAM;MADN,CAAC;MAAAa,QAC0C,GACzC,aAAU,CAAAH,UAAgB,CAAC,EAAEI,OAAA,WAAgBb,QAAS,CAAAc,MAAQ,EAChE,EAAAC,WAAA,KAAAf,QAAA,CAAAgB,KAAA;IACA,MAAMJ,QAAA,CAAQ;IAAA;IAEZ;EAAA,SAAAK,CAAA;IAAAZ,OAAA,CAAAC,KAAA,kCAAAW,CAAA;AAAA,uCAID;EACH;AACE;AAAgD,SAClDpB,OAAA","ignoreList":[]}
|
package/expo-plugin.cjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
withPlugins,
|
|
3
|
+
withXcodeProject,
|
|
4
|
+
withAppBuildGradle,
|
|
5
|
+
withMainActivity,
|
|
6
|
+
} = require('@expo/config-plugins')
|
|
2
7
|
|
|
3
8
|
const plugin = (config, options = {}) => {
|
|
4
9
|
return withPlugins(config, [
|
|
@@ -36,6 +41,13 @@ const plugin = (config, options = {}) => {
|
|
|
36
41
|
return config
|
|
37
42
|
},
|
|
38
43
|
],
|
|
44
|
+
[
|
|
45
|
+
withMainActivity,
|
|
46
|
+
async (config) => {
|
|
47
|
+
config.modResults.contents = addReactNativeScreensFix(config.modResults.contents)
|
|
48
|
+
return config
|
|
49
|
+
},
|
|
50
|
+
],
|
|
39
51
|
])
|
|
40
52
|
}
|
|
41
53
|
|
|
@@ -221,4 +233,99 @@ gradle.taskGraph.whenReady { taskGraph ->
|
|
|
221
233
|
)
|
|
222
234
|
}
|
|
223
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Add react-native-screens Android fix to prevent crashes on Activity restarts.
|
|
238
|
+
* This fix passes null to super.onCreate() to prevent Fragment restoration issues.
|
|
239
|
+
*
|
|
240
|
+
* On Android the View state is not persisted consistently across Activity restarts,
|
|
241
|
+
* which can lead to crashes. By passing null to onCreate, we discard any saved
|
|
242
|
+
* instance state that could cause Fragment restoration issues.
|
|
243
|
+
*
|
|
244
|
+
* This fix is required for react-native-screens and is integrated directly into vxrn
|
|
245
|
+
* since we depend on react-native-screens internally.
|
|
246
|
+
*
|
|
247
|
+
* Reference: https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
|
248
|
+
*/
|
|
249
|
+
function addReactNativeScreensFix(input) {
|
|
250
|
+
console.info(`🔨 Ensuring react-native-screens android fix`, input)
|
|
251
|
+
|
|
252
|
+
// Determine if this is Kotlin or Java
|
|
253
|
+
const isKotlin = input.includes('.kt') || input.includes('class MainActivity : ReactActivity()')
|
|
254
|
+
|
|
255
|
+
// Check if the fix is already applied
|
|
256
|
+
if (input.includes('super.onCreate(null)')) {
|
|
257
|
+
console.info('ℹ️ Fragment crash fix already applied (super.onCreate(null))')
|
|
258
|
+
return input
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (isKotlin) {
|
|
262
|
+
// Kotlin version - replace existing super.onCreate or add new method
|
|
263
|
+
if (input.includes('super.onCreate(savedInstanceState)')) {
|
|
264
|
+
input = input.replace(
|
|
265
|
+
/super\.onCreate\(savedInstanceState\)/g,
|
|
266
|
+
`// Fragment crash fix: Pass null to onCreate to prevent Fragment restoration issues
|
|
267
|
+
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
|
268
|
+
super.onCreate(null)`
|
|
269
|
+
)
|
|
270
|
+
console.info('✅ Applied Fragment crash fix to MainActivity.kt (super.onCreate(null))')
|
|
271
|
+
} else if (!input.includes('onCreate')) {
|
|
272
|
+
// Need to add onCreate method for Kotlin
|
|
273
|
+
const classMatch = input.match(/class\s+MainActivity\s*:\s*ReactActivity\(\)\s*\{/)
|
|
274
|
+
if (classMatch) {
|
|
275
|
+
const classDeclarationEnd = input.indexOf('{', classMatch.index) + 1
|
|
276
|
+
|
|
277
|
+
const onCreateMethod = `
|
|
278
|
+
|
|
279
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
280
|
+
// Fragment crash fix: Pass null to onCreate to prevent Fragment restoration issues
|
|
281
|
+
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
|
282
|
+
super.onCreate(null)
|
|
283
|
+
}`
|
|
284
|
+
|
|
285
|
+
input =
|
|
286
|
+
input.slice(0, classDeclarationEnd) + onCreateMethod + input.slice(classDeclarationEnd)
|
|
287
|
+
console.info('✅ Added onCreate with Fragment crash fix to MainActivity.kt')
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
// Java version - replace existing super.onCreate or add new method
|
|
292
|
+
if (input.includes('super.onCreate(savedInstanceState)')) {
|
|
293
|
+
input = input.replace(
|
|
294
|
+
/super\.onCreate\(savedInstanceState\)/g,
|
|
295
|
+
`// Fragment crash fix: Pass null to onCreate to prevent Fragment restoration issues
|
|
296
|
+
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
|
297
|
+
super.onCreate(null)`
|
|
298
|
+
)
|
|
299
|
+
console.info('✅ Applied Fragment crash fix to MainActivity.java (super.onCreate(null))')
|
|
300
|
+
} else if (!input.includes('onCreate')) {
|
|
301
|
+
// Need to add onCreate method for Java
|
|
302
|
+
// First add Bundle import if needed
|
|
303
|
+
if (!input.includes('import android.os.Bundle;')) {
|
|
304
|
+
input = input.replace(/package\s+[\w.]+;/, '$&\nimport android.os.Bundle;')
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const classMatch = input.match(/public\s+class\s+MainActivity\s+extends\s+ReactActivity\s*\{/)
|
|
308
|
+
if (classMatch) {
|
|
309
|
+
const classDeclarationEnd = input.indexOf('{', classMatch.index) + 1
|
|
310
|
+
|
|
311
|
+
const onCreateMethod = `
|
|
312
|
+
|
|
313
|
+
@Override
|
|
314
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
315
|
+
// Fragment crash fix: Pass null to onCreate to prevent Fragment restoration issues
|
|
316
|
+
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
|
317
|
+
super.onCreate(null);
|
|
318
|
+
}`
|
|
319
|
+
|
|
320
|
+
input =
|
|
321
|
+
input.slice(0, classDeclarationEnd) + onCreateMethod + input.slice(classDeclarationEnd)
|
|
322
|
+
console.info('✅ Added onCreate with Fragment crash fix to MainActivity.java')
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return input
|
|
328
|
+
}
|
|
329
|
+
|
|
224
330
|
module.exports = plugin
|
|
331
|
+
module.exports.addReactNativeScreensFix = addReactNativeScreensFix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxrn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.536",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"@hono/node-server": "^1.13.7",
|
|
66
66
|
"@react-native/dev-middleware": "^0.76.5",
|
|
67
67
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
68
|
-
"@vxrn/compiler": "1.1.
|
|
69
|
-
"@vxrn/debug": "1.1.
|
|
70
|
-
"@vxrn/query-string": "1.1.
|
|
71
|
-
"@vxrn/react-native-prebuilt": "1.1.
|
|
72
|
-
"@vxrn/resolve": "1.1.
|
|
73
|
-
"@vxrn/safe-area": "1.1.
|
|
74
|
-
"@vxrn/url-parse": "1.1.
|
|
75
|
-
"@vxrn/utils": "1.1.
|
|
76
|
-
"@vxrn/vendor": "1.1.
|
|
77
|
-
"@vxrn/vite-flow": "1.1.
|
|
78
|
-
"@vxrn/vite-plugin-metro": "1.1.
|
|
68
|
+
"@vxrn/compiler": "1.1.536",
|
|
69
|
+
"@vxrn/debug": "1.1.536",
|
|
70
|
+
"@vxrn/query-string": "1.1.536",
|
|
71
|
+
"@vxrn/react-native-prebuilt": "1.1.536",
|
|
72
|
+
"@vxrn/resolve": "1.1.536",
|
|
73
|
+
"@vxrn/safe-area": "1.1.536",
|
|
74
|
+
"@vxrn/url-parse": "1.1.536",
|
|
75
|
+
"@vxrn/utils": "1.1.536",
|
|
76
|
+
"@vxrn/vendor": "1.1.536",
|
|
77
|
+
"@vxrn/vite-flow": "1.1.536",
|
|
78
|
+
"@vxrn/vite-plugin-metro": "1.1.536",
|
|
79
79
|
"citty": "^0.1.6",
|
|
80
80
|
"dotenv": "^17.2.1",
|
|
81
81
|
"dotenv-expand": "^12.0.2",
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
"qrcode-terminal": "^0.12.0",
|
|
95
95
|
"rollup": "^4.29.1",
|
|
96
96
|
"semver": "^7.6.3",
|
|
97
|
-
"vite": "^7.
|
|
98
|
-
"vite-bundle-analyzer": "^
|
|
97
|
+
"vite": "^7.1.12",
|
|
98
|
+
"vite-bundle-analyzer": "^1.2.3",
|
|
99
99
|
"ws": "^8.18.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
package/src/utils/expoRun.ts
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import module from 'node:module'
|
|
2
2
|
import { fillOptions } from '../config/getOptionsFilled'
|
|
3
3
|
import { applyBuiltInPatches } from '../utils/patches'
|
|
4
|
-
import picocolors from 'picocolors'
|
|
5
4
|
|
|
6
5
|
export async function expoRun({
|
|
7
6
|
root,
|
|
8
7
|
platform,
|
|
9
8
|
port,
|
|
10
9
|
}: { root: string; platform: 'ios' | 'android'; port?: number }) {
|
|
11
|
-
if (platform !== 'ios') {
|
|
12
|
-
console.warn(
|
|
13
|
-
picocolors.yellow(
|
|
14
|
-
`🚧 The ${platform} platform is less tested and you might encounter unexpected errors. Let us know if anything breaks.`
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
10
|
const options = await fillOptions({ root })
|
|
20
11
|
|
|
21
12
|
applyBuiltInPatches(options).catch((err) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoRun.d.ts","sourceRoot":"","sources":["../../src/utils/expoRun.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expoRun.d.ts","sourceRoot":"","sources":["../../src/utils/expoRun.ts"],"names":[],"mappings":"AAIA,wBAAsB,OAAO,CAAC,EAC5B,IAAI,EACJ,QAAQ,EACR,IAAI,GACL,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,iBA0B9D"}
|