Skip to content

build(replay): Remove replay version string replacement #6367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/replay/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { Transport } from '@sentry/types';
import { Replay } from './src';
import { Session } from './src/session/Session';

// @ts-ignore TS error, this is replaced in prod builds bc of rollup
global.__SENTRY_REPLAY_VERSION__ = 'version:Test';

type MockTransport = jest.MockedFunction<Transport['send']>;

jest.mock('./src/util/isBrowser', () => {
Expand Down
11 changes: 0 additions & 11 deletions packages/replay/rollup.npm.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import replace from '@rollup/plugin-replace';

import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index';

import pkg from './package.json';
Expand All @@ -9,15 +7,6 @@ export default makeNPMConfigVariants(
hasBundles: true,
packageSpecificConfig: {
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
plugins: [
// TODO: Remove this - replay version will be in sync w/ SDK version
replace({
preventAssignment: true,
values: {
__SENTRY_REPLAY_VERSION__: JSON.stringify(pkg.version),
},
}),
],
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn about
// the default export in `worker/worker.js`
Expand Down
4 changes: 2 additions & 2 deletions packages/replay/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-lines */ // TODO: We might want to split this file up
import { WINDOW } from '@sentry/browser';
import { addGlobalEventProcessor, getCurrentHub, Scope, setContext } from '@sentry/core';
import { addGlobalEventProcessor, getCurrentHub, Scope, SDK_VERSION, setContext } from '@sentry/core';
import { Breadcrumb, Client, Event, Integration } from '@sentry/types';
import { addInstrumentationHandler, createEnvelope, logger } from '@sentry/utils';
import debounce from 'lodash.debounce';
Expand Down Expand Up @@ -1208,7 +1208,7 @@ export class Replay implements Integration {

const sdkInfo = {
name: 'sentry.javascript.integration.replay',
version: __SENTRY_REPLAY_VERSION__,
version: SDK_VERSION,
};

const replayEvent = await new Promise(resolve => {
Expand Down
4 changes: 0 additions & 4 deletions packages/replay/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export interface WorkerRequest {
args: unknown[];
}

declare global {
const __SENTRY_REPLAY_VERSION__: string;
}

// PerformancePaintTiming and PerformanceNavigationTiming are only available with TS 4.4 and newer
// Therefore, we're exporting them here to make them available in older TS versions
export type PerformancePaintTiming = PerformanceEntry;
Expand Down