@buoy-gg/shared-ui 7.0.21 → 7.0.22
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/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/utils/devServer.js +62 -0
- package/lib/commonjs/utils/index.js +13 -0
- package/lib/commonjs/utils/renderCaptureRegistry.js +32 -3
- package/lib/commonjs/utils/safeExpoRouter.js +27 -2
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/utils/devServer.js +58 -0
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/renderCaptureRegistry.js +32 -3
- package/lib/module/utils/safeExpoRouter.js +26 -2
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/devServer.d.ts +24 -0
- package/lib/typescript/commonjs/utils/devServer.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts +3 -2
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/renderCaptureRegistry.d.ts +52 -2
- package/lib/typescript/commonjs/utils/renderCaptureRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts +23 -0
- package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/devServer.d.ts +24 -0
- package/lib/typescript/module/utils/devServer.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts +3 -2
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/renderCaptureRegistry.d.ts +52 -2
- package/lib/typescript/module/utils/renderCaptureRegistry.d.ts.map +1 -1
- package/lib/typescript/module/utils/safeExpoRouter.d.ts +23 -0
- package/lib/typescript/module/utils/safeExpoRouter.d.ts.map +1 -1
- package/package.json +4 -4
- package/scripts/detect-safe-area.js +21 -0
|
@@ -7,7 +7,7 @@ exports.useNativeSafeAreaInsets = exports.safeAreaType = exports.hasSafeAreaPack
|
|
|
7
7
|
/**
|
|
8
8
|
* Auto-generated safe area implementation
|
|
9
9
|
* Detected: none
|
|
10
|
-
* Generated at: 2026-08-
|
|
10
|
+
* Generated at: 2026-08-18T00:32:52.026Z
|
|
11
11
|
*
|
|
12
12
|
* DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
|
|
13
13
|
*
|
package/lib/commonjs/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var _exportNames = {
|
|
|
39
39
|
scheduleReloadApp: true,
|
|
40
40
|
resolveReloadStrategy: true,
|
|
41
41
|
REMOTE_RELOAD_DELAY_MS: true,
|
|
42
|
+
getDevServerOrigin: true,
|
|
42
43
|
Subscribable: true,
|
|
43
44
|
subscriberCountNotifier: true,
|
|
44
45
|
subscribeToSubscriberCountChanges: true,
|
|
@@ -49,6 +50,7 @@ var _exportNames = {
|
|
|
49
50
|
useSafeGlobalSearchParams: true,
|
|
50
51
|
getSafeRouter: true,
|
|
51
52
|
getSafeCurrentPathname: true,
|
|
53
|
+
getSafeCurrentRoute: true,
|
|
52
54
|
isExpoRouterAvailable: true,
|
|
53
55
|
isPlainObjectUtil: true,
|
|
54
56
|
useSafeAreaInsets: true,
|
|
@@ -225,6 +227,12 @@ Object.defineProperty(exports, "getConstructorName", {
|
|
|
225
227
|
return _index3.getConstructorName;
|
|
226
228
|
}
|
|
227
229
|
});
|
|
230
|
+
Object.defineProperty(exports, "getDevServerOrigin", {
|
|
231
|
+
enumerable: true,
|
|
232
|
+
get: function () {
|
|
233
|
+
return _index3.getDevServerOrigin;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
228
236
|
Object.defineProperty(exports, "getDeviceInfo", {
|
|
229
237
|
enumerable: true,
|
|
230
238
|
get: function () {
|
|
@@ -249,6 +257,12 @@ Object.defineProperty(exports, "getSafeCurrentPathname", {
|
|
|
249
257
|
return _index3.getSafeCurrentPathname;
|
|
250
258
|
}
|
|
251
259
|
});
|
|
260
|
+
Object.defineProperty(exports, "getSafeCurrentRoute", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
get: function () {
|
|
263
|
+
return _index3.getSafeCurrentRoute;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
252
266
|
Object.defineProperty(exports, "getSafeRouter", {
|
|
253
267
|
enumerable: true,
|
|
254
268
|
get: function () {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDevServerOrigin = getDevServerOrigin;
|
|
7
|
+
/**
|
|
8
|
+
* devServer
|
|
9
|
+
*
|
|
10
|
+
* Origin of the Metro/Expo dev server that served this bundle, e.g.
|
|
11
|
+
* `http://192.168.1.20:8081`.
|
|
12
|
+
*
|
|
13
|
+
* Why a remote driver wants it: reloading the app normally runs IN the app
|
|
14
|
+
* (`DevSettings.reload()`), which is exactly what stops working when the app
|
|
15
|
+
* has crashed — a fatal render error unmounts the tree, so no JS action can be
|
|
16
|
+
* answered and the one command that would recover the app is unreachable. The
|
|
17
|
+
* dev server's message socket reloads through the NATIVE side instead (it is
|
|
18
|
+
* what the `r` key and the redbox's Reload button use), so a driver that knows
|
|
19
|
+
* this origin can recover an app that can no longer help itself.
|
|
20
|
+
*
|
|
21
|
+
* Reported once, while the app is healthy, so it is already known by the time
|
|
22
|
+
* it's needed.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const ORIGIN_RE = /^(https?:\/\/[^/]+)/;
|
|
26
|
+
|
|
27
|
+
/** Bundle URL this JS realm was loaded from, or null off React Native. */
|
|
28
|
+
function scriptURL() {
|
|
29
|
+
try {
|
|
30
|
+
// Requires stay lexically inside try{} so Metro treats them as optional —
|
|
31
|
+
// react-native-web has neither path and falls through to null.
|
|
32
|
+
const NativeSourceCode =
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
34
|
+
require("react-native/Libraries/NativeModules/specs/NativeSourceCode").default;
|
|
35
|
+
const url = NativeSourceCode?.getConstants?.().scriptURL;
|
|
36
|
+
if (url) return url;
|
|
37
|
+
} catch {
|
|
38
|
+
// RN internals moved, or old architecture — try NativeModules below.
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
42
|
+
const {
|
|
43
|
+
NativeModules
|
|
44
|
+
} = require("react-native");
|
|
45
|
+
const url = NativeModules?.SourceCode?.getConstants?.().scriptURL ?? NativeModules?.SourceCode?.scriptURL;
|
|
46
|
+
if (url) return url;
|
|
47
|
+
} catch {
|
|
48
|
+
// not React Native
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* `http://host:port` of the dev server, or null in production / on web (a
|
|
55
|
+
* release bundle's scriptURL is a `file://` path, which has no origin worth
|
|
56
|
+
* reporting).
|
|
57
|
+
*/
|
|
58
|
+
function getDevServerOrigin() {
|
|
59
|
+
const url = scriptURL();
|
|
60
|
+
if (!url || !/^https?:\/\//.test(url)) return null;
|
|
61
|
+
return url.match(ORIGIN_RE)?.[1] ?? null;
|
|
62
|
+
}
|
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "getConstructorName", {
|
|
|
57
57
|
return _typeHelpers.getConstructorName;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "getDevServerOrigin", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _devServer.getDevServerOrigin;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "getRenderCaptureProvider", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function () {
|
|
@@ -75,6 +81,12 @@ Object.defineProperty(exports, "getSafeCurrentPathname", {
|
|
|
75
81
|
return _safeExpoRouter.getSafeCurrentPathname;
|
|
76
82
|
}
|
|
77
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "getSafeCurrentRoute", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _safeExpoRouter.getSafeCurrentRoute;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
78
90
|
Object.defineProperty(exports, "getSafeRouter", {
|
|
79
91
|
enumerable: true,
|
|
80
92
|
get: function () {
|
|
@@ -291,6 +303,7 @@ var _renderCaptureRegistry = require("./renderCaptureRegistry.js");
|
|
|
291
303
|
var _stateSnapshotRegistry = require("./stateSnapshotRegistry.js");
|
|
292
304
|
var _minimalSuperJSON = require("./minimalSuperJSON.js");
|
|
293
305
|
var _reloadApp = require("./reloadApp.js");
|
|
306
|
+
var _devServer = require("./devServer.js");
|
|
294
307
|
var _subscribable = require("./subscribable.js");
|
|
295
308
|
var _subscriberCountNotifier = require("./subscriberCountNotifier.js");
|
|
296
309
|
var _safeExpoRouter = require("./safeExpoRouter.js");
|
|
@@ -15,16 +15,45 @@ exports.setRenderCaptureProvider = setRenderCaptureProvider;
|
|
|
15
15
|
* `installReaFpsGetter`.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Why a component rendered, counted across a capture window.
|
|
20
|
+
*
|
|
21
|
+
* The split between `props` and `propsUnstable` is the one that matters in
|
|
22
|
+
* practice. Both mean "my props changed", but they send you to different
|
|
23
|
+
* files: `props` is a genuine update (a value differs) and belongs to the
|
|
24
|
+
* component; `propsUnstable` means the values are equal and only the
|
|
25
|
+
* IDENTITY changed — a fresh arrow or object literal handed down by the
|
|
26
|
+
* parent every render — and the fix is always upstream. Reporting that as
|
|
27
|
+
* plain "props" is technically true and sends people into the wrong file,
|
|
28
|
+
* which is why it gets its own bucket.
|
|
29
|
+
*/
|
|
30
|
+
|
|
18
31
|
/** One component's aggregated renders across a capture window. */
|
|
19
32
|
|
|
20
33
|
/** Result of a capture window (one benchmark recording). */
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The provider lives on a global, NOT in module scope.
|
|
37
|
+
*
|
|
38
|
+
* Package managers routinely give each @buoy-gg/* package its own nested copy
|
|
39
|
+
* of shared-ui — observed in the wild with ten identical 7.0.21 copies and
|
|
40
|
+
* nothing hoisted, simply because shared-ui was nobody's direct dependency.
|
|
41
|
+
* Module-scoped state means highlight-updates registers into its copy and
|
|
42
|
+
* perf-monitor reads a different one, so capture silently produces nothing:
|
|
43
|
+
* no error, no warning, just `renderCommits: null` in every report.
|
|
44
|
+
*
|
|
45
|
+
* A global key survives duplicate module instances. Same reasoning as
|
|
46
|
+
* external-sync's crash-flush registry.
|
|
47
|
+
*/
|
|
48
|
+
const PROVIDER_KEY = "__buoyRenderCaptureProvider";
|
|
49
|
+
function providerHost() {
|
|
50
|
+
return globalThis;
|
|
51
|
+
}
|
|
23
52
|
|
|
24
53
|
/** Register (or clear with null) the active provider. Last registration wins. */
|
|
25
54
|
function setRenderCaptureProvider(p) {
|
|
26
|
-
|
|
55
|
+
providerHost()[PROVIDER_KEY] = p;
|
|
27
56
|
}
|
|
28
57
|
function getRenderCaptureProvider() {
|
|
29
|
-
return
|
|
58
|
+
return providerHost()[PROVIDER_KEY] ?? null;
|
|
30
59
|
}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getSafeCurrentPathname = getSafeCurrentPathname;
|
|
7
|
+
exports.getSafeCurrentRoute = getSafeCurrentRoute;
|
|
7
8
|
exports.getSafeRouter = getSafeRouter;
|
|
8
9
|
exports.isExpoRouterAvailable = isExpoRouterAvailable;
|
|
9
10
|
exports.useSafeGlobalSearchParams = useSafeGlobalSearchParams;
|
|
@@ -184,6 +185,7 @@ function getSafeRouter() {
|
|
|
184
185
|
// path the require throws and the imperative fallback simply disables (callers
|
|
185
186
|
// degrade to route-events history). expo-router's store exposes getRouteInfo(),
|
|
186
187
|
// which returns the live pathname even before any navigation is recorded.
|
|
188
|
+
|
|
187
189
|
let routerStore;
|
|
188
190
|
function getRouterStore() {
|
|
189
191
|
if (routerStore !== undefined) return routerStore;
|
|
@@ -205,12 +207,35 @@ function getRouterStore() {
|
|
|
205
207
|
* can't be reached.
|
|
206
208
|
*/
|
|
207
209
|
function getSafeCurrentPathname() {
|
|
210
|
+
return getSafeCurrentRoute()?.pathname ?? null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** A route location that can be re-visited later via {@link getSafeRouter}. */
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The current route as a re-visitable location, read imperatively from
|
|
217
|
+
* expo-router's store.
|
|
218
|
+
*
|
|
219
|
+
* Like {@link getSafeCurrentPathname} this works before any navigation has
|
|
220
|
+
* been recorded (cold start on the initial route), and returns null when
|
|
221
|
+
* expo-router isn't available or the store can't be reached.
|
|
222
|
+
*/
|
|
223
|
+
function getSafeCurrentRoute() {
|
|
208
224
|
if (!checkExpoRouterAvailability()) {
|
|
209
225
|
return null;
|
|
210
226
|
}
|
|
211
227
|
try {
|
|
212
|
-
const
|
|
213
|
-
|
|
228
|
+
const info = getRouterStore()?.getRouteInfo?.();
|
|
229
|
+
const pathname = info?.pathname;
|
|
230
|
+
if (typeof pathname !== "string" || pathname.length === 0) return null;
|
|
231
|
+
const withParams = info?.pathnameWithParams;
|
|
232
|
+
return {
|
|
233
|
+
pathname,
|
|
234
|
+
href: typeof withParams === "string" && withParams.length > 0 ? withParams : pathname,
|
|
235
|
+
...(Array.isArray(info?.segments) ? {
|
|
236
|
+
segments: info.segments
|
|
237
|
+
} : {})
|
|
238
|
+
};
|
|
214
239
|
} catch (error) {
|
|
215
240
|
return null;
|
|
216
241
|
}
|
package/lib/module/index.js
CHANGED
|
@@ -33,13 +33,15 @@ registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvid
|
|
|
33
33
|
superJsonSerialize, superJsonDeserialize,
|
|
34
34
|
// JS-bundle reload (core's `app` adapter + perf-monitor's batch runner)
|
|
35
35
|
reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS,
|
|
36
|
+
// Dev-server origin — how a remote driver recovers an app that crashed too
|
|
37
|
+
// hard to reload itself
|
|
38
|
+
getDevServerOrigin,
|
|
36
39
|
// Subscribable base class for self-managing listeners
|
|
37
40
|
Subscribable,
|
|
38
41
|
// Subscriber count notifier for cross-package notifications
|
|
39
42
|
subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange,
|
|
40
43
|
// Safe expo-router wrappers (falls back to no-ops on RN CLI)
|
|
41
|
-
useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable } from "./utils/index.js";
|
|
42
|
-
|
|
44
|
+
useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable } from "./utils/index.js";
|
|
43
45
|
// Also export formatting utils
|
|
44
46
|
export * from "./utils/formatting/index.js";
|
|
45
47
|
export * from "./utils/time/index.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* devServer
|
|
5
|
+
*
|
|
6
|
+
* Origin of the Metro/Expo dev server that served this bundle, e.g.
|
|
7
|
+
* `http://192.168.1.20:8081`.
|
|
8
|
+
*
|
|
9
|
+
* Why a remote driver wants it: reloading the app normally runs IN the app
|
|
10
|
+
* (`DevSettings.reload()`), which is exactly what stops working when the app
|
|
11
|
+
* has crashed — a fatal render error unmounts the tree, so no JS action can be
|
|
12
|
+
* answered and the one command that would recover the app is unreachable. The
|
|
13
|
+
* dev server's message socket reloads through the NATIVE side instead (it is
|
|
14
|
+
* what the `r` key and the redbox's Reload button use), so a driver that knows
|
|
15
|
+
* this origin can recover an app that can no longer help itself.
|
|
16
|
+
*
|
|
17
|
+
* Reported once, while the app is healthy, so it is already known by the time
|
|
18
|
+
* it's needed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const ORIGIN_RE = /^(https?:\/\/[^/]+)/;
|
|
22
|
+
|
|
23
|
+
/** Bundle URL this JS realm was loaded from, or null off React Native. */
|
|
24
|
+
function scriptURL() {
|
|
25
|
+
try {
|
|
26
|
+
// Requires stay lexically inside try{} so Metro treats them as optional —
|
|
27
|
+
// react-native-web has neither path and falls through to null.
|
|
28
|
+
const NativeSourceCode =
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
+
require("react-native/Libraries/NativeModules/specs/NativeSourceCode").default;
|
|
31
|
+
const url = NativeSourceCode?.getConstants?.().scriptURL;
|
|
32
|
+
if (url) return url;
|
|
33
|
+
} catch {
|
|
34
|
+
// RN internals moved, or old architecture — try NativeModules below.
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
38
|
+
const {
|
|
39
|
+
NativeModules
|
|
40
|
+
} = require("react-native");
|
|
41
|
+
const url = NativeModules?.SourceCode?.getConstants?.().scriptURL ?? NativeModules?.SourceCode?.scriptURL;
|
|
42
|
+
if (url) return url;
|
|
43
|
+
} catch {
|
|
44
|
+
// not React Native
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* `http://host:port` of the dev server, or null in production / on web (a
|
|
51
|
+
* release bundle's scriptURL is a `file://` path, which has no origin worth
|
|
52
|
+
* reporting).
|
|
53
|
+
*/
|
|
54
|
+
export function getDevServerOrigin() {
|
|
55
|
+
const url = scriptURL();
|
|
56
|
+
if (!url || !/^https?:\/\//.test(url)) return null;
|
|
57
|
+
return url.match(ORIGIN_RE)?.[1] ?? null;
|
|
58
|
+
}
|
|
@@ -12,6 +12,7 @@ export { setRenderCaptureProvider, getRenderCaptureProvider } from "./renderCapt
|
|
|
12
12
|
export { registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders } from "./stateSnapshotRegistry.js";
|
|
13
13
|
export { serialize as superJsonSerialize, deserialize as superJsonDeserialize } from "./minimalSuperJSON.js";
|
|
14
14
|
export { reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS } from "./reloadApp.js";
|
|
15
|
+
export { getDevServerOrigin } from "./devServer.js";
|
|
15
16
|
export { Subscribable } from "./subscribable.js";
|
|
16
17
|
export { subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange } from "./subscriberCountNotifier.js";
|
|
17
|
-
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable } from "./safeExpoRouter.js";
|
|
18
|
+
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable } from "./safeExpoRouter.js";
|
|
@@ -10,16 +10,45 @@
|
|
|
10
10
|
* `installReaFpsGetter`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Why a component rendered, counted across a capture window.
|
|
15
|
+
*
|
|
16
|
+
* The split between `props` and `propsUnstable` is the one that matters in
|
|
17
|
+
* practice. Both mean "my props changed", but they send you to different
|
|
18
|
+
* files: `props` is a genuine update (a value differs) and belongs to the
|
|
19
|
+
* component; `propsUnstable` means the values are equal and only the
|
|
20
|
+
* IDENTITY changed — a fresh arrow or object literal handed down by the
|
|
21
|
+
* parent every render — and the fix is always upstream. Reporting that as
|
|
22
|
+
* plain "props" is technically true and sends people into the wrong file,
|
|
23
|
+
* which is why it gets its own bucket.
|
|
24
|
+
*/
|
|
25
|
+
|
|
13
26
|
/** One component's aggregated renders across a capture window. */
|
|
14
27
|
|
|
15
28
|
/** Result of a capture window (one benchmark recording). */
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The provider lives on a global, NOT in module scope.
|
|
32
|
+
*
|
|
33
|
+
* Package managers routinely give each @buoy-gg/* package its own nested copy
|
|
34
|
+
* of shared-ui — observed in the wild with ten identical 7.0.21 copies and
|
|
35
|
+
* nothing hoisted, simply because shared-ui was nobody's direct dependency.
|
|
36
|
+
* Module-scoped state means highlight-updates registers into its copy and
|
|
37
|
+
* perf-monitor reads a different one, so capture silently produces nothing:
|
|
38
|
+
* no error, no warning, just `renderCommits: null` in every report.
|
|
39
|
+
*
|
|
40
|
+
* A global key survives duplicate module instances. Same reasoning as
|
|
41
|
+
* external-sync's crash-flush registry.
|
|
42
|
+
*/
|
|
43
|
+
const PROVIDER_KEY = "__buoyRenderCaptureProvider";
|
|
44
|
+
function providerHost() {
|
|
45
|
+
return globalThis;
|
|
46
|
+
}
|
|
18
47
|
|
|
19
48
|
/** Register (or clear with null) the active provider. Last registration wins. */
|
|
20
49
|
export function setRenderCaptureProvider(p) {
|
|
21
|
-
|
|
50
|
+
providerHost()[PROVIDER_KEY] = p;
|
|
22
51
|
}
|
|
23
52
|
export function getRenderCaptureProvider() {
|
|
24
|
-
return
|
|
53
|
+
return providerHost()[PROVIDER_KEY] ?? null;
|
|
25
54
|
}
|
|
@@ -174,6 +174,7 @@ export function getSafeRouter() {
|
|
|
174
174
|
// path the require throws and the imperative fallback simply disables (callers
|
|
175
175
|
// degrade to route-events history). expo-router's store exposes getRouteInfo(),
|
|
176
176
|
// which returns the live pathname even before any navigation is recorded.
|
|
177
|
+
|
|
177
178
|
let routerStore;
|
|
178
179
|
function getRouterStore() {
|
|
179
180
|
if (routerStore !== undefined) return routerStore;
|
|
@@ -195,12 +196,35 @@ function getRouterStore() {
|
|
|
195
196
|
* can't be reached.
|
|
196
197
|
*/
|
|
197
198
|
export function getSafeCurrentPathname() {
|
|
199
|
+
return getSafeCurrentRoute()?.pathname ?? null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** A route location that can be re-visited later via {@link getSafeRouter}. */
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The current route as a re-visitable location, read imperatively from
|
|
206
|
+
* expo-router's store.
|
|
207
|
+
*
|
|
208
|
+
* Like {@link getSafeCurrentPathname} this works before any navigation has
|
|
209
|
+
* been recorded (cold start on the initial route), and returns null when
|
|
210
|
+
* expo-router isn't available or the store can't be reached.
|
|
211
|
+
*/
|
|
212
|
+
export function getSafeCurrentRoute() {
|
|
198
213
|
if (!checkExpoRouterAvailability()) {
|
|
199
214
|
return null;
|
|
200
215
|
}
|
|
201
216
|
try {
|
|
202
|
-
const
|
|
203
|
-
|
|
217
|
+
const info = getRouterStore()?.getRouteInfo?.();
|
|
218
|
+
const pathname = info?.pathname;
|
|
219
|
+
if (typeof pathname !== "string" || pathname.length === 0) return null;
|
|
220
|
+
const withParams = info?.pathnameWithParams;
|
|
221
|
+
return {
|
|
222
|
+
pathname,
|
|
223
|
+
href: typeof withParams === "string" && withParams.length > 0 ? withParams : pathname,
|
|
224
|
+
...(Array.isArray(info?.segments) ? {
|
|
225
|
+
segments: info.segments
|
|
226
|
+
} : {})
|
|
227
|
+
};
|
|
204
228
|
} catch (error) {
|
|
205
229
|
return null;
|
|
206
230
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./ui";
|
|
2
2
|
export * from "./stores";
|
|
3
3
|
export * from "./sync/wireBudget";
|
|
4
|
-
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable, } from "./utils";
|
|
4
|
+
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, type RenderCauseCounts, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, getDevServerOrigin, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable, } from "./utils";
|
|
5
|
+
export type { SafeRouteLocation } from "./utils";
|
|
5
6
|
export * from "./utils/formatting";
|
|
6
7
|
export * from "./utils/time";
|
|
7
8
|
export { isPlainObject as isPlainObjectUtil } from "./utils/typeHelpers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAEL,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,EAEZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EAEV,kBAAkB,EAClB,uBAAuB,EAEvB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAEL,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,EAEZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,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E,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* devServer
|
|
3
|
+
*
|
|
4
|
+
* Origin of the Metro/Expo dev server that served this bundle, e.g.
|
|
5
|
+
* `http://192.168.1.20:8081`.
|
|
6
|
+
*
|
|
7
|
+
* Why a remote driver wants it: reloading the app normally runs IN the app
|
|
8
|
+
* (`DevSettings.reload()`), which is exactly what stops working when the app
|
|
9
|
+
* has crashed — a fatal render error unmounts the tree, so no JS action can be
|
|
10
|
+
* answered and the one command that would recover the app is unreachable. The
|
|
11
|
+
* dev server's message socket reloads through the NATIVE side instead (it is
|
|
12
|
+
* what the `r` key and the redbox's Reload button use), so a driver that knows
|
|
13
|
+
* this origin can recover an app that can no longer help itself.
|
|
14
|
+
*
|
|
15
|
+
* Reported once, while the app is healthy, so it is already known by the time
|
|
16
|
+
* it's needed.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* `http://host:port` of the dev server, or null in production / on web (a
|
|
20
|
+
* release bundle's scriptURL is a `file://` path, which has no origin worth
|
|
21
|
+
* reporting).
|
|
22
|
+
*/
|
|
23
|
+
export declare function getDevServerOrigin(): string | null;
|
|
24
|
+
//# sourceMappingURL=devServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../../../../src/utils/devServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA8BH;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAIlD"}
|
|
@@ -6,11 +6,12 @@ export { safeStringify } from "./safeStringify";
|
|
|
6
6
|
export { getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, } from "./typeHelpers";
|
|
7
7
|
export { parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, } from "./valueFormatting";
|
|
8
8
|
export { loadOptionalModule, getCachedOptionalModule } from "./loadOptionalModule";
|
|
9
|
-
export { setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, } from "./renderCaptureRegistry";
|
|
9
|
+
export { setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, type RenderCauseCounts, } from "./renderCaptureRegistry";
|
|
10
10
|
export { registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, } from "./stateSnapshotRegistry";
|
|
11
11
|
export { serialize as superJsonSerialize, deserialize as superJsonDeserialize, type SuperJSONResult, } from "./minimalSuperJSON";
|
|
12
12
|
export { reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, } from "./reloadApp";
|
|
13
|
+
export { getDevServerOrigin } from "./devServer";
|
|
13
14
|
export { Subscribable, type SubscribableListener } from "./subscribable";
|
|
14
15
|
export { subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, } from "./subscriberCountNotifier";
|
|
15
|
-
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable, } from "./safeExpoRouter";
|
|
16
|
+
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable, type SafeRouteLocation, } from "./safeExpoRouter";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,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* other — same optional-capability pattern as PerfMonitorController's
|
|
8
8
|
* `installReaFpsGetter`.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Why a component rendered, counted across a capture window.
|
|
12
|
+
*
|
|
13
|
+
* The split between `props` and `propsUnstable` is the one that matters in
|
|
14
|
+
* practice. Both mean "my props changed", but they send you to different
|
|
15
|
+
* files: `props` is a genuine update (a value differs) and belongs to the
|
|
16
|
+
* component; `propsUnstable` means the values are equal and only the
|
|
17
|
+
* IDENTITY changed — a fresh arrow or object literal handed down by the
|
|
18
|
+
* parent every render — and the fix is always upstream. Reporting that as
|
|
19
|
+
* plain "props" is technically true and sends people into the wrong file,
|
|
20
|
+
* which is why it gets its own bucket.
|
|
21
|
+
*/
|
|
22
|
+
export interface RenderCauseCounts {
|
|
23
|
+
/** First render — nothing to compare against. */
|
|
24
|
+
mount?: number;
|
|
25
|
+
/** Props changed and at least one VALUE differs. A real update. */
|
|
26
|
+
props?: number;
|
|
27
|
+
/** Props changed by identity only; every changed value is equivalent. */
|
|
28
|
+
propsUnstable?: number;
|
|
29
|
+
/** Own state/hooks changed (useState, useReducer, context read). */
|
|
30
|
+
hooks?: number;
|
|
31
|
+
/** Rendered with no change of its own — a parent cascade. */
|
|
32
|
+
parent?: number;
|
|
33
|
+
}
|
|
10
34
|
/** One component's aggregated renders across a capture window. */
|
|
11
35
|
export interface RenderCaptureTopComponent {
|
|
12
36
|
name: string;
|
|
@@ -18,6 +42,16 @@ export interface RenderCaptureTopComponent {
|
|
|
18
42
|
maxMs: number;
|
|
19
43
|
/** totalMs / renders. */
|
|
20
44
|
avgMs: number;
|
|
45
|
+
/** Why it rendered. Present whenever capture ran. */
|
|
46
|
+
causes?: RenderCauseCounts;
|
|
47
|
+
/**
|
|
48
|
+
* Prop keys most often seen changing. Detail tier — only populated when
|
|
49
|
+
* `captureRenderDetail` is on, because collecting key names allocates on
|
|
50
|
+
* every render.
|
|
51
|
+
*/
|
|
52
|
+
changedProps?: string[];
|
|
53
|
+
/** Nearest composite ancestor that rendered with it. Detail tier. */
|
|
54
|
+
parentName?: string;
|
|
21
55
|
}
|
|
22
56
|
/** Result of a capture window (one benchmark recording). */
|
|
23
57
|
export interface RenderCaptureSummary {
|
|
@@ -32,14 +66,30 @@ export interface RenderCaptureSummary {
|
|
|
32
66
|
capturedDurations: boolean;
|
|
33
67
|
/** Sum of all self durations in ms across the capture. */
|
|
34
68
|
totalRenderMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Renders that produced nothing new: parent cascades plus identity-only
|
|
71
|
+
* prop changes. Both are removable without changing behaviour, so this is
|
|
72
|
+
* the recoverable share of `totalRenders` — the number to lead with.
|
|
73
|
+
*/
|
|
74
|
+
wastedRenders?: number;
|
|
75
|
+
/** Cause totals across every component, including ones outside topComponents. */
|
|
76
|
+
causes?: RenderCauseCounts;
|
|
35
77
|
/** Heaviest components by total self duration, capped by the provider. */
|
|
36
78
|
topComponents: RenderCaptureTopComponent[];
|
|
37
79
|
}
|
|
38
80
|
export interface RenderCaptureProvider {
|
|
39
81
|
/** Whether capture can work right now (dev build, DevTools hook present). */
|
|
40
82
|
isSupported(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Begin a capture window. Resets any previous unclaimed data.
|
|
85
|
+
*
|
|
86
|
+
* `detail` opts into the allocating tier (changed prop keys, parent names).
|
|
87
|
+
* Causes and `wastedRenders` come back either way — older providers that
|
|
88
|
+
* ignore the argument simply return a summary without them.
|
|
89
|
+
*/
|
|
90
|
+
start(opts?: {
|
|
91
|
+
detail?: boolean;
|
|
92
|
+
}): void;
|
|
43
93
|
/** End the window and return the aggregate, or null if never started. */
|
|
44
94
|
stop(): RenderCaptureSummary | null;
|
|
45
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderCaptureRegistry.d.ts","sourceRoot":"","sources":["../../../../src/utils/renderCaptureRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"renderCaptureRegistry.d.ts","sourceRoot":"","sources":["../../../../src/utils/renderCaptureRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,0EAA0E;IAC1E,aAAa,EAAE,yBAAyB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,WAAW,IAAI,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACzC,yEAAyE;IACzE,IAAI,IAAI,oBAAoB,GAAG,IAAI,CAAC;IACpC;;;;;OAKG;IACH,mBAAmB,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CAC7C;AAyBD,iFAAiF;AACjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAE9E;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,GAAG,IAAI,CAEvE"}
|
|
@@ -22,5 +22,28 @@ export declare function getSafeRouter(): any;
|
|
|
22
22
|
* can't be reached.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getSafeCurrentPathname(): string | null;
|
|
25
|
+
/** A route location that can be re-visited later via {@link getSafeRouter}. */
|
|
26
|
+
export interface SafeRouteLocation {
|
|
27
|
+
/** Pathname with dynamic segments resolved, e.g. `/pokemon/25`. */
|
|
28
|
+
pathname: string;
|
|
29
|
+
/**
|
|
30
|
+
* What to actually navigate to: the pathname WITH its search params
|
|
31
|
+
* (`/pokemon/25?tab=stats`). Falls back to `pathname` on router builds that
|
|
32
|
+
* don't expose it. Non-serializable params passed imperatively through
|
|
33
|
+
* `navigate(path, params)` are NOT part of this — only the URL is.
|
|
34
|
+
*/
|
|
35
|
+
href: string;
|
|
36
|
+
/** Route segments, when the router exposes them (display only). */
|
|
37
|
+
segments?: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The current route as a re-visitable location, read imperatively from
|
|
41
|
+
* expo-router's store.
|
|
42
|
+
*
|
|
43
|
+
* Like {@link getSafeCurrentPathname} this works before any navigation has
|
|
44
|
+
* been recorded (cold start on the initial route), and returns null when
|
|
45
|
+
* expo-router isn't available or the store can't be reached.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getSafeCurrentRoute(): SafeRouteLocation | null;
|
|
25
48
|
export declare function isExpoRouterAvailable(): boolean;
|
|
26
49
|
//# sourceMappingURL=safeExpoRouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgHH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;
|
|
1
|
+
{"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgHH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAiCD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAEtD;AAED,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,GAAG,IAAI,CAoB9D;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./ui";
|
|
2
2
|
export * from "./stores";
|
|
3
3
|
export * from "./sync/wireBudget";
|
|
4
|
-
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable, } from "./utils";
|
|
4
|
+
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, type RenderCauseCounts, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, getDevServerOrigin, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable, } from "./utils";
|
|
5
|
+
export type { SafeRouteLocation } from "./utils";
|
|
5
6
|
export * from "./utils/formatting";
|
|
6
7
|
export * from "./utils/time";
|
|
7
8
|
export { isPlainObject as isPlainObjectUtil } from "./utils/typeHelpers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAEL,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,EAEZ,UA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MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,YAAY,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACtF,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG7E,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACjL,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* devServer
|
|
3
|
+
*
|
|
4
|
+
* Origin of the Metro/Expo dev server that served this bundle, e.g.
|
|
5
|
+
* `http://192.168.1.20:8081`.
|
|
6
|
+
*
|
|
7
|
+
* Why a remote driver wants it: reloading the app normally runs IN the app
|
|
8
|
+
* (`DevSettings.reload()`), which is exactly what stops working when the app
|
|
9
|
+
* has crashed — a fatal render error unmounts the tree, so no JS action can be
|
|
10
|
+
* answered and the one command that would recover the app is unreachable. The
|
|
11
|
+
* dev server's message socket reloads through the NATIVE side instead (it is
|
|
12
|
+
* what the `r` key and the redbox's Reload button use), so a driver that knows
|
|
13
|
+
* this origin can recover an app that can no longer help itself.
|
|
14
|
+
*
|
|
15
|
+
* Reported once, while the app is healthy, so it is already known by the time
|
|
16
|
+
* it's needed.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* `http://host:port` of the dev server, or null in production / on web (a
|
|
20
|
+
* release bundle's scriptURL is a `file://` path, which has no origin worth
|
|
21
|
+
* reporting).
|
|
22
|
+
*/
|
|
23
|
+
export declare function getDevServerOrigin(): string | null;
|
|
24
|
+
//# sourceMappingURL=devServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../../../../src/utils/devServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA8BH;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAIlD"}
|
|
@@ -6,11 +6,12 @@ export { safeStringify } from "./safeStringify";
|
|
|
6
6
|
export { getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, } from "./typeHelpers";
|
|
7
7
|
export { parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, } from "./valueFormatting";
|
|
8
8
|
export { loadOptionalModule, getCachedOptionalModule } from "./loadOptionalModule";
|
|
9
|
-
export { setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, } from "./renderCaptureRegistry";
|
|
9
|
+
export { setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, type RenderCauseCounts, } from "./renderCaptureRegistry";
|
|
10
10
|
export { registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, } from "./stateSnapshotRegistry";
|
|
11
11
|
export { serialize as superJsonSerialize, deserialize as superJsonDeserialize, type SuperJSONResult, } from "./minimalSuperJSON";
|
|
12
12
|
export { reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, } from "./reloadApp";
|
|
13
|
+
export { getDevServerOrigin } from "./devServer";
|
|
13
14
|
export { Subscribable, type SubscribableListener } from "./subscribable";
|
|
14
15
|
export { subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, } from "./subscriberCountNotifier";
|
|
15
|
-
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable, } from "./safeExpoRouter";
|
|
16
|
+
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable, type SafeRouteLocation, } from "./safeExpoRouter";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,iCAAiC,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,EACnC,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -7,6 +7,30 @@
|
|
|
7
7
|
* other — same optional-capability pattern as PerfMonitorController's
|
|
8
8
|
* `installReaFpsGetter`.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Why a component rendered, counted across a capture window.
|
|
12
|
+
*
|
|
13
|
+
* The split between `props` and `propsUnstable` is the one that matters in
|
|
14
|
+
* practice. Both mean "my props changed", but they send you to different
|
|
15
|
+
* files: `props` is a genuine update (a value differs) and belongs to the
|
|
16
|
+
* component; `propsUnstable` means the values are equal and only the
|
|
17
|
+
* IDENTITY changed — a fresh arrow or object literal handed down by the
|
|
18
|
+
* parent every render — and the fix is always upstream. Reporting that as
|
|
19
|
+
* plain "props" is technically true and sends people into the wrong file,
|
|
20
|
+
* which is why it gets its own bucket.
|
|
21
|
+
*/
|
|
22
|
+
export interface RenderCauseCounts {
|
|
23
|
+
/** First render — nothing to compare against. */
|
|
24
|
+
mount?: number;
|
|
25
|
+
/** Props changed and at least one VALUE differs. A real update. */
|
|
26
|
+
props?: number;
|
|
27
|
+
/** Props changed by identity only; every changed value is equivalent. */
|
|
28
|
+
propsUnstable?: number;
|
|
29
|
+
/** Own state/hooks changed (useState, useReducer, context read). */
|
|
30
|
+
hooks?: number;
|
|
31
|
+
/** Rendered with no change of its own — a parent cascade. */
|
|
32
|
+
parent?: number;
|
|
33
|
+
}
|
|
10
34
|
/** One component's aggregated renders across a capture window. */
|
|
11
35
|
export interface RenderCaptureTopComponent {
|
|
12
36
|
name: string;
|
|
@@ -18,6 +42,16 @@ export interface RenderCaptureTopComponent {
|
|
|
18
42
|
maxMs: number;
|
|
19
43
|
/** totalMs / renders. */
|
|
20
44
|
avgMs: number;
|
|
45
|
+
/** Why it rendered. Present whenever capture ran. */
|
|
46
|
+
causes?: RenderCauseCounts;
|
|
47
|
+
/**
|
|
48
|
+
* Prop keys most often seen changing. Detail tier — only populated when
|
|
49
|
+
* `captureRenderDetail` is on, because collecting key names allocates on
|
|
50
|
+
* every render.
|
|
51
|
+
*/
|
|
52
|
+
changedProps?: string[];
|
|
53
|
+
/** Nearest composite ancestor that rendered with it. Detail tier. */
|
|
54
|
+
parentName?: string;
|
|
21
55
|
}
|
|
22
56
|
/** Result of a capture window (one benchmark recording). */
|
|
23
57
|
export interface RenderCaptureSummary {
|
|
@@ -32,14 +66,30 @@ export interface RenderCaptureSummary {
|
|
|
32
66
|
capturedDurations: boolean;
|
|
33
67
|
/** Sum of all self durations in ms across the capture. */
|
|
34
68
|
totalRenderMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Renders that produced nothing new: parent cascades plus identity-only
|
|
71
|
+
* prop changes. Both are removable without changing behaviour, so this is
|
|
72
|
+
* the recoverable share of `totalRenders` — the number to lead with.
|
|
73
|
+
*/
|
|
74
|
+
wastedRenders?: number;
|
|
75
|
+
/** Cause totals across every component, including ones outside topComponents. */
|
|
76
|
+
causes?: RenderCauseCounts;
|
|
35
77
|
/** Heaviest components by total self duration, capped by the provider. */
|
|
36
78
|
topComponents: RenderCaptureTopComponent[];
|
|
37
79
|
}
|
|
38
80
|
export interface RenderCaptureProvider {
|
|
39
81
|
/** Whether capture can work right now (dev build, DevTools hook present). */
|
|
40
82
|
isSupported(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Begin a capture window. Resets any previous unclaimed data.
|
|
85
|
+
*
|
|
86
|
+
* `detail` opts into the allocating tier (changed prop keys, parent names).
|
|
87
|
+
* Causes and `wastedRenders` come back either way — older providers that
|
|
88
|
+
* ignore the argument simply return a summary without them.
|
|
89
|
+
*/
|
|
90
|
+
start(opts?: {
|
|
91
|
+
detail?: boolean;
|
|
92
|
+
}): void;
|
|
43
93
|
/** End the window and return the aggregate, or null if never started. */
|
|
44
94
|
stop(): RenderCaptureSummary | null;
|
|
45
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderCaptureRegistry.d.ts","sourceRoot":"","sources":["../../../../src/utils/renderCaptureRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"renderCaptureRegistry.d.ts","sourceRoot":"","sources":["../../../../src/utils/renderCaptureRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,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AE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAE9E;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,GAAG,IAAI,CAEvE"}
|
|
@@ -22,5 +22,28 @@ export declare function getSafeRouter(): any;
|
|
|
22
22
|
* can't be reached.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getSafeCurrentPathname(): string | null;
|
|
25
|
+
/** A route location that can be re-visited later via {@link getSafeRouter}. */
|
|
26
|
+
export interface SafeRouteLocation {
|
|
27
|
+
/** Pathname with dynamic segments resolved, e.g. `/pokemon/25`. */
|
|
28
|
+
pathname: string;
|
|
29
|
+
/**
|
|
30
|
+
* What to actually navigate to: the pathname WITH its search params
|
|
31
|
+
* (`/pokemon/25?tab=stats`). Falls back to `pathname` on router builds that
|
|
32
|
+
* don't expose it. Non-serializable params passed imperatively through
|
|
33
|
+
* `navigate(path, params)` are NOT part of this — only the URL is.
|
|
34
|
+
*/
|
|
35
|
+
href: string;
|
|
36
|
+
/** Route segments, when the router exposes them (display only). */
|
|
37
|
+
segments?: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The current route as a re-visitable location, read imperatively from
|
|
41
|
+
* expo-router's store.
|
|
42
|
+
*
|
|
43
|
+
* Like {@link getSafeCurrentPathname} this works before any navigation has
|
|
44
|
+
* been recorded (cold start on the initial route), and returns null when
|
|
45
|
+
* expo-router isn't available or the store can't be reached.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getSafeCurrentRoute(): SafeRouteLocation | null;
|
|
25
48
|
export declare function isExpoRouterAvailable(): boolean;
|
|
26
49
|
//# sourceMappingURL=safeExpoRouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgHH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;
|
|
1
|
+
{"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgHH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAiCD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAEtD;AAED,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,GAAG,IAAI,CAoB9D;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/shared-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.22",
|
|
4
4
|
"description": "Shared UI components, hooks, and utilities",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
],
|
|
137
137
|
"sideEffects": false,
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
139
|
+
"@buoy-gg/floating-tools-core": "^7.0.22"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
|
-
"@buoy-gg/license": "7.0.
|
|
142
|
+
"@buoy-gg/license": "7.0.22",
|
|
143
143
|
"@react-native-clipboard/clipboard": "*",
|
|
144
144
|
"expo-clipboard": "*",
|
|
145
145
|
"expo-file-system": "*",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"expo-clipboard": "~7.1.5",
|
|
168
168
|
"react-native-safe-area-context": "^5.6.2",
|
|
169
169
|
"typescript": "~5.8.3",
|
|
170
|
-
"@buoy-gg/license": "^7.0.
|
|
170
|
+
"@buoy-gg/license": "^7.0.22"
|
|
171
171
|
},
|
|
172
172
|
"react-native-builder-bob": {
|
|
173
173
|
"source": "src",
|
|
@@ -30,6 +30,27 @@ const OUTPUT_FILE = path.join(__dirname, "..", "src", "hooks", "safe-area-impl.t
|
|
|
30
30
|
// Check for explicit fallback override (used during publishing)
|
|
31
31
|
const forceFallback = process.env.REACT_BUOY_FALLBACK === "1";
|
|
32
32
|
|
|
33
|
+
// In the monorepo this file is CHECKED IN, so rewriting it on every postinstall
|
|
34
|
+
// dirtied the working tree with a change nobody made — which is how it ended up
|
|
35
|
+
// committed by accident twice (see `chore: regenerated safe-area state from
|
|
36
|
+
// release install` and the revert that followed).
|
|
37
|
+
//
|
|
38
|
+
// Skipping here is safe because the committed variant is what monorepo builds
|
|
39
|
+
// and the example apps want, and it costs nothing: the publish path below still
|
|
40
|
+
// regenerates. detect-clipboard.js already guards itself the same way.
|
|
41
|
+
//
|
|
42
|
+
// The `forceFallback` exemption is load-bearing — prepublishOnly runs this with
|
|
43
|
+
// REACT_BUOY_FALLBACK=1, and skipping THAT would publish the native variant,
|
|
44
|
+
// whose static `react-native-safe-area-context` import breaks every consumer
|
|
45
|
+
// that doesn't have the package. That is the exact failure this script exists
|
|
46
|
+
// to prevent.
|
|
47
|
+
if (!forceFallback && fs.existsSync(path.join(__dirname, "..", "src"))) {
|
|
48
|
+
console.log(
|
|
49
|
+
"[@buoy/shared-ui] Safe area: skipping postinstall (workspace mode — src/ is checked in)"
|
|
50
|
+
);
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
53
|
+
|
|
33
54
|
/**
|
|
34
55
|
* Find the monorepo/project root by looking for pnpm-workspace.yaml or package.json with workspaces
|
|
35
56
|
*/
|