File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,14 @@ import {
6
6
type InputEvent ,
7
7
} from './types'
8
8
9
- export const defaultEventProcessor : EventProcessor = ( entry ) : Event => {
9
+ export const defaultEventProcessor : EventProcessor = (
10
+ entry ,
11
+ ) : Event | undefined => {
12
+ if ( entry . entryType === 'mark' && entry . name . startsWith ( '--' ) ) {
13
+ // react in dev mode hundreds of these marks, ignore them
14
+ return undefined
15
+ }
16
+
10
17
const detail = typeof entry . detail === 'object' && entry . detail
11
18
const metadata =
12
19
'metadata' in entry && typeof entry . metadata === 'object'
Original file line number Diff line number Diff line change @@ -15,19 +15,21 @@ import {
15
15
SKIP_PROCESSING ,
16
16
} from './constants'
17
17
import { defaultEventProcessor } from './defaultEventProcessor'
18
- import { FinalizationReason , OperationState } from './types'
19
18
import {
20
19
type CaptureInteractiveConfig ,
21
20
type Event ,
22
21
type EventMatchCriteria ,
23
22
type EventMatchFunction ,
23
+ type EventProcessor ,
24
24
type EventStatus ,
25
25
type InputEvent ,
26
26
type InstanceOptions ,
27
27
type ObserveFn ,
28
28
type OperationDefinition ,
29
29
type PerformanceApi ,
30
30
type PerformanceEntryLike ,
31
+ FinalizationReason ,
32
+ OperationState ,
31
33
} from './types'
32
34
33
35
/** returns the best supported blocking task type or undefined if none */
@@ -702,7 +704,7 @@ export class OperationManager {
702
704
* which will be updated by the manager with metadata related to the operations that have processed it.
703
705
* This will happen synchronously when running in unbuffered mode, and asynchronously when running in buffered mode.
704
706
*/
705
- private preprocessEvent : ( event : PerformanceEntryLike | InputEvent ) => Event
707
+ private preprocessEvent : EventProcessor
706
708
supportedEntryTypes : readonly string [ ]
707
709
expectBlockingTasks : boolean
708
710
@@ -830,6 +832,9 @@ export class OperationManager {
830
832
}
831
833
832
834
const event = this . preprocessEvent ( entry )
835
+ if ( ! event ) {
836
+ return undefined
837
+ }
833
838
834
839
if ( this . bufferDuration && ! this . isFlushingBuffer ) {
835
840
this . eventBuffer . push ( event )
Original file line number Diff line number Diff line change @@ -299,7 +299,9 @@ export interface PerformanceApi {
299
299
now : ( ) => number
300
300
}
301
301
302
- export type EventProcessor = ( entry : InputEvent | PerformanceEntryLike ) => Event
302
+ export type EventProcessor = (
303
+ entry : InputEvent | PerformanceEntryLike ,
304
+ ) => Event | undefined
303
305
304
306
export interface InstanceOptions {
305
307
defaultDebounceTime ?: number
You can’t perform that action at this time.
0 commit comments