Skip to content

Commit f1a5c96

Browse files
committed
♻️ remove plugin
1 parent 4f7da97 commit f1a5c96

File tree

9 files changed

+22
-224
lines changed

9 files changed

+22
-224
lines changed

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,9 @@ import type {
3434
} from '../domain/vital/vitalCollection'
3535
import { startDurationVital, stopDurationVital } from '../domain/vital/vitalCollection'
3636
import { callPluginsMethod } from '../domain/plugins'
37-
import { createStreamPlugin } from '../domain/stream'
3837
import type { StartRumResult } from './startRum'
3938
import type { RumPublicApiOptions, Strategy } from './rumPublicApi'
4039

41-
declare global {
42-
interface Window {
43-
DD_STREAM_PLUGIN: ReturnType<typeof createStreamPlugin>
44-
DD_STREAM: ReturnType<ReturnType<typeof createStreamPlugin>['createStream']>
45-
}
46-
}
47-
4840
export function createPreStartStrategy(
4941
{ ignoreInitIfSyntheticsWillInjectRum = true, startDeflateWorker }: RumPublicApiOptions,
5042
trackingConsentState: TrackingConsentState,
@@ -188,10 +180,6 @@ export function createPreStartStrategy(
188180
initFeatureFlags(initConfiguration.enableExperimentalFeatures)
189181

190182
// Expose the initial configuration regardless of initialization success.
191-
window.DD_STREAM_PLUGIN = createStreamPlugin()
192-
window.DD_STREAM = window.DD_STREAM_PLUGIN.createStream()
193-
194-
initConfiguration.plugins = (initConfiguration.plugins ?? []).concat([window.DD_STREAM_PLUGIN.plugin])
195183
cachedInitConfiguration = initConfiguration
196184

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

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)