one 1.26.1 → 1.27.0
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.
|
@@ -29,16 +29,40 @@ __export(createApp_native_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(createApp_native_exports);
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
var import_react_native = require("react-native");
|
|
32
|
+
var import_react = require("react");
|
|
32
33
|
var import_polyfills_mobile = require("./polyfills-mobile.native.js");
|
|
33
34
|
var import_Root = require("./Root.native.js");
|
|
34
35
|
var import_setup = require("./setup.native.js");
|
|
35
36
|
import_react_native.LogBox.ignoreLogs([/Sending .* with no listeners registered/]);
|
|
36
37
|
function createApp(options) {
|
|
38
|
+
var routes = options.routes;
|
|
39
|
+
var routeVersion = 0;
|
|
40
|
+
var routeListeners = /* @__PURE__ */new Set();
|
|
41
|
+
var subscribeToRoutes = function (listener) {
|
|
42
|
+
routeListeners.add(listener);
|
|
43
|
+
return function () {
|
|
44
|
+
return routeListeners.delete(listener);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
var getRouteVersion = function () {
|
|
48
|
+
return routeVersion;
|
|
49
|
+
};
|
|
50
|
+
globalThis.__VXRN_UPDATE_NATIVE_ROUTES__ = function (nextRoutes) {
|
|
51
|
+
var _globalThis___vxrnresetState, _globalThis;
|
|
52
|
+
routes = nextRoutes;
|
|
53
|
+
globalThis["__vxrnVersion"] = (globalThis["__vxrnVersion"] || 0) + 1;
|
|
54
|
+
(_globalThis___vxrnresetState = (_globalThis = globalThis)["__vxrnresetState"]) === null || _globalThis___vxrnresetState === void 0 ? void 0 : _globalThis___vxrnresetState.call(_globalThis);
|
|
55
|
+
routeVersion++;
|
|
56
|
+
routeListeners.forEach(function (listener) {
|
|
57
|
+
return listener();
|
|
58
|
+
});
|
|
59
|
+
};
|
|
37
60
|
var App = function () {
|
|
61
|
+
(0, import_react.useSyncExternalStore)(subscribeToRoutes, getRouteVersion, getRouteVersion);
|
|
38
62
|
var contents = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Root.Root, {
|
|
39
63
|
isClient: true,
|
|
40
64
|
flags: options.flags,
|
|
41
|
-
routes
|
|
65
|
+
routes,
|
|
42
66
|
routerRoot: options.routerRoot,
|
|
43
67
|
linking: options.linking,
|
|
44
68
|
path: "/"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createApp_native_exports","__export","createApp","module","exports","__toCommonJS","import_jsx_runtime","require","import_react_native","import_polyfills_mobile","import_Root","import_setup","LogBox","ignoreLogs","options","App","contents","jsx","Root","isClient","flags","
|
|
1
|
+
{"version":3,"names":["createApp_native_exports","__export","createApp","module","exports","__toCommonJS","import_jsx_runtime","require","import_react_native","import_react","import_polyfills_mobile","import_Root","import_setup","LogBox","ignoreLogs","options","routes","routeVersion","routeListeners","Set","subscribeToRoutes","listener","add","delete","getRouteVersion","globalThis","__VXRN_UPDATE_NATIVE_ROUTES__","nextRoutes","_globalThis___vxrnresetState","_globalThis","call","forEach","App","useSyncExternalStore","contents","jsx","Root","isClient","flags","routerRoot","linking","path","AppRegistry","registerComponent","process","env","ONE_APP_NAME"],"sources":["../../src/createApp.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,wBAAA;AAAA,IAAAM,kBAAA,GAA4BC,OAAA;AAC5B,IAAAC,mBAAA,GAAoCD,OAAA;AAEpC,IAAAE,YAAA,GAAqCF,OAAA;AACrC,IAAAG,uBAAA,GAAOH,OAAA;AACP,IAAAI,WAAA,GAAqBJ,OAAA;AACrB,IAAAK,YAAA,GAAOL,OAAA;AAEPC,mBAAA,CAAAK,MAAA,CAAOC,UAAA,CAAW,CACd,0CACH;AACM,SAASZ,UAA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,CAAAkC,WAAA,CAAYC,iBAAA,CAAkB,QAAQ,YAAW;IAC7C,OAAOX,GAAA;EACX,CAAC;EACD,IAAIY,OAAA,CAAQC,GAAA,CAAIC,YAAA,EAAc;IAC1BtC,mBAAA,CAAAkC,WAAA,CAAYC,iBAAA,CAAkBC,OAAA,CAAQC,GAAA,CAAIC,YAAA,EAAc,YAAW;MAC/D,OAAOd,GAAA;IACX,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AppRegistry, LogBox } from "react-native";
|
|
3
|
+
import { useSyncExternalStore } from "react";
|
|
3
4
|
import "./polyfills-mobile.native.js";
|
|
4
5
|
import { Root } from "./Root.native.js";
|
|
5
6
|
import "./setup.native.js";
|
|
6
7
|
LogBox.ignoreLogs([/Sending .* with no listeners registered/]);
|
|
7
8
|
function createApp(options) {
|
|
9
|
+
var routes = options.routes;
|
|
10
|
+
var routeVersion = 0;
|
|
11
|
+
var routeListeners = /* @__PURE__ */new Set();
|
|
12
|
+
var subscribeToRoutes = function (listener) {
|
|
13
|
+
routeListeners.add(listener);
|
|
14
|
+
return function () {
|
|
15
|
+
return routeListeners.delete(listener);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
var getRouteVersion = function () {
|
|
19
|
+
return routeVersion;
|
|
20
|
+
};
|
|
21
|
+
globalThis.__VXRN_UPDATE_NATIVE_ROUTES__ = function (nextRoutes) {
|
|
22
|
+
var _globalThis___vxrnresetState, _globalThis;
|
|
23
|
+
routes = nextRoutes;
|
|
24
|
+
globalThis["__vxrnVersion"] = (globalThis["__vxrnVersion"] || 0) + 1;
|
|
25
|
+
(_globalThis___vxrnresetState = (_globalThis = globalThis)["__vxrnresetState"]) === null || _globalThis___vxrnresetState === void 0 ? void 0 : _globalThis___vxrnresetState.call(_globalThis);
|
|
26
|
+
routeVersion++;
|
|
27
|
+
routeListeners.forEach(function (listener) {
|
|
28
|
+
return listener();
|
|
29
|
+
});
|
|
30
|
+
};
|
|
8
31
|
var App = function () {
|
|
32
|
+
useSyncExternalStore(subscribeToRoutes, getRouteVersion, getRouteVersion);
|
|
9
33
|
var contents = /* @__PURE__ */_jsx(Root, {
|
|
10
34
|
isClient: true,
|
|
11
35
|
flags: options.flags,
|
|
12
|
-
routes
|
|
36
|
+
routes,
|
|
13
37
|
routerRoot: options.routerRoot,
|
|
14
38
|
linking: options.linking,
|
|
15
39
|
path: "/"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","AppRegistry","LogBox","Root","ignoreLogs","createApp","options","App","contents","isClient","flags","
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","AppRegistry","LogBox","useSyncExternalStore","Root","ignoreLogs","createApp","options","routes","routeVersion","routeListeners","Set","subscribeToRoutes","listener","add","delete","getRouteVersion","globalThis","__VXRN_UPDATE_NATIVE_ROUTES__","nextRoutes","_globalThis___vxrnresetState","_globalThis","call","forEach","App","contents","isClient","flags","routerRoot","linking","path","registerComponent","process","env","ONE_APP_NAME"],"sources":["../../src/createApp.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAOC,IAAA,QAAY;AAC5B,SAASC,WAAA,EAAaC,MAAA,QAAc;AAEpC,SAASC,oBAAA,QAA4B;AACrC,OAAO;AACP,SAASC,IAAA,QAAY;AACrB,OAAO;AAEPF,MAAA,CAAOG,UAAA,CAAW,CACd,0CACH;AACM,SAASC,UAAUC,OAAA,EAAS;EAC/B,IAAIC,MAAA,GAASD,OAAA,CAAQC,MAAA;EACrB,IAAIC,YAAA,GAAe;EACnB,IAAIC,cAAA,GAAiB,mBAAIC,GAAA,CAAI;EAC7B,IAAIC,iBAAA,GAAoB,SAAAA,CAASC,QAAA,EAAU;IACvCH,cAAA,CAAeI,GAAA,CAAID,QAAQ;IAC3B,OAAO,YAAW;MACd,OAAOH,cAAA,CAAeK,MAAA,CAAOF,QAAQ;IAC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"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"setup.mjs",
|
|
@@ -197,18 +197,18 @@
|
|
|
197
197
|
"@react-navigation/routers": "~7.6.4",
|
|
198
198
|
"@cloudflare/vite-plugin": "^1.33.1",
|
|
199
199
|
"@ungap/structured-clone": "^1.2.0",
|
|
200
|
-
"@vxrn/color-scheme": "1.
|
|
201
|
-
"@vxrn/compiler": "1.
|
|
202
|
-
"@vxrn/resolve": "1.
|
|
203
|
-
"@vxrn/tslib-lite": "1.
|
|
204
|
-
"@vxrn/use-isomorphic-layout-effect": "1.
|
|
205
|
-
"@vxrn/vite-plugin-metro": "1.
|
|
200
|
+
"@vxrn/color-scheme": "1.27.0",
|
|
201
|
+
"@vxrn/compiler": "1.27.0",
|
|
202
|
+
"@vxrn/resolve": "1.27.0",
|
|
203
|
+
"@vxrn/tslib-lite": "1.27.0",
|
|
204
|
+
"@vxrn/use-isomorphic-layout-effect": "1.27.0",
|
|
205
|
+
"@vxrn/vite-plugin-metro": "1.27.0",
|
|
206
206
|
"babel-dead-code-elimination": "1.0.10",
|
|
207
207
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
208
208
|
"babel-preset-expo": "~57.0.5",
|
|
209
209
|
"citty": "^0.1.6",
|
|
210
210
|
"core-js": "^3.38.1",
|
|
211
|
-
"create-vxrn": "1.
|
|
211
|
+
"create-vxrn": "1.27.0",
|
|
212
212
|
"escape-string-regexp": "^5.0.0",
|
|
213
213
|
"expo-linking": "~57.0.5",
|
|
214
214
|
"expo-modules-core": "~57.0.10",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"tsconfig-paths": "^4",
|
|
230
230
|
"use-latest-callback": "^0.2.3",
|
|
231
231
|
"vite": "^8.2.2",
|
|
232
|
-
"vxrn": "1.
|
|
232
|
+
"vxrn": "1.27.0",
|
|
233
233
|
"web-streams-polyfill": "^4.3.0",
|
|
234
234
|
"ws": "^8.21.0",
|
|
235
235
|
"xxhashjs": "^0.2.2"
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
"react-dom": "19.2.3",
|
|
295
295
|
"react-native": "0.86.2",
|
|
296
296
|
"react-test-renderer": "^19.2.0",
|
|
297
|
-
"rolldown": "^1.2.
|
|
297
|
+
"rolldown": "^1.2.8",
|
|
298
298
|
"sharp": "^0.35.4",
|
|
299
299
|
"typescript": "^5.7.3",
|
|
300
300
|
"vitest": "^4.1.0"
|
package/src/createApp.native.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AppRegistry, LogBox } from 'react-native' // This should be the first import as it might set up global variables that are needed for the other imports
|
|
2
|
+
import { useSyncExternalStore } from 'react'
|
|
2
3
|
import type { One } from './vite/types'
|
|
3
4
|
import './polyfills-mobile'
|
|
4
5
|
import { Root } from './Root'
|
|
@@ -9,12 +10,33 @@ import type { CreateAppProps } from './createApp'
|
|
|
9
10
|
LogBox.ignoreLogs([/Sending .* with no listeners registered/])
|
|
10
11
|
|
|
11
12
|
export function createApp(options: CreateAppProps): void {
|
|
13
|
+
let routes = options.routes
|
|
14
|
+
let routeVersion = 0
|
|
15
|
+
const routeListeners = new Set<() => void>()
|
|
16
|
+
const subscribeToRoutes = (listener: () => void) => {
|
|
17
|
+
routeListeners.add(listener)
|
|
18
|
+
return () => routeListeners.delete(listener)
|
|
19
|
+
}
|
|
20
|
+
const getRouteVersion = () => routeVersion
|
|
21
|
+
;(
|
|
22
|
+
globalThis as typeof globalThis & {
|
|
23
|
+
__VXRN_UPDATE_NATIVE_ROUTES__?: (nextRoutes: CreateAppProps['routes']) => void
|
|
24
|
+
}
|
|
25
|
+
).__VXRN_UPDATE_NATIVE_ROUTES__ = (nextRoutes) => {
|
|
26
|
+
routes = nextRoutes
|
|
27
|
+
globalThis['__vxrnVersion'] = (globalThis['__vxrnVersion'] || 0) + 1
|
|
28
|
+
globalThis['__vxrnresetState']?.()
|
|
29
|
+
routeVersion++
|
|
30
|
+
routeListeners.forEach((listener) => listener())
|
|
31
|
+
}
|
|
32
|
+
|
|
12
33
|
const App = () => {
|
|
34
|
+
useSyncExternalStore(subscribeToRoutes, getRouteVersion, getRouteVersion)
|
|
13
35
|
const contents = (
|
|
14
36
|
<Root
|
|
15
37
|
isClient
|
|
16
38
|
flags={options.flags}
|
|
17
|
-
routes={
|
|
39
|
+
routes={routes}
|
|
18
40
|
routerRoot={options.routerRoot}
|
|
19
41
|
linking={options.linking}
|
|
20
42
|
path="/"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.native.d.ts","sourceRoot":"","sources":["../src/createApp.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createApp.native.d.ts","sourceRoot":"","sources":["../src/createApp.native.tsx"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAKjD,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CA0CvD"}
|