@osdk/react-devtools 0.12.0 → 0.12.1-main-e3a6fa4fb529f640175ebec3bec4c55bc8854f9c
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/CHANGELOG.md +7 -0
- package/build/esm/components/MonitoringPanel.js +51 -33
- package/build/esm/components/MonitoringPanel.js.map +1 -1
- package/build/esm/components/MonitoringPanel.module.scss.js +2 -4
- package/build/esm/fiber/DegradationNotice.js +7 -1
- package/build/esm/fiber/DegradationNotice.js.map +1 -1
- package/build/esm/hooks/useClientMetrics.js +34 -0
- package/build/esm/hooks/useClientMetrics.js.map +1 -0
- package/build/esm/hooks/usePersistedState.js +27 -1
- package/build/esm/hooks/usePersistedState.js.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/metrics/clientMetrics.js +87 -0
- package/build/esm/metrics/clientMetrics.js.map +1 -0
- package/build/esm/styles.css +30 -45
- package/build/esm/styles.js +1 -1
- package/build/types/components/MonitoringPanel.d.ts.map +1 -1
- package/build/types/fiber/DegradationNotice.d.ts +1 -0
- package/build/types/fiber/DegradationNotice.d.ts.map +1 -1
- package/build/types/hooks/useClientMetrics.d.ts +11 -0
- package/build/types/hooks/useClientMetrics.d.ts.map +1 -0
- package/build/types/hooks/usePersistedState.d.ts +6 -1
- package/build/types/hooks/usePersistedState.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/metrics/clientMetrics.d.ts +28 -0
- package/build/types/metrics/clientMetrics.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AA0BA,OAAO,WAAuD,OAAQ;AAUtE,cAAc,oBAAoB,0BAA2B;AAyE7D,iBAAiB,qBAAqB;;CAEpC,cAAc;AACf;AAED,OAAO,cAAMA,iBAAiB,MAAM,GAAG;AAigBvC,OAAO,cAAMC,qBAAqB,MAAM,GAAG","names":["MonitoringPanel: React.FC<MonitoringPanelProps>","SafeMonitoringPanel: React.FC<MonitoringPanelProps>"],"sources":["../../../src/components/MonitoringPanel.tsx"],"version":3,"file":"MonitoringPanel.d.ts"}
|
|
@@ -3,6 +3,7 @@ import { type FiberCapabilities } from "./capabilities.js";
|
|
|
3
3
|
export interface DegradationNoticeProps {
|
|
4
4
|
onRetry?: () => void;
|
|
5
5
|
showWhenHealthy?: boolean;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const DegradationNotice: React.FC<DegradationNoticeProps>;
|
|
8
9
|
export declare function useFiberCapabilities(): FiberCapabilities;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAiBA,OAAO,WAAW,OAAQ;AAE1B,cACO,yBAGA,mBAAoB;AAsB3B,iBAAiB,uBAAuB;CACtC;CACA;AACD;AAyBD,OAAO,cAAMA,mBAAmB,MAAM,GAAG;
|
|
1
|
+
{"mappings":"AAiBA,OAAO,WAAW,OAAQ;AAE1B,cACO,yBAGA,mBAAoB;AAsB3B,iBAAiB,uBAAuB;CACtC;CACA;CACA;AACD;AAyBD,OAAO,cAAMA,mBAAmB,MAAM,GAAG;AA+KzC,OAAO,iBAAS,wBAAwB","names":["DegradationNotice: React.FC<DegradationNoticeProps>"],"sources":["../../../src/fiber/DegradationNotice.tsx"],"version":3,"file":"DegradationNotice.d.ts"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ClientMetrics } from "../metrics/clientMetrics.js";
|
|
2
|
+
import type { MonitorStore } from "../store/MonitorStore.js";
|
|
3
|
+
/**
|
|
4
|
+
* Subscribes to the metrics store and returns the full {@link ClientMetrics}
|
|
5
|
+
* set, recomputed whenever any metric changes. It is meant for a single surface
|
|
6
|
+
* that renders these metrics together (the Overview tab), where re-rendering the
|
|
7
|
+
* whole group on any change is expected. If a consumer ever needs one metric in
|
|
8
|
+
* isolation (without re-rendering when unrelated metrics change), add a selector
|
|
9
|
+
* overload here rather than reading a single field off the full result.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useClientMetrics(monitorStore: MonitorStore): ClientMetrics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAkBA,cAAc,qBAAqB,6BAA8B;AAEjE,cAAc,oBAAoB,0BAA2B;;;;;;;;;AAU7D,OAAO,iBAAS,iBAAiBA,cAAc,eAAe","names":["monitorStore: MonitorStore"],"sources":["../../../src/hooks/useClientMetrics.ts"],"version":3,"file":"useClientMetrics.d.ts"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare function usePersistedState<T>(
|
|
1
|
+
export declare function usePersistedState<T>(initialKey: string, defaultValue: T): [T, (value: T | ((prev: T) => T)) => void];
|
|
2
|
+
/**
|
|
3
|
+
* Function exported for testing.
|
|
4
|
+
* We don't want tests to use localStorage directly since the storage layer could change
|
|
5
|
+
*/
|
|
6
|
+
export declare function clearPersistedState(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAiCA,OAAO,iBAAS,kBAAkB,GAIhCA,oBACAC,cAAc,KACZ,IAAIC,OAAO,MAAMC,MAAM,MAAM;;;;;AA6FjC,OAAO,iBAAS","names":["initialKey: string","defaultValue: T","value: T | ((prev: T) => T)","prev: T"],"sources":["../../../src/hooks/usePersistedState.ts"],"version":3,"file":"usePersistedState.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ export { OsdkAppErrorBoundary } from "./components/OsdkAppErrorBoundary.js";
|
|
|
8
8
|
export type { OsdkAppErrorBoundaryProps } from "./components/OsdkAppErrorBoundary.js";
|
|
9
9
|
export { OsdkDevTools } from "./components/OsdkDevTools.js";
|
|
10
10
|
export { useComputeMetrics, useComputeRecording, useComputeRequests } from "./hooks/useComputeSelectors.js";
|
|
11
|
+
export { useClientMetrics } from "./hooks/useClientMetrics.js";
|
|
11
12
|
export { useMetrics } from "./hooks/useMetrics.js";
|
|
12
13
|
export { usePersistedState } from "./hooks/usePersistedState.js";
|
|
14
|
+
export { getClientMetrics, MIN_SAMPLES } from "./metrics/clientMetrics.js";
|
|
15
|
+
export type { ClientMetrics, Metric } from "./metrics/clientMetrics.js";
|
|
13
16
|
export type { Fiber } from "./fiber/types.js";
|
|
14
17
|
export { ComputeStore } from "./store/ComputeStore.js";
|
|
15
18
|
export { MonitorStore } from "./store/MonitorStore.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,OAAO,eAAgB;AAEvB,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,cAAc,iCAAiC;AAC/C,SACE,iBACA,2BACK;AACP,cAAc,4BAA4B;AAC1C,SAAS,4BAA4B;AACrC,cAAc,iCAAiC;AAC/C,SAAS,oBAAoB;AAE7B,SACE,mBACA,qBACA,0BACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,cAAc,aAAa;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,+BAA+B;AACxC,cACE,kBACA,+BACK;AACP,cAAc,8BAA8B;AAC5C,SAAS,sBAAsB;AAE/B,cACE,kBACA,aACA,iBACA,WACA,mBACA,eACA,eACA,sBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,OAAO,eAAgB;AAEvB,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,cAAc,iCAAiC;AAC/C,SACE,iBACA,2BACK;AACP,cAAc,4BAA4B;AAC1C,SAAS,4BAA4B;AACrC,cAAc,iCAAiC;AAC/C,SAAS,oBAAoB;AAE7B,SACE,mBACA,qBACA,0BACK;AACP,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,SAAS,kBAAkB,mBAAmB;AAC9C,cAAc,eAAe,cAAc;AAE3C,cAAc,aAAa;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,+BAA+B;AACxC,cACE,kBACA,+BACK;AACP,cAAc,8BAA8B;AAC5C,SAAS,sBAAsB;AAE/B,cACE,kBACA,aACA,iBACA,WACA,mBACA,eACA,eACA,sBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MetricsSnapshot } from "../types/index.js";
|
|
2
|
+
export interface Metric {
|
|
3
|
+
/** The computed value, or undefined until enough samples have accrued. */
|
|
4
|
+
value: number | undefined;
|
|
5
|
+
sampleCount: number;
|
|
6
|
+
unit?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ClientMetrics {
|
|
9
|
+
cacheHitRate: Metric;
|
|
10
|
+
requestsSaved: Metric;
|
|
11
|
+
estimatedTimeSavedMs: Metric;
|
|
12
|
+
avgResponseMs: Metric;
|
|
13
|
+
avgCachedMs: Metric;
|
|
14
|
+
avgNetworkMs: Metric;
|
|
15
|
+
optimisticCoverage: Metric;
|
|
16
|
+
avgPerceivedSpeedupMs: Metric;
|
|
17
|
+
rollbackRate: Metric;
|
|
18
|
+
}
|
|
19
|
+
export declare const MIN_SAMPLES: {
|
|
20
|
+
readonly cacheHitRate: 20
|
|
21
|
+
readonly latency: 5
|
|
22
|
+
readonly requestsSaved: 1
|
|
23
|
+
readonly optimisticCoverage: 3
|
|
24
|
+
readonly rollbackRate: 3
|
|
25
|
+
};
|
|
26
|
+
export declare function getClientMetrics(snapshot: MetricsSnapshot): ClientMetrics;
|
|
27
|
+
/** Format a metric as a display string, or "N/A" until it has a value. */
|
|
28
|
+
export declare function formatMetric(m: Metric): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,uBAAuB,mBAAoB;AAEzD,iBAAiB,OAAO;;CAEtB;CACA;CACA;AACD;AAED,iBAAiB,cAAc;CAC7B,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,eAAe;CACf,aAAa;CACb,cAAc;CACd,oBAAoB;CACpB,uBAAuB;CACvB,cAAc;AACf;AAED,OAAO,cAAM;UACX,cAAc;UACd,SAAS;UACT,eAAe;UACf,oBAAoB;UACpB,cAAc;;AAoBhB,OAAO,iBAAS,iBAAiBA,UAAU,kBAAkB;;AA+F7D,OAAO,iBAAS,aAAaC,GAAG","names":["snapshot: MetricsSnapshot","m: Metric"],"sources":["../../../src/metrics/clientMetrics.ts"],"version":3,"file":"clientMetrics.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react-devtools",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1-main-e3a6fa4fb529f640175ebec3bec4c55bc8854f9c",
|
|
4
4
|
"description": "Developer tools and debugging utilities for OSDK React Toolkit",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"typescript": "~5.5.4",
|
|
74
74
|
"vite": "^6.3.5",
|
|
75
75
|
"vitest": "^2.0.0",
|
|
76
|
-
"@osdk/api": "2.43.0",
|
|
77
76
|
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
77
|
+
"@osdk/api": "2.43.0",
|
|
78
|
+
"@osdk/client": "2.43.0",
|
|
78
79
|
"@osdk/monorepo.tsconfig": "~0.7.0",
|
|
79
|
-
"@osdk/react": "2.43.0"
|
|
80
|
-
"@osdk/client": "2.43.0"
|
|
80
|
+
"@osdk/react": "2.43.0"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|