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.
@@ -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 mutationObserver?;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-debug-recorder",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "Floating debug panel that records UI interactions and generates Cypress tests via AI",
5
5
  "keywords": [
6
6
  "angular",