@buoy-gg/route-events 7.0.18 → 7.0.19

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.
@@ -20,38 +20,9 @@ const PARAMS_ON_DEVICE = Object.freeze({
20
20
  __buoyOmitted: "route-params",
21
21
  note: "Navigation params stay on the device."
22
22
  });
23
- function jsonLongerThan(value, limit) {
24
- let bytes = 0;
25
- const stack = [value];
26
- const seen = new Set();
27
- while (stack.length > 0) {
28
- if (bytes > limit) return true;
29
- const v = stack.pop();
30
- if (v === null || v === undefined) bytes += 4;else if (typeof v === "string") bytes += v.length + 2;else if (typeof v === "number") bytes += 8;else if (typeof v === "boolean") bytes += 5;else if (typeof v === "object") {
31
- if (seen.has(v)) continue;
32
- seen.add(v);
33
- if (Array.isArray(v)) {
34
- bytes += 2 + v.length;
35
- for (let i = 0; i < v.length; i++) stack.push(v[i]);
36
- } else {
37
- bytes += 2;
38
- for (const k in v) {
39
- bytes += k.length + 4;
40
- stack.push(v[k]);
41
- }
42
- }
43
- } else bytes += 4;
44
- }
45
- return bytes > limit;
46
- }
47
23
  function shouldOmitParams(params) {
48
24
  if (params == null) return false;
49
- try {
50
- JSON.stringify(params);
51
- } catch {
52
- return true;
53
- }
54
- return jsonLongerThan(params, SNAPSHOT_PARAM_INLINE_LIMIT);
25
+ return (0, _sharedUi.isOverWireBudget)(params, SNAPSHOT_PARAM_INLINE_LIMIT);
55
26
  }
56
27
  function toWireParams(params) {
57
28
  if (!shouldOmitParams(params)) return params;
@@ -5,6 +5,8 @@ import { routeEventStore } from "../stores/routeEventStore";
5
5
  import { navigationStackStore } from "../stores/navigationStackStore";
6
6
  import { RouteParser } from "../RouteParser";
7
7
  import { loadRouteNode, getRouteNodeMetadata } from "../expoRouterStore";
8
+ import { isOverWireBudget } from "@buoy-gg/shared-ui";
9
+
8
10
  /**
9
11
  * Navigation params larger than this are NOT streamed in the snapshot.
10
12
  * Apps routinely pass whole user objects (or a stringified payload) through
@@ -16,38 +18,9 @@ const PARAMS_ON_DEVICE = Object.freeze({
16
18
  __buoyOmitted: "route-params",
17
19
  note: "Navigation params stay on the device."
18
20
  });
19
- function jsonLongerThan(value, limit) {
20
- let bytes = 0;
21
- const stack = [value];
22
- const seen = new Set();
23
- while (stack.length > 0) {
24
- if (bytes > limit) return true;
25
- const v = stack.pop();
26
- if (v === null || v === undefined) bytes += 4;else if (typeof v === "string") bytes += v.length + 2;else if (typeof v === "number") bytes += 8;else if (typeof v === "boolean") bytes += 5;else if (typeof v === "object") {
27
- if (seen.has(v)) continue;
28
- seen.add(v);
29
- if (Array.isArray(v)) {
30
- bytes += 2 + v.length;
31
- for (let i = 0; i < v.length; i++) stack.push(v[i]);
32
- } else {
33
- bytes += 2;
34
- for (const k in v) {
35
- bytes += k.length + 4;
36
- stack.push(v[k]);
37
- }
38
- }
39
- } else bytes += 4;
40
- }
41
- return bytes > limit;
42
- }
43
21
  function shouldOmitParams(params) {
44
22
  if (params == null) return false;
45
- try {
46
- JSON.stringify(params);
47
- } catch {
48
- return true;
49
- }
50
- return jsonLongerThan(params, SNAPSHOT_PARAM_INLINE_LIMIT);
23
+ return isOverWireBudget(params, SNAPSHOT_PARAM_INLINE_LIMIT);
51
24
  }
52
25
  function toWireParams(params) {
53
26
  if (!shouldOmitParams(params)) return params;
@@ -56,13 +56,13 @@ export declare const routeEventsSyncAdapter: {
56
56
  * Navigate the device to a concrete path. The dashboard resolves any
57
57
  * dynamic params into a concrete path before invoking this.
58
58
  */
59
- navigate: (params: unknown) => {
59
+ navigate: (params?: unknown) => {
60
60
  navigated: string;
61
61
  };
62
- stackNavigateToIndex: (params: unknown) => {
62
+ stackNavigateToIndex: (params?: unknown) => {
63
63
  navigatedToIndex: number;
64
64
  };
65
- stackPopToIndex: (params: unknown) => {
65
+ stackPopToIndex: (params?: unknown) => {
66
66
  poppedToIndex: number;
67
67
  };
68
68
  stackGoBack: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"routeEventsSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/routeEventsSyncAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAY,CAAC;AA6DrD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAWD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;uBAEhB,sBAAsB;0BAKjB,MAAM,IAAI;;;QAkC9B;;;WAGG;2BACgB,OAAO;;;uCAcK,OAAO;;;kCAUZ,OAAO;;;;;;;;;;CAuBpC,CAAC"}
1
+ {"version":3,"file":"routeEventsSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/routeEventsSyncAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAY,CAAC;AA4BrD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAWD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;uBAEhB,sBAAsB;0BAKjB,MAAM,IAAI;;;QAkC9B;;;WAGG;4BACiB,OAAO;;;wCAcK,OAAO;;;mCAUZ,OAAO;;;;;;;;;;CAuBrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/route-events",
3
- "version": "7.0.18",
3
+ "version": "7.0.19",
4
4
  "description": "Navigation devtool for React Native — live stack, full sitemap, jump to any screen. Expo Router & React Navigation. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -26,11 +26,11 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@buoy-gg/floating-tools-core": "^7.0.18",
30
- "@buoy-gg/shared-ui": "^7.0.18"
29
+ "@buoy-gg/floating-tools-core": "^7.0.19",
30
+ "@buoy-gg/shared-ui": "^7.0.19"
31
31
  },
32
32
  "peerDependencies": {
33
- "@buoy-gg/license": "7.0.18",
33
+ "@buoy-gg/license": "7.0.19",
34
34
  "@react-native-async-storage/async-storage": "^2.0.0 || ^3.1.0",
35
35
  "@react-navigation/native": "*",
36
36
  "expo-router": "*",
@@ -52,7 +52,7 @@
52
52
  "@types/react-native": "^0.73.0",
53
53
  "expo-router": "~5.0.7",
54
54
  "typescript": "~5.8.3",
55
- "@buoy-gg/license": "^7.0.18"
55
+ "@buoy-gg/license": "^7.0.19"
56
56
  },
57
57
  "react-native-builder-bob": {
58
58
  "source": "src",
@@ -70,7 +70,12 @@
70
70
  "sourceMaps": false
71
71
  }
72
72
  ],
73
- "typescript"
73
+ [
74
+ "typescript",
75
+ {
76
+ "project": "tsconfig.build.json"
77
+ }
78
+ ]
74
79
  ]
75
80
  },
76
81
  "repository": {