Skip to content

Commit 01f2da1

Browse files
[RUMF-848] fix last RRWeb issues
* Replace unnecessary RegExp constructor with a regexp value * Disable the rule on 'mutationBuffer', as I want to remove this in the future. * Remove unused `freezePage` function
1 parent 045ea85 commit 01f2da1

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

packages/rum-recorder/src/domain/rrweb-snapshot/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
SlimDOMOptions,
1313
} from './types'
1414

15-
const tagNameRegex = RegExp('[^a-z1-6-_]')
15+
const tagNameRegex = /[^a-z1-6-_]/
1616

1717
export const IGNORED_NODE = -2
1818

packages/rum-recorder/src/domain/rrweb/observer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import {
3939
throttle,
4040
} from './utils'
4141

42+
// TODO: remove this global MutationBuffer instance
43+
// eslint-disable-next-line local-rules/enforce-declarative-modules
4244
export const mutationBuffer = new MutationBuffer()
4345

4446
function initMutationObserver(

packages/rum-recorder/src/domain/rrweb/record.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getWindowHeight, getWindowWidth, mirror, on } from './utils'
66

77
let wrappedEmit!: (record: RawRecord, isCheckout?: boolean) => void
88

9-
function record(options: RecordOptions = {}): RecordAPI {
9+
export function record(options: RecordOptions = {}): RecordAPI {
1010
const {
1111
emit,
1212
checkoutEveryNms,
@@ -269,9 +269,3 @@ function record(options: RecordOptions = {}): RecordAPI {
269269
takeFullSnapshot,
270270
}
271271
}
272-
273-
record.freezePage = () => {
274-
mutationBuffer.freeze()
275-
}
276-
277-
export { record }

0 commit comments

Comments
 (0)