@alwaysmeticulous/sdk-bundles-api 2.242.6 → 2.244.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.
@@ -19,6 +19,15 @@ export interface ReplayAndStoreResultsOptions {
19
19
  * The git ref used if there was one e.g. refs/head/master
20
20
  */
21
21
  gitRef: string | null | undefined;
22
+ /**
23
+ * The commit date in ISO 8601 format (e.g., "2025-01-15T10:30:00Z")
24
+ */
25
+ commitDate: string | null | undefined;
26
+ /**
27
+ * True only in case the performance data associated with this replay is
28
+ * significant to benchmark the performance of the application.
29
+ */
30
+ isBenchmarkableReplay: boolean | null | undefined;
22
31
  projectId: string;
23
32
  sessionId: string;
24
33
  /**
@@ -47,6 +47,110 @@ export interface MeticulousPublicReplayApi {
47
47
  recordCustomEvent(type: string, serializedData: string): {
48
48
  success: boolean;
49
49
  };
50
+ /**
51
+ * True only in case the performance data associated with this replay is
52
+ * significant to benchmark the performance of the application.
53
+ */
54
+ isBenchmarkableReplay: boolean;
55
+ /**
56
+ * Native (non-stubbed) browser APIs that provide real performance metrics.
57
+ * These return actual values and are not affected by virtual time/stubbing.
58
+ * Report these values to analytics platforms only in case
59
+ * isBenchmarkableReplay is true.
60
+ *
61
+ * @example
62
+ * ```
63
+ * // Use native performance.now() only during benchmarkable replays
64
+ * const now = (
65
+ * window.Meticulous?.replay?.isBenchmarkableReplay
66
+ * ? window.Meticulous.replay.native
67
+ * : window
68
+ * ).performance.now();
69
+ * ```
70
+ *
71
+ * @remarks
72
+ * These APIs bypass Meticulous's deterministic stubbing to provide real
73
+ * performance data.
74
+ * Use to log performance information to analytics dashboards, performance
75
+ * monitors, or custom logging systems.
76
+ * Avoid using these APIs to report performance metrics in the web application
77
+ * UI directly, as this could produce unexpected visual differences.
78
+ * For this use case, use the standard performance APIs available on window.
79
+ *
80
+ * When sending data to an analytics dashboard, ensure that Meticulous
81
+ * allows these requests to pass through.
82
+ * Add the "meticulous-passthrough" header (set to the string "true") to the
83
+ * requests to prevent them from being blocked.
84
+ */
85
+ native: {
86
+ performance: {
87
+ /**
88
+ * Returns the real elapsed time in milliseconds (not virtual time).
89
+ * Uses the native performance.now() that was captured before stubbing.
90
+ *
91
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
92
+ */
93
+ now: typeof window.performance.now;
94
+ /**
95
+ * Returns actual browser memory usage (not the stubbed fixed values).
96
+ *
97
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
98
+ */
99
+ memory?: {
100
+ jsHeapSizeLimit: number;
101
+ totalJSHeapSize: number;
102
+ usedJSHeapSize: number;
103
+ };
104
+ /**
105
+ * Measures actual cross-origin memory usage of the page.
106
+ * Uses the native performance.measureUserAgentSpecificMemory() captured before stubbing.
107
+ *
108
+ * @returns A promise that resolves with detailed memory breakdown.
109
+ * Returns `Promise<any>` because this API is experimental and not widely
110
+ * available in all browsers. The return type is not well-defined in
111
+ * TypeScript's standard library definitions.
112
+ *
113
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/measureUserAgentSpecificMemory
114
+ */
115
+ measureUserAgentSpecificMemory?: () => Promise<any>;
116
+ };
117
+ /**
118
+ * The native PerformanceObserver API for monitoring real performance metrics.
119
+ * Use this to observe actual performance entries (e.g., navigation,
120
+ * resource, measure) that are not affected by Meticulous's virtual
121
+ * time/stubbing.
122
+ *
123
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
124
+ */
125
+ PerformanceObserver: typeof window.PerformanceObserver;
126
+ };
127
+ /**
128
+ * Information about the commit being tested.
129
+ * Only populated during replay when commit context is available.
130
+ */
131
+ commitUnderTest: {
132
+ /**
133
+ * The full commit SHA being test
134
+ */
135
+ sha: string;
136
+ /**
137
+ * The git branch name (e.g., "main", "feature/foo"). Null if not available
138
+ */
139
+ branchName: string | null;
140
+ /**
141
+ * The commit date in ISO 8601 format (e.g., "2025-01-15T10:30:00Z")
142
+ */
143
+ date: string;
144
+ } | undefined;
145
+ /**
146
+ * Information about the session being replayed.
147
+ */
148
+ sessionBeingReplayed: {
149
+ /**
150
+ * The ID of the session being replayed.
151
+ */
152
+ id: string;
153
+ };
50
154
  }
51
155
  export interface MeticulousPublicRecordApi {
52
156
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/sdk-bundles-api",
3
- "version": "2.242.6",
3
+ "version": "2.244.0",
4
4
  "description": "Meticulous common types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -38,5 +38,5 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
40
40
  },
41
- "gitHead": "cc70e0ab15df8baad2ae3036a8bc6615ea87d9c3"
41
+ "gitHead": "ecc638105376f95d4111a364c2ce32500057ae18"
42
42
  }