@getlimelight/sdk 0.1.4 → 0.2.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.
- package/dist/index.d.mts +84 -3
- package/dist/index.d.ts +84 -3
- package/dist/index.js +616 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +616 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -6
package/dist/index.d.mts
CHANGED
|
@@ -210,6 +210,82 @@ declare enum GraphqlOprtation {
|
|
|
210
210
|
SUB = "SUBSCRIPTION"
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Render lifecycle phases
|
|
215
|
+
*/
|
|
216
|
+
declare enum RenderPhase {
|
|
217
|
+
MOUNT = "mount",
|
|
218
|
+
UPDATE = "update",
|
|
219
|
+
UNMOUNT = "unmount"
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* What triggered this render
|
|
223
|
+
*/
|
|
224
|
+
declare enum RenderCauseType {
|
|
225
|
+
STATE_CHANGE = "state_change",
|
|
226
|
+
PROPS_CHANGE = "props_change",
|
|
227
|
+
CONTEXT_CHANGE = "context_change",
|
|
228
|
+
PARENT_RENDER = "parent_render",
|
|
229
|
+
FORCE_UPDATE = "force_update",
|
|
230
|
+
UNKNOWN = "unknown"
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Component type classification
|
|
234
|
+
*/
|
|
235
|
+
type ComponentType = "function" | "class" | "memo" | "forwardRef" | "unknown";
|
|
236
|
+
/**
|
|
237
|
+
* Transaction boundary markers (emitted by LimelightProvider)
|
|
238
|
+
*/
|
|
239
|
+
interface TransactionEvent {
|
|
240
|
+
phase: "TRANSACTION_START" | "TRANSACTION_END";
|
|
241
|
+
transactionId: string;
|
|
242
|
+
sessionId: string;
|
|
243
|
+
timestamp: number;
|
|
244
|
+
trigger?: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Snapshot of prop change stats sent to desktop.
|
|
248
|
+
*/
|
|
249
|
+
interface PropChangeSnapshot {
|
|
250
|
+
topChangedProps: {
|
|
251
|
+
key: string;
|
|
252
|
+
count: number;
|
|
253
|
+
referenceOnlyPercent: number;
|
|
254
|
+
}[];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Snapshot of component render stats sent to desktop.
|
|
258
|
+
*/
|
|
259
|
+
interface RenderSnapshot {
|
|
260
|
+
phase: "RENDER_SNAPSHOT";
|
|
261
|
+
sessionId: string;
|
|
262
|
+
timestamp: number;
|
|
263
|
+
profiles: ComponentProfileSnapshot[];
|
|
264
|
+
}
|
|
265
|
+
interface ComponentProfileSnapshot {
|
|
266
|
+
id: string;
|
|
267
|
+
componentId: string;
|
|
268
|
+
componentName: string;
|
|
269
|
+
componentType: ComponentType;
|
|
270
|
+
totalRenders: number;
|
|
271
|
+
totalRenderCost: number;
|
|
272
|
+
avgRenderCost: number;
|
|
273
|
+
rendersDelta: number;
|
|
274
|
+
renderCostDelta: number;
|
|
275
|
+
renderVelocity: number;
|
|
276
|
+
causeBreakdown: Record<RenderCauseType, number>;
|
|
277
|
+
causeDeltaBreakdown: Record<RenderCauseType, number>;
|
|
278
|
+
parentComponentId?: string;
|
|
279
|
+
depth: number;
|
|
280
|
+
lastTransactionId?: string;
|
|
281
|
+
isSuspicious: boolean;
|
|
282
|
+
suspiciousReason?: string;
|
|
283
|
+
renderPhase: RenderPhase;
|
|
284
|
+
mountedAt: number;
|
|
285
|
+
unmountedAt?: number;
|
|
286
|
+
propChanges?: PropChangeSnapshot;
|
|
287
|
+
}
|
|
288
|
+
|
|
213
289
|
/**
|
|
214
290
|
* Configuration options for Limelight SDK.
|
|
215
291
|
*
|
|
@@ -270,7 +346,11 @@ interface LimelightConfig {
|
|
|
270
346
|
*/
|
|
271
347
|
disableBodyCapture?: boolean;
|
|
272
348
|
/**
|
|
273
|
-
*
|
|
349
|
+
* Flag to enable or disable render inspection.
|
|
350
|
+
*/
|
|
351
|
+
enableRenderInspector?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* A callback function to modify or filter events before they are sent to the server
|
|
274
354
|
*/
|
|
275
355
|
beforeSend?: (event: LimelightMessage) => LimelightMessage | null;
|
|
276
356
|
}
|
|
@@ -292,7 +372,7 @@ interface ConnectionEvent {
|
|
|
292
372
|
/**
|
|
293
373
|
* Union type representing all possible Limelight messages.
|
|
294
374
|
*/
|
|
295
|
-
type LimelightMessage = NetworkRequest | NetworkResponse | NetworkErrorEvent | ConsoleEvent | ConnectionEvent;
|
|
375
|
+
type LimelightMessage = NetworkRequest | NetworkResponse | NetworkErrorEvent | ConsoleEvent | ConnectionEvent | RenderSnapshot | TransactionEvent;
|
|
296
376
|
|
|
297
377
|
/**
|
|
298
378
|
* Represents a single frame in a stack trace.
|
|
@@ -325,10 +405,11 @@ declare class LimelightClient {
|
|
|
325
405
|
private networkInterceptor;
|
|
326
406
|
private xhrInterceptor;
|
|
327
407
|
private consoleInterceptor;
|
|
408
|
+
private renderInterceptor;
|
|
328
409
|
constructor();
|
|
329
410
|
/**
|
|
330
411
|
* Configures the Limelight client with the provided settings.
|
|
331
|
-
* Sets up network, XHR, and
|
|
412
|
+
* Sets up network, XHR, console, and render interceptors based on the configuration.
|
|
332
413
|
* @internal
|
|
333
414
|
* @private
|
|
334
415
|
* @param {LimelightConfig} config - Configuration object for Limelight
|
package/dist/index.d.ts
CHANGED
|
@@ -210,6 +210,82 @@ declare enum GraphqlOprtation {
|
|
|
210
210
|
SUB = "SUBSCRIPTION"
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Render lifecycle phases
|
|
215
|
+
*/
|
|
216
|
+
declare enum RenderPhase {
|
|
217
|
+
MOUNT = "mount",
|
|
218
|
+
UPDATE = "update",
|
|
219
|
+
UNMOUNT = "unmount"
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* What triggered this render
|
|
223
|
+
*/
|
|
224
|
+
declare enum RenderCauseType {
|
|
225
|
+
STATE_CHANGE = "state_change",
|
|
226
|
+
PROPS_CHANGE = "props_change",
|
|
227
|
+
CONTEXT_CHANGE = "context_change",
|
|
228
|
+
PARENT_RENDER = "parent_render",
|
|
229
|
+
FORCE_UPDATE = "force_update",
|
|
230
|
+
UNKNOWN = "unknown"
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Component type classification
|
|
234
|
+
*/
|
|
235
|
+
type ComponentType = "function" | "class" | "memo" | "forwardRef" | "unknown";
|
|
236
|
+
/**
|
|
237
|
+
* Transaction boundary markers (emitted by LimelightProvider)
|
|
238
|
+
*/
|
|
239
|
+
interface TransactionEvent {
|
|
240
|
+
phase: "TRANSACTION_START" | "TRANSACTION_END";
|
|
241
|
+
transactionId: string;
|
|
242
|
+
sessionId: string;
|
|
243
|
+
timestamp: number;
|
|
244
|
+
trigger?: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Snapshot of prop change stats sent to desktop.
|
|
248
|
+
*/
|
|
249
|
+
interface PropChangeSnapshot {
|
|
250
|
+
topChangedProps: {
|
|
251
|
+
key: string;
|
|
252
|
+
count: number;
|
|
253
|
+
referenceOnlyPercent: number;
|
|
254
|
+
}[];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Snapshot of component render stats sent to desktop.
|
|
258
|
+
*/
|
|
259
|
+
interface RenderSnapshot {
|
|
260
|
+
phase: "RENDER_SNAPSHOT";
|
|
261
|
+
sessionId: string;
|
|
262
|
+
timestamp: number;
|
|
263
|
+
profiles: ComponentProfileSnapshot[];
|
|
264
|
+
}
|
|
265
|
+
interface ComponentProfileSnapshot {
|
|
266
|
+
id: string;
|
|
267
|
+
componentId: string;
|
|
268
|
+
componentName: string;
|
|
269
|
+
componentType: ComponentType;
|
|
270
|
+
totalRenders: number;
|
|
271
|
+
totalRenderCost: number;
|
|
272
|
+
avgRenderCost: number;
|
|
273
|
+
rendersDelta: number;
|
|
274
|
+
renderCostDelta: number;
|
|
275
|
+
renderVelocity: number;
|
|
276
|
+
causeBreakdown: Record<RenderCauseType, number>;
|
|
277
|
+
causeDeltaBreakdown: Record<RenderCauseType, number>;
|
|
278
|
+
parentComponentId?: string;
|
|
279
|
+
depth: number;
|
|
280
|
+
lastTransactionId?: string;
|
|
281
|
+
isSuspicious: boolean;
|
|
282
|
+
suspiciousReason?: string;
|
|
283
|
+
renderPhase: RenderPhase;
|
|
284
|
+
mountedAt: number;
|
|
285
|
+
unmountedAt?: number;
|
|
286
|
+
propChanges?: PropChangeSnapshot;
|
|
287
|
+
}
|
|
288
|
+
|
|
213
289
|
/**
|
|
214
290
|
* Configuration options for Limelight SDK.
|
|
215
291
|
*
|
|
@@ -270,7 +346,11 @@ interface LimelightConfig {
|
|
|
270
346
|
*/
|
|
271
347
|
disableBodyCapture?: boolean;
|
|
272
348
|
/**
|
|
273
|
-
*
|
|
349
|
+
* Flag to enable or disable render inspection.
|
|
350
|
+
*/
|
|
351
|
+
enableRenderInspector?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* A callback function to modify or filter events before they are sent to the server
|
|
274
354
|
*/
|
|
275
355
|
beforeSend?: (event: LimelightMessage) => LimelightMessage | null;
|
|
276
356
|
}
|
|
@@ -292,7 +372,7 @@ interface ConnectionEvent {
|
|
|
292
372
|
/**
|
|
293
373
|
* Union type representing all possible Limelight messages.
|
|
294
374
|
*/
|
|
295
|
-
type LimelightMessage = NetworkRequest | NetworkResponse | NetworkErrorEvent | ConsoleEvent | ConnectionEvent;
|
|
375
|
+
type LimelightMessage = NetworkRequest | NetworkResponse | NetworkErrorEvent | ConsoleEvent | ConnectionEvent | RenderSnapshot | TransactionEvent;
|
|
296
376
|
|
|
297
377
|
/**
|
|
298
378
|
* Represents a single frame in a stack trace.
|
|
@@ -325,10 +405,11 @@ declare class LimelightClient {
|
|
|
325
405
|
private networkInterceptor;
|
|
326
406
|
private xhrInterceptor;
|
|
327
407
|
private consoleInterceptor;
|
|
408
|
+
private renderInterceptor;
|
|
328
409
|
constructor();
|
|
329
410
|
/**
|
|
330
411
|
* Configures the Limelight client with the provided settings.
|
|
331
|
-
* Sets up network, XHR, and
|
|
412
|
+
* Sets up network, XHR, console, and render interceptors based on the configuration.
|
|
332
413
|
* @internal
|
|
333
414
|
* @private
|
|
334
415
|
* @param {LimelightConfig} config - Configuration object for Limelight
|