diff --git a/.changeset/fair-seahorses-care.md b/.changeset/fair-seahorses-care.md index 469ac4f24f..f8f0d9da6f 100644 --- a/.changeset/fair-seahorses-care.md +++ b/.changeset/fair-seahorses-care.md @@ -1,5 +1,5 @@ --- -"rrweb": patch +'rrweb': patch --- Use native setTimeout when zone.js is present diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 6e6b112f16..a8401393c7 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -25,7 +25,7 @@ import { getInputType, toLowerCase, extractFileExtension, - nativeSetTimeout, + nativeSetTimeout } from './utils'; let _id = 1; diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 88d9c8a718..2f90b78e4c 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -4,7 +4,6 @@ import type { MaskInputFn, MaskInputOptions, nodeMetaMap, - NodeType, serializedNodeWithId, serializedNode, documentNode, @@ -14,6 +13,8 @@ import type { IWindow, } from './types'; +import { NodeType } from './types'; + export function isElement(n: Node): n is Element { return n.nodeType === n.ELEMENT_NODE; } diff --git a/packages/rrweb/src/utils.ts b/packages/rrweb/src/utils.ts index 0aca95dcaf..fb9a9ce5be 100644 --- a/packages/rrweb/src/utils.ts +++ b/packages/rrweb/src/utils.ts @@ -10,10 +10,8 @@ import type { textMutation, } from '@rrweb/types'; import type { IMirror, Mirror, SlimDOMOptions } from 'rrweb-snapshot'; +import { isShadowRoot, IGNORED_NODE, classMatchesRegex } from 'rrweb-snapshot'; import { - isShadowRoot, - IGNORED_NODE, - classMatchesRegex, getNative, nativeSetTimeout } from 'rrweb-snapshot'; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index f20f5ab4f4..e71c84f42d 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -708,3 +708,5 @@ export { IWindow }; // Types for @rrweb/packer export type PackFn = (event: eventWithTime) => string; export type UnpackFn = (raw: string) => eventWithTime; + +export { IWindow };