-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(feedback): Include Feedback package in browser SDK (#9586)
Add feedback to craft publish list, and export `Feedback` integration from browser SDK Depends on - [x] #9588 - [x] #9604 Relates to: getsentry/team-replay#273
- Loading branch information
Showing
23 changed files
with
238 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This is exported so the loader does not fail when switching off Replay/Tracing | ||
import { Feedback } from '@sentry-internal/feedback'; | ||
import { BrowserTracing, Replay, addTracingExtensions } from '@sentry-internal/integration-shims'; | ||
|
||
import * as Sentry from './index.bundle.base'; | ||
|
||
// TODO (v8): Remove this as it was only needed for backwards compatibility | ||
Sentry.Integrations.Replay = Replay; | ||
|
||
Sentry.Integrations.BrowserTracing = BrowserTracing; | ||
|
||
export * from './index.bundle.base'; | ||
export { BrowserTracing, addTracingExtensions, Replay, Feedback }; | ||
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/browser/src/index.bundle.tracing.replay.feedback.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Feedback } from '@sentry-internal/feedback'; | ||
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing'; | ||
import { Replay } from '@sentry/replay'; | ||
|
||
import * as Sentry from './index.bundle.base'; | ||
|
||
// TODO (v8): Remove this as it was only needed for backwards compatibility | ||
// We want replay to be available under Sentry.Replay, to be consistent | ||
// with the NPM package version. | ||
Sentry.Integrations.Replay = Replay; | ||
|
||
Sentry.Integrations.BrowserTracing = BrowserTracing; | ||
|
||
// We are patching the global object with our hub extension methods | ||
addExtensionMethods(); | ||
|
||
export { Feedback, Replay, BrowserTracing, Span, addExtensionMethods }; | ||
export * from './index.bundle.base'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { BrowserTracing as BrowserTracingShim, Replay as ReplayShim } from '@sentry-internal/integration-shims'; | ||
import { Feedback } from '@sentry/browser'; | ||
|
||
import * as TracingReplayBundle from '../../src/index.bundle.feedback'; | ||
|
||
describe('index.bundle.feedback', () => { | ||
it('has correct exports', () => { | ||
Object.keys(TracingReplayBundle.Integrations).forEach(key => { | ||
// Skip BrowserTracing because it doesn't have a static id field. | ||
if (key === 'BrowserTracing') { | ||
return; | ||
} | ||
|
||
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String)); | ||
}); | ||
|
||
expect(TracingReplayBundle.Integrations.Replay).toBe(ReplayShim); | ||
expect(TracingReplayBundle.Replay).toBe(ReplayShim); | ||
|
||
expect(TracingReplayBundle.Integrations.BrowserTracing).toBe(BrowserTracingShim); | ||
expect(TracingReplayBundle.BrowserTracing).toBe(BrowserTracingShim); | ||
|
||
expect(TracingReplayBundle.Feedback).toBe(Feedback); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/browser/test/unit/index.bundle.tracing.replay.feedback.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { BrowserTracing } from '@sentry-internal/tracing'; | ||
import { Feedback, Replay } from '@sentry/browser'; | ||
|
||
import * as TracingReplayFeedbackBundle from '../../src/index.bundle.tracing.replay.feedback'; | ||
|
||
describe('index.bundle.tracing.replay.feedback', () => { | ||
it('has correct exports', () => { | ||
Object.keys(TracingReplayFeedbackBundle.Integrations).forEach(key => { | ||
// Skip BrowserTracing because it doesn't have a static id field. | ||
if (key === 'BrowserTracing') { | ||
return; | ||
} | ||
|
||
expect((TracingReplayFeedbackBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String)); | ||
}); | ||
|
||
expect(TracingReplayFeedbackBundle.Integrations.Replay).toBe(Replay); | ||
expect(TracingReplayFeedbackBundle.Replay).toBe(Replay); | ||
|
||
expect(TracingReplayFeedbackBundle.Integrations.BrowserTracing).toBe(BrowserTracing); | ||
expect(TracingReplayFeedbackBundle.BrowserTracing).toBe(BrowserTracing); | ||
|
||
expect(TracingReplayFeedbackBundle.Feedback).toBe(Feedback); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.