Skip to content

Commit d17aa2b

Browse files
niieanixnanodax
authored andcommitted
feat: export new utilities and move things around
1 parent ef2e863 commit d17aa2b

File tree

7 files changed

+10
-26
lines changed

7 files changed

+10
-26
lines changed

src/main.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,6 @@ export { performanceMark, performanceMeasure } from './performanceMark'
2929
export { switchFn } from './switchFn'
3030
export { getCurrentBrowserSupportForNonResponsiveStateDetection } from './utilities'
3131

32-
// visualizer
33-
// export {
34-
// getTimingDisplayModule,
35-
// onActionAddedCallback,
36-
// useVisualizer,
37-
// } from './lazyVisualizer'
38-
39-
// operation tracking (v2)
40-
// export * from './v2/constants'
41-
// export * from './v2/defaultEventProcessor'
42-
// export * from './v2/element'
43-
// export * from './v2/getCommonUrlForTracing'
44-
// export * from './v2/hooks'
45-
// export * from './v2/operation'
46-
// export type * from './v2/types'
47-
4832
// v3
4933
export * from './v3/constants'
5034
export * from './v3/convertToRum'
@@ -60,6 +44,8 @@ export * from './v3/Tracer'
6044
// eslint-disable-next-line import/first, import/newline-after-import
6145
import * as match from './v3/matchSpan'
6246
export { match }
47+
export * from './v3/ConsoleTraceLogger'
48+
export type * from './v3/debugTypes'
6349
export type {
6450
NameMatcher,
6551
SpanMatch,
@@ -72,6 +58,7 @@ export * from './v3/recordingComputeUtils'
7258
export type * from './v3/spanAnnotationTypes'
7359
export type * from './v3/spanTypes'
7460
export * from './v3/TraceManager'
61+
export * from './v3/TraceManagerDebugger'
7562
export type * from './v3/traceRecordingTypes'
7663
export type * from './v3/types'
7764
export type * from './v3/typeUtils'

src/stories/mockComponentsv3/simulateLongTasks.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
export function triggerLongTasks({
32
minTime,
43
maxTime,
@@ -20,25 +19,25 @@ export function triggerLongTasks({
2019
const endTime = Date.now()
2120

2221
if (controller.signal.aborted) {
23-
console.log('Cluster aborted.')
22+
// console.log('Cluster aborted.')
2423
return
2524
}
2625

2726
if (endTime - startTime < totalClusterDuration) {
28-
console.log(`Starting long task for ${taskDuration} ms`)
27+
// console.log(`Starting long task for ${taskDuration} ms`)
2928
const taskEnd = Date.now() + taskDuration
3029

3130
// Simulating a blocking long task
3231
while (Date.now() < taskEnd) {
3332
if (controller.signal.aborted) {
34-
console.log('Task aborted.')
33+
// console.log('Task aborted.')
3534
return
3635
}
3736
}
3837

3938
executeLongTask() // Trigger the next task
4039
} else {
41-
console.log('Completed all tasks within the cluster duration.')
40+
// console.log('Completed all tasks within the cluster duration.')
4241
}
4342
}
4443

src/v3/ConsoleTraceLogger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
AllPossibleRequiredSpanSeenEvents,
33
AllPossibleStateTransitionEvents,
44
AllPossibleTraceStartEvents,
5-
} from './debug'
5+
} from './debugTypes'
66
import type { SpanMatcherFn } from './matchSpan'
77
import type { OnEnterStatePayload } from './Trace'
88
import { isTerminalState } from './Trace'

src/v3/Trace.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
DEFAULT_DEBOUNCE_DURATION,
88
DEFAULT_INTERACTIVE_TIMEOUT_DURATION,
99
} from './constants'
10-
import type { RequiredSpanSeenEvent, StateTransitionEvent } from './debug'
10+
import type { RequiredSpanSeenEvent, StateTransitionEvent } from './debugTypes'
1111
import { convertMatchersToFns } from './ensureMatcherFn'
1212
import { ensureTimestamp } from './ensureTimestamp'
1313
import {

src/v3/TraceManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
AllPossibleRequiredSpanSeenEvents,
55
AllPossibleStateTransitionEvents,
66
AllPossibleTraceStartEvents,
7-
} from './debug'
7+
} from './debugTypes'
88
import {
99
convertLabelMatchersToFns,
1010
convertMatchersToFns,
File renamed without changes.

src/v3/tracerDefinitions.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,13 @@ describe('Trace Definitions', () => {
326326
},
327327
computedValueDefinitions: {
328328
'feature-count': {
329-
// @ts-expect-error TODO: broken inference
330329
matches: [match.withName('feature'), match.withName('feature-2')],
331330
computeValueFromMatches: (feature, feature2) =>
332331
// @ts-expect-error unexpected TS error
333332
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
334333
feature.length + feature2.length,
335334
},
336335
'error-count': {
337-
// @ts-expect-error TODO: broken inference
338336
matches: [match.withName((name) => name.startsWith('error'))],
339337
// @ts-expect-error unexpected TS error
340338
computeValueFromMatches: (errors) => errors.length,

0 commit comments

Comments
 (0)