angular-debug-recorder 1.0.3 → 1.1.1
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/README.md +57 -9
- package/esm2022/angular-debug-recorder.mjs +1 -1
- package/esm2022/lib/action-list/action-list.component.mjs +1 -1
- package/esm2022/lib/debug-panel/debug-panel.component.mjs +1 -1
- package/esm2022/lib/models/recorded-action.model.mjs +1 -1
- package/esm2022/lib/services/ai-generator.service.mjs +1 -1
- package/esm2022/lib/services/recorder.service.mjs +162 -71
- package/esm2022/lib/services/rrweb-recorder.service.mjs +1 -1
- package/esm2022/lib/session-replay/session-replay.component.mjs +83 -3
- package/esm2022/lib/settings-dialog/settings-dialog.component.mjs +1 -1
- package/esm2022/lib/test-preview/test-preview.component.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/angular-debug-recorder.mjs +243 -72
- package/fesm2022/angular-debug-recorder.mjs.map +1 -1
- package/lib/services/recorder.service.d.ts +38 -2
- package/lib/session-replay/session-replay.component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { NgZone } from '@angular/core';
|
|
2
2
|
import { RecordingSession } from '../models/recorded-action.model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Performance notes
|
|
6
|
+
* ─────────────────
|
|
7
|
+
* All DOM event listeners are registered **outside Angular's NgZone**
|
|
8
|
+
* (zone.runOutsideAngular). This means a click, input, or scroll never
|
|
9
|
+
* triggers Angular Change Detection by itself.
|
|
10
|
+
*
|
|
11
|
+
* Recorded actions are batched in a plain array and flushed once per
|
|
12
|
+
* animation frame via requestAnimationFrame. Only the RAF callback runs
|
|
13
|
+
* inside zone.run() → at most one CD cycle per frame, regardless of how
|
|
14
|
+
* many events fired.
|
|
15
|
+
*
|
|
16
|
+
* Why this matters for OnPush host apps
|
|
17
|
+
* ──────────────────────────────────────
|
|
18
|
+
* When this recorder is embedded in a library used inside an OnPush app,
|
|
19
|
+
* the old zone.run()-per-event approach caused the host app's CD to run
|
|
20
|
+
* on every user interaction. With this implementation the host app is
|
|
21
|
+
* completely unaffected — only the recorder's own signals trigger CD.
|
|
22
|
+
*
|
|
23
|
+
* F5 / page-reload survival
|
|
24
|
+
* ─────────────────────────
|
|
25
|
+
* The active recording session is written to sessionStorage on
|
|
26
|
+
* beforeunload and restored in the constructor. If the user accidentally
|
|
27
|
+
* refreshes mid-recording, no actions are lost.
|
|
28
|
+
*/
|
|
4
29
|
export declare class RecorderService {
|
|
5
30
|
private zone;
|
|
6
31
|
private _isRecording;
|
|
@@ -12,8 +37,12 @@ export declare class RecorderService {
|
|
|
12
37
|
currentSession: import("@angular/core").Signal<RecordingSession | null>;
|
|
13
38
|
sessions: import("@angular/core").Signal<RecordingSession[]>;
|
|
14
39
|
actionCount: import("@angular/core").Signal<number>;
|
|
40
|
+
private pendingActions;
|
|
41
|
+
private rafId?;
|
|
15
42
|
private listeners;
|
|
16
|
-
private
|
|
43
|
+
private lastScrollTime;
|
|
44
|
+
private static readonly SESSION_KEY;
|
|
45
|
+
private static readonly SESSIONS_KEY;
|
|
17
46
|
constructor(zone: NgZone);
|
|
18
47
|
startRecording(name?: string, description?: string): void;
|
|
19
48
|
stopRecording(): RecordingSession | null;
|
|
@@ -23,6 +52,12 @@ export declare class RecorderService {
|
|
|
23
52
|
addNote(actionId: string, note: string): void;
|
|
24
53
|
deleteSession(sessionId: string): void;
|
|
25
54
|
loadSession(session: RecordingSession): void;
|
|
55
|
+
/**
|
|
56
|
+
* Schedule one signal update at the next animation frame.
|
|
57
|
+
* Multiple events within a single frame are coalesced → one CD cycle.
|
|
58
|
+
*/
|
|
59
|
+
private scheduleFlush;
|
|
60
|
+
private flushPending;
|
|
26
61
|
private attachListeners;
|
|
27
62
|
private detachListeners;
|
|
28
63
|
private handleClick;
|
|
@@ -30,7 +65,6 @@ export declare class RecorderService {
|
|
|
30
65
|
private handleInput;
|
|
31
66
|
private handleChange;
|
|
32
67
|
private handleSubmit;
|
|
33
|
-
private lastScrollTime;
|
|
34
68
|
private handleScroll;
|
|
35
69
|
private handleKeydown;
|
|
36
70
|
private recordNavigation;
|
|
@@ -40,6 +74,8 @@ export declare class RecorderService {
|
|
|
40
74
|
private describeElement;
|
|
41
75
|
private shouldRecord;
|
|
42
76
|
private addAction;
|
|
77
|
+
private persistToStorage;
|
|
78
|
+
private restoreFromStorage;
|
|
43
79
|
private generateId;
|
|
44
80
|
static ɵfac: i0.ɵɵFactoryDeclaration<RecorderService, never>;
|
|
45
81
|
static ɵprov: i0.ɵɵInjectableDeclaration<RecorderService>;
|
|
@@ -6,11 +6,14 @@ export declare class SessionReplayComponent implements OnDestroy {
|
|
|
6
6
|
rrweb: RrwebRecorderService;
|
|
7
7
|
overlayOpen: import("@angular/core").WritableSignal<boolean>;
|
|
8
8
|
isPlaying: import("@angular/core").WritableSignal<boolean>;
|
|
9
|
+
importError: import("@angular/core").WritableSignal<string | null>;
|
|
10
|
+
importedFilename: import("@angular/core").WritableSignal<string | null>;
|
|
9
11
|
openOverlay(): Promise<void>;
|
|
10
12
|
closeOverlay(): void;
|
|
11
13
|
pauseResume(): Promise<void>;
|
|
12
14
|
restart(): Promise<void>;
|
|
13
15
|
exportSession(): void;
|
|
16
|
+
onFileSelected(event: Event): void;
|
|
14
17
|
private startPlay;
|
|
15
18
|
private scaleReplayer;
|
|
16
19
|
ngOnDestroy(): void;
|