@highlight-run/rrweb 2.0.16 → 2.1.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/plugins/console-record.js +8 -8
- package/dist/plugins/console-record.min.js +8 -8
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.css +1 -1
- package/dist/replay/rrweb-replay-unpack.js +4 -4
- package/dist/replay/rrweb-replay-unpack.min.css +1 -1
- package/dist/replay/rrweb-replay-unpack.min.css.map +1 -1
- package/dist/replay/rrweb-replay-unpack.min.js +4 -4
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.css +1 -1
- package/dist/replay/rrweb-replay.js +4 -4
- package/dist/replay/rrweb-replay.min.css +1 -1
- package/dist/replay/rrweb-replay.min.css.map +1 -1
- package/dist/replay/rrweb-replay.min.js +4 -4
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +1 -1
- package/dist/rrweb-all.js +12 -12
- package/dist/rrweb-all.min.css +1 -1
- package/dist/rrweb-all.min.css.map +1 -1
- package/dist/rrweb-all.min.js +12 -12
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +1 -1
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.css +1 -1
- package/dist/rrweb.min.css.map +1 -1
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/all.css +1 -1
- package/es/rrweb/ext/mitt/dist/mitt.mjs.js +3 -0
- package/es/rrweb/packages/rrdom/es/rrdom.js +66 -14
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +3 -11
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +10 -7
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +9 -6
- package/es/rrweb/packages/rrweb/src/record/mutation.js +5 -3
- package/es/rrweb/packages/rrweb/src/record/observer.js +22 -14
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +4 -1
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +7 -4
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +3 -2
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +1 -2
- package/es/rrweb/packages/rrweb/src/replay/index.js +151 -180
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +0 -1
- package/es/rrweb/packages/rrweb/src/replay/timer.js +6 -7
- package/es/rrweb/packages/rrweb/src/utils.js +8 -6
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +60 -10
- package/lib/plugins/console-record.js +26 -26
- package/lib/record/rrweb-record.js +94 -31
- package/lib/replay/rrweb-replay-unpack.css +1 -1
- package/lib/replay/rrweb-replay-unpack.js +236 -270
- package/lib/replay/rrweb-replay.css +1 -1
- package/lib/replay/rrweb-replay.js +236 -270
- package/lib/rrweb-all.css +1 -1
- package/lib/rrweb-all.js +349 -323
- package/lib/rrweb.css +1 -1
- package/lib/rrweb.js +327 -299
- package/package.json +8 -7
- package/typings/entries/all.d.ts +0 -0
- package/typings/entries/record-pack.d.ts +0 -0
- package/typings/entries/replay-unpack.d.ts +0 -0
- package/typings/index.d.ts +0 -0
- package/typings/packer/base.d.ts +0 -0
- package/typings/packer/index.d.ts +0 -0
- package/typings/packer/pack.d.ts +0 -0
- package/typings/packer/unpack.d.ts +0 -0
- package/typings/plugins/console/record/error-stack-parser.d.ts +0 -0
- package/typings/plugins/console/record/index.d.ts +1 -1
- package/typings/plugins/console/record/stringify.d.ts +1 -1
- package/typings/plugins/console/replay/index.d.ts +0 -0
- package/typings/plugins/sequential-id/record/index.d.ts +0 -0
- package/typings/plugins/sequential-id/replay/index.d.ts +0 -0
- package/typings/record/iframe-manager.d.ts +0 -0
- package/typings/record/index.d.ts +0 -0
- package/typings/record/mutation.d.ts +0 -0
- package/typings/record/observer.d.ts +0 -0
- package/typings/record/observers/canvas/2d.d.ts +0 -0
- package/typings/record/observers/canvas/canvas-manager.d.ts +0 -0
- package/typings/record/observers/canvas/canvas.d.ts +0 -0
- package/typings/record/observers/canvas/serialize-args.d.ts +5 -5
- package/typings/record/observers/canvas/webgl.d.ts +0 -0
- package/typings/record/shadow-dom-manager.d.ts +1 -1
- package/typings/record/stylesheet-manager.d.ts +0 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +0 -0
- package/typings/replay/canvas/2d.d.ts +0 -0
- package/typings/replay/canvas/deserialize-args.d.ts +0 -0
- package/typings/replay/canvas/index.d.ts +0 -0
- package/typings/replay/canvas/webgl.d.ts +0 -0
- package/typings/replay/index.d.ts +0 -2
- package/typings/replay/machine.d.ts +0 -0
- package/typings/replay/smoothscroll.d.ts +0 -0
- package/typings/replay/styles/inject-style.d.ts +0 -0
- package/typings/replay/timer.d.ts +0 -0
- package/typings/rrdom/index.d.ts +0 -0
- package/typings/rrdom/tree-node.d.ts +0 -0
- package/typings/types.d.ts +5 -6
- package/typings/utils.d.ts +2 -2
- package/es/rrweb/ext/mitt/dist/mitt.es.js +0 -63
- package/typings/record/observers/canvas/webgl2.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highlight-run/rrweb",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "record and replay the web",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepare": "npm run prepack",
|
|
7
7
|
"prepack": "npm run bundle",
|
|
8
|
-
"test": "npm run bundle:browser && jest",
|
|
9
|
-
"test:headless": "npm run
|
|
8
|
+
"test": "npm run bundle:browser && jest --testPathIgnorePatterns test/benchmark",
|
|
9
|
+
"test:headless": "PUPPETEER_HEADLESS=true npm run test",
|
|
10
10
|
"test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch",
|
|
11
11
|
"repl": "npm run bundle:browser && node scripts/repl.js",
|
|
12
12
|
"dev": "yarn bundle:browser --watch",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"typings": "tsc -d --declarationDir typings",
|
|
16
16
|
"check-types": "tsc -noEmit",
|
|
17
17
|
"prepublish": "npm run typings && npm run bundle",
|
|
18
|
-
"lint": "yarn eslint src"
|
|
18
|
+
"lint": "yarn eslint src",
|
|
19
|
+
"benchmark": "jest test/benchmark"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
@@ -74,13 +75,13 @@
|
|
|
74
75
|
"typescript": "^4.7.3"
|
|
75
76
|
},
|
|
76
77
|
"dependencies": {
|
|
77
|
-
"@highlight-run/rrdom": ">=0.1.
|
|
78
|
+
"@highlight-run/rrdom": ">=0.1.14",
|
|
78
79
|
"@highlight-run/rrweb-snapshot": ">=1.1.22",
|
|
79
80
|
"@types/css-font-loading-module": "0.0.7",
|
|
80
81
|
"@xstate/fsm": "^1.4.0",
|
|
81
82
|
"base64-arraybuffer": "^1.0.1",
|
|
82
83
|
"fflate": "^0.4.4",
|
|
83
|
-
"mitt": "^
|
|
84
|
+
"mitt": "^3.0.0"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "ba064a5eee3debbcea07dfe122ad9fd1f0607040"
|
|
86
87
|
}
|
package/typings/entries/all.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/typings/index.d.ts
CHANGED
|
File without changes
|
package/typings/packer/base.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/typings/packer/pack.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -15,7 +15,6 @@ export declare type LogData = {
|
|
|
15
15
|
trace: string[];
|
|
16
16
|
payload: string[];
|
|
17
17
|
};
|
|
18
|
-
export declare type LogLevel = 'assert' | 'clear' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'groupEnd' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'timeLog' | 'trace' | 'warn';
|
|
19
18
|
export declare type Logger = {
|
|
20
19
|
assert?: typeof console.assert;
|
|
21
20
|
clear?: typeof console.clear;
|
|
@@ -37,6 +36,7 @@ export declare type Logger = {
|
|
|
37
36
|
trace?: typeof console.trace;
|
|
38
37
|
warn?: typeof console.warn;
|
|
39
38
|
};
|
|
39
|
+
export declare type LogLevel = keyof Logger;
|
|
40
40
|
export declare const PLUGIN_NAME = "rrweb/console@1";
|
|
41
41
|
export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
|
|
42
42
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { StringifyOptions } from './index';
|
|
2
|
-
export declare function stringify(obj:
|
|
2
|
+
export declare function stringify(obj: unknown, stringifyOptions?: StringifyOptions): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IWindow, CanvasArg } from '../../../types';
|
|
2
|
-
export declare function variableListFor(ctx: RenderingContext, ctor: string):
|
|
3
|
-
export declare const saveWebGLVar: (value:
|
|
4
|
-
export declare function serializeArg(value:
|
|
5
|
-
export declare const serializeArgs: (args: Array<
|
|
6
|
-
export declare const isInstanceOfWebGLObject: (value:
|
|
2
|
+
export declare function variableListFor(ctx: RenderingContext, ctor: string): unknown[];
|
|
3
|
+
export declare const saveWebGLVar: (value: unknown, win: IWindow, ctx: RenderingContext) => number | void;
|
|
4
|
+
export declare function serializeArg(value: unknown, win: IWindow, ctx: RenderingContext): CanvasArg;
|
|
5
|
+
export declare const serializeArgs: (args: Array<unknown>, win: IWindow, ctx: RenderingContext) => CanvasArg[];
|
|
6
|
+
export declare const isInstanceOfWebGLObject: (value: unknown, win: IWindow) => value is WebGLTexture | WebGLShader | WebGLBuffer | WebGLVertexArrayObject | WebGLProgram | WebGLActiveInfo | WebGLUniformLocation | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat;
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MutationBufferParam, mutationCallBack, SamplingStrategy, scrollCallback } from '../types';
|
|
2
2
|
import type { Mirror } from '@highlight-run/rrweb-snapshot';
|
|
3
3
|
declare type BypassOptions = Omit<MutationBufferParam, 'doc' | 'mutationCb' | 'mirror' | 'shadowDomManager'> & {
|
|
4
4
|
sampling: SamplingStrategy;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -57,8 +57,6 @@ export declare class Replayer {
|
|
|
57
57
|
private attachDocumentToIframe;
|
|
58
58
|
private collectIframeAndAttachDocument;
|
|
59
59
|
private waitForStylesheetLoad;
|
|
60
|
-
private hasImageArg;
|
|
61
|
-
private getImageArgs;
|
|
62
60
|
private preloadAllImages;
|
|
63
61
|
private preloadImages;
|
|
64
62
|
private deserializeAndPreloadCanvasEvents;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/typings/rrdom/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/typings/types.d.ts
CHANGED
|
@@ -23,11 +23,11 @@ export declare type SessionInterval = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare type domContentLoadedEvent = {
|
|
25
25
|
type: EventType.DomContentLoaded;
|
|
26
|
-
data:
|
|
26
|
+
data: unknown;
|
|
27
27
|
};
|
|
28
28
|
export declare type loadedEvent = {
|
|
29
29
|
type: EventType.Load;
|
|
30
|
-
data:
|
|
30
|
+
data: unknown;
|
|
31
31
|
};
|
|
32
32
|
export declare type fullSnapshotEvent = {
|
|
33
33
|
type: EventType.FullSnapshot;
|
|
@@ -65,7 +65,6 @@ export declare type pluginEvent<T = unknown> = {
|
|
|
65
65
|
payload: T;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
export declare type styleSheetEvent = {};
|
|
69
68
|
export declare enum IncrementalSource {
|
|
70
69
|
Mutation = 0,
|
|
71
70
|
MouseMove = 1,
|
|
@@ -140,7 +139,7 @@ export declare type SamplingStrategy = Partial<{
|
|
|
140
139
|
}>;
|
|
141
140
|
export declare type RecordPlugin<TOptions = unknown> = {
|
|
142
141
|
name: string;
|
|
143
|
-
observer?: (cb:
|
|
142
|
+
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
144
143
|
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
145
144
|
options: TOptions;
|
|
146
145
|
};
|
|
@@ -207,8 +206,8 @@ export declare type observerParam = {
|
|
|
207
206
|
canvasManager: CanvasManager;
|
|
208
207
|
enableStrictPrivacy: boolean;
|
|
209
208
|
plugins: Array<{
|
|
210
|
-
observer:
|
|
211
|
-
callback:
|
|
209
|
+
observer: (cb: (...arg: Array<unknown>) => void, win: IWindow, options: unknown) => listenerHandler;
|
|
210
|
+
callback: (...arg: Array<unknown>) => void;
|
|
212
211
|
options: unknown;
|
|
213
212
|
}>;
|
|
214
213
|
};
|
package/typings/utils.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type { IMirror, Mirror } from '@highlight-run/rrweb-snapshot';
|
|
|
3
3
|
import type { RRNode, RRIFrameElement } from '@highlight-run/rrdom';
|
|
4
4
|
export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
|
|
5
5
|
export declare let _mirror: DeprecatedMirror;
|
|
6
|
-
export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (
|
|
6
|
+
export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (...args: T[]) => void;
|
|
7
7
|
export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
|
|
8
8
|
export declare function patch(source: {
|
|
9
9
|
[key: string]: any;
|
|
10
|
-
}, name: string, replacement: (...args:
|
|
10
|
+
}, name: string, replacement: (...args: unknown[]) => unknown): () => void;
|
|
11
11
|
export declare function getWindowHeight(): number;
|
|
12
12
|
export declare function getWindowWidth(): number;
|
|
13
13
|
export declare const isCanvasNode: (node: Node | null) => boolean;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// An event handler can take an optional event argument
|
|
3
|
-
// and should not return a value
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// An array of all currently registered event handlers for a type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// A map of event types and their corresponding event handlers.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/** Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
17
|
-
* @name mitt
|
|
18
|
-
* @returns {Mitt}
|
|
19
|
-
*/
|
|
20
|
-
function mitt(all ) {
|
|
21
|
-
all = all || Object.create(null);
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
/**
|
|
25
|
-
* Register an event handler for the given type.
|
|
26
|
-
*
|
|
27
|
-
* @param {String} type Type of event to listen for, or `"*"` for all events
|
|
28
|
-
* @param {Function} handler Function to call in response to given event
|
|
29
|
-
* @memberOf mitt
|
|
30
|
-
*/
|
|
31
|
-
on: function on(type , handler ) {
|
|
32
|
-
(all[type] || (all[type] = [])).push(handler);
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Remove an event handler for the given type.
|
|
37
|
-
*
|
|
38
|
-
* @param {String} type Type of event to unregister `handler` from, or `"*"`
|
|
39
|
-
* @param {Function} handler Handler function to remove
|
|
40
|
-
* @memberOf mitt
|
|
41
|
-
*/
|
|
42
|
-
off: function off(type , handler ) {
|
|
43
|
-
if (all[type]) {
|
|
44
|
-
all[type].splice(all[type].indexOf(handler) >>> 0, 1);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Invoke all handlers for the given type.
|
|
50
|
-
* If present, `"*"` handlers are invoked after type-matched handlers.
|
|
51
|
-
*
|
|
52
|
-
* @param {String} type The event type to invoke
|
|
53
|
-
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
54
|
-
* @memberOf mitt
|
|
55
|
-
*/
|
|
56
|
-
emit: function emit(type , evt ) {
|
|
57
|
-
(all[type] || []).slice().map(function (handler) { handler(evt); });
|
|
58
|
-
(all['*'] || []).slice().map(function (handler) { handler(type, evt); });
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { mitt as default };
|