Skip to content

Commit a9bf858

Browse files
authored
fix(replay): Export Replay from Sentry namespace in full CDN bundle (#7119)
To be consistent with export namespaces, we want the `Replay` integration to be accessible under `Sentry.Replay` in the full CDN bundles. This is backward compatible as we still permit `Sentry.Integrations.Replay` as well. We can remove it in v8.
1 parent 538c3a6 commit a9bf858

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- feat(replay): Send client_report when replay sending fails (#7093)
1414
- fix(node): `LocalVariables`, Improve frame matching for ESM (#7049)
1515
- fix(node): Add lru cache to http integration span map (#7064)
16+
- fix(replay): Export Replay from Sentry namespace in full CDN bundle (#7119)
1617

1718
Work in this release contributed by @JamesHenry. Thank you for your contribution!
1819

packages/tracing/src/index.bundle.replay.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { Replay } from '@sentry/browser';
22

33
import * as Sentry from './index.bundle';
44

5+
// TODO (v8): Remove this as it was only needed for backwards compatibility
6+
// We want replay to be available under Sentry.Replay, to be consistent
7+
// with the NPM package version.
58
Sentry.Integrations.Replay = Replay;
69

7-
export default Sentry;
10+
export { Replay };
11+
12+
export * from './index.bundle';

packages/tracing/test/index.bundle.replay.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Sentry from '../src/index.bundle.replay';
1+
import * as Sentry from '../src/index.bundle.replay';
22

33
// Because of the way how we re-export stuff for the replay bundle, we only have a single default export
44
const { Integrations } = Sentry;
@@ -15,5 +15,6 @@ describe('Integrations export', () => {
1515
});
1616

1717
expect(Integrations.Replay).toBeDefined();
18+
expect(Sentry.Replay).toBeDefined();
1819
});
1920
});

0 commit comments

Comments
 (0)