Skip to content

Commit f91ecbf

Browse files
committed
♻️ remove plugin
1 parent 3dbd2d2 commit f91ecbf

File tree

10 files changed

+23
-225
lines changed

10 files changed

+23
-225
lines changed

packages/rum-core/src/boot/preStartRum.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@ import type { ViewOptions } from '../domain/view/trackViews'
2828
import type { DurationVital, CustomVitalsState } from '../domain/vital/vitalCollection'
2929
import { startDurationVital, stopDurationVital } from '../domain/vital/vitalCollection'
3030
import { callPluginsMethod } from '../domain/plugins'
31-
import { createStreamPlugin } from '../domain/stream'
3231
import type { StartRumResult } from './startRum'
3332
import type { RumPublicApiOptions, Strategy } from './rumPublicApi'
3433

35-
declare global {
36-
interface Window {
37-
DD_STREAM_PLUGIN: ReturnType<typeof createStreamPlugin>
38-
DD_STREAM: ReturnType<ReturnType<typeof createStreamPlugin>['createStream']>
39-
}
40-
}
41-
4234
export function createPreStartStrategy(
4335
{ ignoreInitIfSyntheticsWillInjectRum = true, startDeflateWorker }: RumPublicApiOptions,
4436
trackingConsentState: TrackingConsentState,
@@ -166,10 +158,6 @@ export function createPreStartStrategy(
166158
initFeatureFlags(initConfiguration.enableExperimentalFeatures)
167159

168160
// Expose the initial configuration regardless of initialization success.
169-
window.DD_STREAM_PLUGIN = createStreamPlugin()
170-
window.DD_STREAM = window.DD_STREAM_PLUGIN.createStream()
171-
172-
initConfiguration.plugins = (initConfiguration.plugins ?? []).concat([window.DD_STREAM_PLUGIN.plugin])
173161
cachedInitConfiguration = initConfiguration
174162

175163
// If we are in a Synthetics test configured to automatically inject a RUM instance, we want

packages/rum-core/src/domain/assembly.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@datadog/browser-core'
1313
import type { RumEventDomainContext } from '../domainContext.types'
1414
import { RumEventType } from '../rawRumEvent.types'
15-
import type { RumEvent, RumViewEvent, RumVitalEvent } from '../rumEvent.types'
15+
import type { RumEvent, RumViewEvent } from '../rumEvent.types'
1616
import type { LifeCycle } from './lifeCycle'
1717
import { LifeCycleEventType } from './lifeCycle'
1818
import type { RumConfiguration } from './configuration'

packages/rum-core/src/domain/stream/index.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/rum-core/src/domain/stream/metric.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/rum-core/src/domain/stream/stream.ts

Lines changed: 0 additions & 100 deletions
This file was deleted.

packages/rum-core/src/domain/stream/timer.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/rum-core/src/domainContext.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type RumEventDomainContext<T extends RumEventType = any> = T extends type
1717
: T extends typeof RumEventType.VITAL
1818
? RumVitalEventDomainContext
1919
: T extends typeof RumEventType.STREAM
20-
? { streamId: string }
20+
? RumStreamEventDomainContext
2121
: never
2222

2323
export interface RumViewEventDomainContext {
@@ -62,4 +62,5 @@ export interface RumLongTaskEventDomainContext {
6262
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
6363
export interface RumVitalEventDomainContext {}
6464

65+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
6566
export interface RumStreamEventDomainContext {}

packages/rum-core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@ export type { Hooks, DefaultRumEventAttributes, DefaultTelemetryEventAttributes
7171
export { createHooks } from './domain/hooks'
7272
export { isSampled } from './domain/sampler/sampler'
7373
export type { TracingOption, PropagatorType } from './domain/tracing/tracer.types'
74-
export { createStreamPlugin } from './domain/stream'

packages/rum-core/test/fixtures.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ export function createRawRumEvent(type: RumEventType, overrides?: Context): RawR
119119
},
120120
overrides
121121
)
122+
case RumEventType.STREAM:
123+
return combine(
124+
{
125+
type,
126+
_dd: {
127+
document_version: 0,
128+
},
129+
date: 0 as TimeStamp,
130+
view: {
131+
id: generateUUID(),
132+
action: { count: 0 },
133+
error: { count: 0 },
134+
long_task: { count: 0 },
135+
resource: { count: 0 },
136+
time_spent: 0 as ServerDuration,
137+
},
138+
},
139+
overrides
140+
)
122141
}
123142
}
124143

packages/rum/src/entries/main.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
// Keep the following in sync with packages/rum-slim/src/entries/main.ts
1010
import { defineGlobal, getGlobalObject } from '@datadog/browser-core'
1111
import type { RumPublicApi } from '@datadog/browser-rum-core'
12-
import { createStreamPlugin, makeRumPublicApi, startRum } from '@datadog/browser-rum-core'
13-
import { createStream } from '@datadog/browser-rum-core/src/domain/stream/stream'
12+
import { makeRumPublicApi, startRum } from '@datadog/browser-rum-core'
1413
import { makeRecorderApi } from '../boot/recorderApi'
1514
import { createDeflateEncoder, startDeflateWorker } from '../domain/deflate'
1615
import { lazyLoadRecorder } from '../boot/lazyLoadRecorder'
1716
import { makeProfilerApi } from '../boot/profilerApi'
1817

19-
export { createStreamPlugin } from '@datadog/browser-rum-core'
20-
2118
export type {
2219
User,
2320
Account,

0 commit comments

Comments
 (0)