Skip to content

Commit

Permalink
need to make webperformance deprecation safe to release
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Nov 21, 2023
1 parent a862890 commit ec154b6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,16 @@ const create_phlib = function (
}

class DeprecatedWebPerformanceObserver {
set forceAllowLocalhost(value: boolean) {
get _forceAllowLocalhost(): boolean {
return this.__forceAllowLocalhost
}
set _forceAllowLocalhost(value: boolean) {
logger.error(
'WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`'
)
this._forceAllowLocalhost = value
this.__forceAllowLocalhost = value
}
private _forceAllowLocalhost: boolean = false
private __forceAllowLocalhost: boolean = false
}

/**
Expand All @@ -283,7 +286,7 @@ export class PostHog {
_requestQueue?: RequestQueue
_retryQueue?: RetryQueue
sessionRecording?: SessionRecording
webPerformance?: DeprecatedWebPerformanceObserver
webPerformance = new DeprecatedWebPerformanceObserver()

_triggered_notifs: any
compression: Partial<Record<Compression, boolean>>
Expand Down Expand Up @@ -445,7 +448,6 @@ export class PostHog {
this.__request_queue = []

this.sessionManager = new SessionIdManager(this.config, this.persistence)
this.webPerformance = new DeprecatedWebPerformanceObserver()
this.sessionPropsManager = new SessionPropsManager(this.sessionManager, this.persistence)
this.sessionPersistence =
this.config.persistence === 'sessionStorage'
Expand Down

0 comments on commit ec154b6

Please sign in to comment.