Skip to content
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

ref(replay): Move @sentry/replay code to @sentry-internal/replay #11200

Merged
merged 4 commits into from
Mar 22, 2024
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
8 changes: 4 additions & 4 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ targets:
- name: npm
id: '@sentry-internal/tracing'
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
## 1.5 Replay package (browser only)
## 1.5 Replay Internal package (browser only)
- name: npm
id: '@sentry/replay'
includeNames: /^sentry-replay-\d.*\.tgz$/
## 1.6. OpenTelemetry package
id: '@sentry-internal/replay'
includeNames: /^sentry-internal-replay-\d.*\.tgz$/
## 1.6 OpenTelemetry package
- name: npm
id: '@sentry/opentelemetry'
includeNames: /^sentry-opentelemetry-\d.*\.tgz$/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Functional Software, Inc. dba Sentry
Copyright (c) 2024 Functional Software, Inc. dba Sentry

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
8 changes: 8 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ Removed top-level exports: `Offline`, `makeXHRTransport`, `BrowserTracing`, `wra
- [Removal of Offline integration](./MIGRATION.md#removal-of-the-offline-integration)
- [Removal of `makeXHRTransport` transport](./MIGRATION.md#removal-of-makexhrtransport-transport)
- [Removal of `wrap` method](./MIGRATION.md#removal-of-wrap-method)
- [Removal of `@sentry/angular-ivy` package](./MIGRATION.md#removal-of-sentryangular-ivy-package)
- [Removal of `@sentry/replay` package](./MIGRATION.md#removal-of-sentryreplay-package)

#### Removal of the `BrowserTracing` integration

Expand Down Expand Up @@ -605,6 +607,10 @@ requires at least Angular 14. If you are using Angular 13 or lower, we suggest u
migrating to v8. If you can't upgrade your Angular version to at least Angular 14, you can also continue using the
`@sentry/angular-ivy@7` SDK. However, v7 of the SDKs will no longer be fully supported going forward.

#### Removal of `@sentry/replay` package

You can import from `@sentry/browser` (or from a respective SDK package like `@sentry/react` or `@sentry/vue`).

### Server-side SDKs (Node, Deno, Bun, etc.)

Removed top-level exports: `enableAnrDetection`, `Anr`, `deepReadDirSync`
Expand Down Expand Up @@ -907,6 +913,8 @@ SDK.
- [Updated behaviour of `transactionContext` passed to `tracesSampler`](./MIGRATION.md#transactioncontext-no-longer-passed-to-tracessampler)
- [Updated behaviour of `getClient()`](./MIGRATION.md#getclient-always-returns-a-client)
- [Removal of Client-Side health check transaction filters](./MIGRATION.md#removal-of-client-side-health-check-transaction-filters)
- [Change of Replay default options (`unblock` and `unmask`)](./MIGRATION.md#change-of-replay-default-options-unblock-and-unmask)
- [Angular Tracing Decorator renaming](./MIGRATION.md#angular-tracing-decorator-renaming)
Comment on lines +916 to +917
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that there is a TOC for every sub-heading so I added the missing ones :)


#### Updated behaviour of `tracePropagationTargets` in the browser (HTTP tracing headers & CORS)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Besides the high-level SDKs, this repository contains shared packages, helpers a
development. If you're thinking about contributing to or creating a JavaScript-based SDK, have a look at the resources
below:

- [`@sentry/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay): Provides the
integration for Session Replay.
- [`@sentry-internal/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay-internal):
Provides the integration for Session Replay.
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
JavaScript SDKs with interfaces, type definitions and base classes.
- [`@sentry/utils`](https://github.com/getsentry/sentry-javascript/tree/master/packages/utils): A set of helpers and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@playwright/test';
import type { replayIntegration as actualReplayIntegration } from '@sentry/replay';
import type { ReplayContainer } from '@sentry/replay/build/npm/types/types';
import type { replayIntegration as actualReplayIntegration } from '@sentry-internal/replay';
import type { ReplayContainer } from '@sentry-internal/replay/build/npm/types/types';

import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequest } from '../../../utils/helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { replayIntegration } from '@sentry-internal/replay';
import * as Sentry from '@sentry/browser';
import { replayIntegration } from '@sentry/replay';

window.Sentry = Sentry;
window.Replay = replayIntegration({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SDK_VERSION } from '@sentry/browser';
import { sentryTest } from '../../../utils/fixtures';
import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../utils/replayHelpers';

sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTestPath, page }) => {
sentryTest('should capture replays (@sentry-internal/replay export)', async ({ getLocalTestPath, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class SentryScenarioGenerationPlugin {
? {
// To help Webpack resolve Sentry modules in `import` statements in cases where they're provided in bundles rather than in `node_modules`
'@sentry/browser': 'Sentry',
'@sentry/replay': 'Sentry',
'@sentry-internal/replay': 'Sentry',
'@sentry/wasm': 'Sentry',
}
: {};
Expand Down
8 changes: 4 additions & 4 deletions dev-packages/browser-integration-tests/utils/replayHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { Page, Request, Response } from '@playwright/test';
/* eslint-disable max-lines */
import type { ReplayCanvasIntegrationOptions } from '@sentry-internal/replay-canvas';
import type { fullSnapshotEvent, incrementalSnapshotEvent } from '@sentry-internal/rrweb';
import { EventType } from '@sentry-internal/rrweb';
import type { ReplayEventWithTime } from '@sentry/browser';
import type {
InternalEventContext,
RecordingEvent,
ReplayContainer,
ReplayPluginOptions,
Session,
} from '@sentry/replay/build/npm/types/types';
} from '@sentry-internal/replay/build/npm/types/types';
import type { fullSnapshotEvent, incrementalSnapshotEvent } from '@sentry-internal/rrweb';
import { EventType } from '@sentry-internal/rrweb';
import type { ReplayEventWithTime } from '@sentry/browser';
import type { Breadcrumb, Event, ReplayEvent, ReplayRecordingMode } from '@sentry/types';
import pako from 'pako';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryReplay from '@sentry-internal/replay';
// biome-ignore lint/nursery/noUnusedImports: we need to import the SDK to ensure tsc check the types
import * as _SentryBrowser from '@sentry/browser';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryCore from '@sentry/core';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryNode from '@sentry/node';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryReplay from '@sentry/replay';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryTypes from '@sentry/types';
// biome-ignore lint/nursery/noUnusedImports:
import * as _SentryUtils from '@sentry/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@sentry/browser": "latest || *",
"@sentry/core": "latest || *",
"@sentry/node": "latest || *",
"@sentry/replay": "latest || *",
"@sentry-internal/replay": "latest || *",
"@sentry/types": "latest || *",
"@sentry/utils": "latest || *",
"@sentry/wasm": "latest || *"
Expand Down
6 changes: 0 additions & 6 deletions dev-packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/replay':
access: $all
publish: $all
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!
Comment on lines -125 to -129
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to just delete this (instead of renaming), as there is '@sentry-internal/*' further down.


'@sentry/aws-serverless':
access: $all
publish: $all
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"packages/profiling-node",
"packages/react",
"packages/remix",
"packages/replay",
"packages/replay-internal",
"packages/replay-canvas",
"packages/replay-worker",
"packages/svelte",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
},
"dependencies": {
"@sentry-internal/feedback": "8.0.0-alpha.4",
"@sentry-internal/replay": "8.0.0-alpha.4",
"@sentry-internal/replay-canvas": "8.0.0-alpha.4",
"@sentry-internal/tracing": "8.0.0-alpha.4",
"@sentry/core": "8.0.0-alpha.4",
"@sentry/replay": "8.0.0-alpha.4",
"@sentry/types": "8.0.0-alpha.4",
"@sentry/utils": "8.0.0-alpha.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/rollup.bundle.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const tracingBaseBundleConfig = makeBaseBundleConfig({
const replayBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.replay.ts'],
licenseTitle: '@sentry/browser & @sentry/replay',
licenseTitle: '@sentry/browser (Replay)',
outputFileBase: () => 'bundles/bundle.replay',
});

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
browserTracingIntegrationShim,
feedbackIntegrationShim,
} from '@sentry-internal/integration-shims';
import { replayIntegration } from '@sentry/replay';
import { replayIntegration } from '@sentry-internal/replay';

export * from './index.bundle.base';
export {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { feedbackIntegration } from '@sentry-internal/feedback';
import { replayIntegration } from '@sentry-internal/replay';
import { browserTracingIntegration } from '@sentry-internal/tracing';
import { addTracingExtensions } from '@sentry/core';
import { replayIntegration } from '@sentry/replay';

// We are patching the global object with our hub extension methods
addTracingExtensions();
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.bundle.tracing.replay.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
import { replayIntegration } from '@sentry-internal/replay';
import { browserTracingIntegration } from '@sentry-internal/tracing';
import { addTracingExtensions } from '@sentry/core';
import { replayIntegration } from '@sentry/replay';

// We are patching the global object with our hub extension methods
addTracingExtensions();
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export {
export {
replayIntegration,
getReplay,
} from '@sentry/replay';
} from '@sentry-internal/replay';
export type {
ReplayEventType,
ReplayEventWithTime,
Expand All @@ -43,7 +43,7 @@ export type {
ReplayFrameEvent,
ReplaySpanFrame,
ReplaySpanFrameEvent,
} from '@sentry/replay';
} from '@sentry-internal/replay';

export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';

Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/test/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@sentry/node-experimental": "file:../../../node",
"@sentry/opentelemetry": "file:../../../opentelemetry",
"@sentry/react": "file:../../../react",
"@sentry/replay": "file:../../../replay",
"@sentry-internal/replay": "file:../../../replay-internal",
"@sentry-internal/replay-canvas": "file:../../../replay-canvas",
"@sentry-internal/tracing": "file:../../../tracing-internal",
"@sentry-internal/feedback": "file:../../../feedback",
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/test/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@sentry/node": "file:../../../node-experimental",
"@sentry/opentelemetry": "file:../../../opentelemetry",
"@sentry/react": "file:../../../react",
"@sentry/replay": "file:../../../replay",
"@sentry-internal/replay": "file:../../../replay-internal",
"@sentry-internal/replay-canvas": "file:../../../replay-canvas",
"@sentry-internal/tracing": "file:../../../tracing-internal",
"@sentry-internal/feedback": "file:../../../feedback",
Expand Down
2 changes: 1 addition & 1 deletion packages/replay-canvas/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
When
[updating the `rrweb` dependency](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/package.json?plain=1#LL55),
please be aware that
[`@sentry/replay`'s README.md](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/README.md?plain=1#LL204)
[`@sentry-internal/replay`'s README.md](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/README.md?plain=1#LL204)
also needs to be updated.
2 changes: 1 addition & 1 deletion packages/replay-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"dependencies": {
"@sentry/core": "8.0.0-alpha.4",
"@sentry/replay": "8.0.0-alpha.4",
"@sentry-internal/replay": "8.0.0-alpha.4",
"@sentry/types": "8.0.0-alpha.4",
"@sentry/utils": "8.0.0-alpha.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/replay-canvas/src/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CanvasManagerInterface, CanvasManagerOptions } from '@sentry-internal/replay';
import { CanvasManager } from '@sentry-internal/rrweb';
import { defineIntegration } from '@sentry/core';
import type { CanvasManagerInterface, CanvasManagerOptions } from '@sentry/replay';
import type { IntegrationFn } from '@sentry/types';

interface ReplayCanvasOptions {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
When
[updating the `rrweb` dependency](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/package.json?plain=1#LL55),
please be aware that
[`@sentry/replay`'s README.md](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/README.md?plain=1#LL204)
[`@sentry-internal/replay`'s README.md](https://github.com/getsentry/sentry-javascript/blob/a493aa6a46555b944c8d896a2164bcd8b11caaf5/packages/replay/README.md?plain=1#LL204)
also needs to be updated.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

# Sentry Session Replay

[![npm version](https://img.shields.io/npm/v/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)
[![npm dm](https://img.shields.io/npm/dm/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)
[![npm dt](https://img.shields.io/npm/dt/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)
[![npm version](https://img.shields.io/npm/v/@sentry-internal/replay.svg)](https://www.npmjs.com/package/@sentry-internal/replay)
[![npm dm](https://img.shields.io/npm/dm/@sentry-internal/replay.svg)](https://www.npmjs.com/package/@sentry-internal/replay)
[![npm dt](https://img.shields.io/npm/dt/@sentry-internal/replay.svg)](https://www.npmjs.com/package/@sentry-internal/replay)

This is an internal package that is being re-exported in `@sentry/browser` and other browser-related SDKs like
`@sentry/react` or `@sentry/vue`.

## Pre-requisites

`@sentry/replay` requires Node 14+, and browsers newer than IE11.
`@sentry-internal/replay` requires Node 14+, and browsers newer than IE11.

## Installation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@sentry/replay",
"name": "@sentry-internal/replay",
"version": "8.0.0-alpha.4",
"description": "User replays for Sentry",
"main": "build/npm/cjs/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { makeBaseBundleConfig, makeBundleConfigVariants } from '@sentry-internal
const baseBundleConfig = makeBaseBundleConfig({
bundleType: 'addon',
entrypoints: ['src/index.ts'],
licenseTitle: '@sentry/replay',
licenseTitle: '@sentry-internal/replay',
outputFileBase: () => 'bundles/replay',
});

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/replay-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

# Sentry Session Replay Worker

This is an internal package that is used by @sentry/replay. It generates a web worker and converts it to a string, so
that we can process it easier in replay.
This is an internal package that is used by @sentry-internal/replay. It generates a web worker and converts it to a
string, so that we can process it easier in replay.

By extracting this into a dedicated (private, internal) package, we can streamline the build of replay.

Expand Down
2 changes: 1 addition & 1 deletion packages/replay-worker/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/replay-worker",
"version": "8.0.0-alpha.4",
"description": "Worker for @sentry/replay",
"description": "Worker for @sentry-internal/replay",
"main": "build/npm/esm/index.js",
"module": "build/npm/esm/index.js",
"types": "build/npm/types/index.d.ts",
Expand Down
Loading
Loading