From 1bbf3cdbf337ced153d8d3d33c9aba39e9fa730d Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 19 Jan 2023 18:43:43 +0100 Subject: [PATCH 1/6] chore(repo): Format files with prettier (#19) --- packages/rrdom/src/style.ts | 75 +++--- packages/rrweb-player/src/Controller.svelte | 226 +++++++++--------- packages/rrweb-player/src/Player.svelte | 33 +-- .../rrweb-player/src/components/Switch.svelte | 12 +- packages/rrweb-player/tsconfig.json | 4 +- packages/rrweb-snapshot/src/rebuild.ts | 5 +- packages/rrweb-snapshot/src/snapshot.ts | 35 ++- packages/rrweb-snapshot/src/utils.ts | 4 +- packages/rrweb/src/packer/unpack.ts | 2 +- packages/rrweb/src/record/index.ts | 2 +- packages/rrweb/src/record/mutation.ts | 2 +- packages/rrweb/src/record/observer.ts | 7 +- packages/rrweb/test/events/ordering.ts | 4 +- 13 files changed, 225 insertions(+), 186 deletions(-) diff --git a/packages/rrdom/src/style.ts b/packages/rrdom/src/style.ts index 1e49b83619..fd57dee1a1 100644 --- a/packages/rrdom/src/style.ts +++ b/packages/rrdom/src/style.ts @@ -1,40 +1,39 @@ export function parseCSSText(cssText: string): Record { - const res: Record = {}; - const listDelimiter = /;(?![^(]*\))/g; - const propertyDelimiter = /:(.+)/; - cssText.split(listDelimiter).forEach(function (item) { - if (item) { - const tmp = item.split(propertyDelimiter); - tmp.length > 1 && (res[camelize(tmp[0].trim())] = tmp[1].trim()); - } - }); - return res; + const res: Record = {}; + const listDelimiter = /;(?![^(]*\))/g; + const propertyDelimiter = /:(.+)/; + cssText.split(listDelimiter).forEach(function (item) { + if (item) { + const tmp = item.split(propertyDelimiter); + tmp.length > 1 && (res[camelize(tmp[0].trim())] = tmp[1].trim()); + } + }); + return res; +} + +export function toCSSText(style: Record): string { + const properties = []; + for (let name in style) { + const value = style[name]; + if (typeof value !== 'string') continue; + const normalizedName = hyphenate(name); + properties.push(`${normalizedName}:${value};`); } - - export function toCSSText(style: Record): string { - const properties = []; - for (let name in style) { - const value = style[name]; - if (typeof value !== 'string') continue; - const normalizedName = hyphenate(name); - properties.push(`${normalizedName}:${value};`); - } - return properties.join(' '); - } - - /** - * Camelize a hyphen-delimited string. - */ - const camelizeRE = /-(\w)/g; - export const camelize = (str: string): string => { - return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : '')); - }; - - /** - * Hyphenate a camelCase string. - */ - const hyphenateRE = /\B([A-Z])/g; - export const hyphenate = (str: string): string => { - return str.replace(hyphenateRE, '-$1').toLowerCase(); - }; - \ No newline at end of file + return properties.join(' '); +} + +/** + * Camelize a hyphen-delimited string. + */ +const camelizeRE = /-(\w)/g; +export const camelize = (str: string): string => { + return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : '')); +}; + +/** + * Hyphenate a camelCase string. + */ +const hyphenateRE = /\B([A-Z])/g; +export const hyphenate = (str: string): string => { + return str.replace(hyphenateRE, '-$1').toLowerCase(); +}; diff --git a/packages/rrweb-player/src/Controller.svelte b/packages/rrweb-player/src/Controller.svelte index 33cfac775a..95b92ebb71 100644 --- a/packages/rrweb-player/src/Controller.svelte +++ b/packages/rrweb-player/src/Controller.svelte @@ -165,7 +165,7 @@ percent = 1; } const timeOffset = meta.totalTime * percent; - finished = false + finished = false; goto(timeOffset); }; @@ -188,8 +188,8 @@ export const triggerUpdateMeta = () => { Promise.resolve().then(() => { meta = replayer.getMetaData(); - }) - } + }); + }; onMount(() => { playerState = replayer.service.state.value as typeof playerState; @@ -237,99 +237,6 @@ }); - - {#if showController}
@@ -338,17 +245,20 @@ class="rr-progress" class:disabled={speedState === 'skipping'} bind:this={progress} - on:click={(event) => handleProgressClick(event)}> + on:click={(event) => handleProgressClick(event)} + >
+ style="width: {percentage}" + /> {#each customEvents as event}
+ {event.position};" + /> {/each}
@@ -365,7 +275,8 @@ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" - height="16"> + height="16" + > + 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z" + /> {:else} + height="16" + > + 512l-388.66944-233.32864 0 466.65728z" + /> {/if} @@ -401,7 +315,8 @@ {/each} @@ -409,7 +324,8 @@ id="skip" bind:checked={skipInactive} disabled={speedState === 'skipping'} - label="skip inactive" /> + label="skip inactive" + />
{/if} + + diff --git a/packages/rrweb-player/src/Player.svelte b/packages/rrweb-player/src/Player.svelte index 9e826ab199..d370ea3eca 100644 --- a/packages/rrweb-player/src/Player.svelte +++ b/packages/rrweb-player/src/Player.svelte @@ -23,7 +23,7 @@ export let tags: Record = {}; let replayer: Replayer; - + export const getMirror = () => replayer.getMirror(); const controllerHeight = 80; @@ -179,6 +179,22 @@ }); +
+
+ {#if replayer} + toggleFullscreen()} + /> + {/if} +
+ - -
-
- {#if replayer} - toggleFullscreen()} /> - {/if} -
diff --git a/packages/rrweb-player/src/components/Switch.svelte b/packages/rrweb-player/src/components/Switch.svelte index 9aa6862401..14d9ae9f75 100644 --- a/packages/rrweb-player/src/components/Switch.svelte +++ b/packages/rrweb-player/src/components/Switch.svelte @@ -5,6 +5,12 @@ export let label: string; +
+ +
+ - -
- -
diff --git a/packages/rrweb-player/tsconfig.json b/packages/rrweb-player/tsconfig.json index 77db65da2f..418c3aa556 100644 --- a/packages/rrweb-player/tsconfig.json +++ b/packages/rrweb-player/tsconfig.json @@ -1,5 +1,5 @@ { "extends": "@tsconfig/svelte/tsconfig.json", "include": ["src/**/*"], - "exclude": ["node_modules/*", "__sapper__/*", "public/*"], -} \ No newline at end of file + "exclude": ["node_modules/*", "__sapper__/*", "public/*"] +} diff --git a/packages/rrweb-snapshot/src/rebuild.ts b/packages/rrweb-snapshot/src/rebuild.ts index 847cdd0698..d4ec23f55b 100644 --- a/packages/rrweb-snapshot/src/rebuild.ts +++ b/packages/rrweb-snapshot/src/rebuild.ts @@ -215,7 +215,10 @@ function buildNode( n.attributes.rr_dataURL ) { // backup original img srcset - node.setAttribute('rrweb-original-srcset', n.attributes.srcset as string); + node.setAttribute( + 'rrweb-original-srcset', + n.attributes.srcset as string, + ); } else { node.setAttribute(name, value); } diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 10948ed4f3..a110517105 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -300,7 +300,10 @@ export function needMaskingText( } if (node.nodeType === node.ELEMENT_NODE) { if (unmaskTextSelector) { - if ((node as HTMLElement).matches(unmaskTextSelector) || (node as HTMLElement).closest(unmaskTextSelector)) { + if ( + (node as HTMLElement).matches(unmaskTextSelector) || + (node as HTMLElement).closest(unmaskTextSelector) + ) { return false; } } @@ -327,14 +330,29 @@ export function needMaskingText( return true; } } - return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector); + return needMaskingText( + node.parentNode, + maskTextClass, + maskTextSelector, + unmaskTextSelector, + ); } if (node.nodeType === node.TEXT_NODE) { // check parent node since text node do not have class name - return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector); + return needMaskingText( + node.parentNode, + maskTextClass, + maskTextSelector, + unmaskTextSelector, + ); } - return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector); + return needMaskingText( + node.parentNode, + maskTextClass, + maskTextSelector, + unmaskTextSelector, + ); } // https://stackoverflow.com/a/36155560 @@ -462,7 +480,7 @@ function serializeNode( n as HTMLElement, blockClass, blockSelector, - unblockSelector + unblockSelector, ); const tagName = getValidTagName(n as HTMLElement); let attributes: attributes = {}; @@ -681,7 +699,12 @@ function serializeNode( if ( !isStyle && !isScript && - needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector) && + needMaskingText( + n, + maskTextClass, + maskTextSelector, + unmaskTextSelector, + ) && textContent ) { textContent = maskTextFn diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 505516dbee..15adc27590 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -20,8 +20,8 @@ export function maskInputValue({ maskInputFn, }: { input: HTMLElement; - maskInputSelector: string|null; - unmaskInputSelector: string|null; + maskInputSelector: string | null; + unmaskInputSelector: string | null; maskInputOptions: MaskInputOptions; tagName: string; type: string | number | boolean | null; diff --git a/packages/rrweb/src/packer/unpack.ts b/packages/rrweb/src/packer/unpack.ts index 9211d7b593..8433bc68d1 100644 --- a/packages/rrweb/src/packer/unpack.ts +++ b/packages/rrweb/src/packer/unpack.ts @@ -16,7 +16,7 @@ export const unpack: UnpackFn = (raw: string) => { } try { const e: eventWithTimeAndPacker = JSON.parse( - strFromU8(unzlibSync(strToU8(raw, true))) + strFromU8(unzlibSync(strToU8(raw, true))), ); if (e.v === MARK) { return e; diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 210b0c89cd..101eb1338e 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -47,7 +47,7 @@ function record( blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', - ignoreSelector =null, + ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, maskInputSelector = null, diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index bcfea6ca6e..e193562663 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -459,7 +459,7 @@ export default class MutationBuffer { m.target, this.maskTextClass, this.maskTextSelector, - this.unmaskTextSelector + this.unmaskTextSelector, ) && value ? this.maskTextFn ? this.maskTextFn(value) diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index f740ebebf3..c9e38edb5b 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -352,7 +352,10 @@ function initInputObserver({ return; } const type: string | undefined = (target as HTMLInputElement).type; - if ((target as HTMLElement).classList.contains(ignoreClass) || (ignoreSelector && (target as HTMLElement).matches(ignoreSelector))) { + if ( + (target as HTMLElement).classList.contains(ignoreClass) || + (ignoreSelector && (target as HTMLElement).matches(ignoreSelector)) + ) { return; } let text = (target as HTMLInputElement).value; @@ -366,7 +369,7 @@ function initInputObserver({ maskInputOptions[type as keyof MaskInputOptions] ) { text = maskInputValue({ - input: (target as HTMLElement), + input: target as HTMLElement, maskInputOptions, maskInputSelector, unmaskInputSelector, diff --git a/packages/rrweb/test/events/ordering.ts b/packages/rrweb/test/events/ordering.ts index 083c687011..76d916b1ca 100644 --- a/packages/rrweb/test/events/ordering.ts +++ b/packages/rrweb/test/events/ordering.ts @@ -80,7 +80,7 @@ const events: eventWithTime[] = [ { id: 102, value: 'Intermediate - incorrect', - } + }, ], source: IncrementalSource.Mutation, removes: [], @@ -97,7 +97,7 @@ const events: eventWithTime[] = [ { id: 102, value: 'Final - correct', - } + }, ], source: IncrementalSource.Mutation, removes: [], From ad2beeac241815a08221e88376770129eb3c2ef4 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 19 Jan 2023 18:48:02 +0100 Subject: [PATCH 2/6] chore(repo): Add Sentry license and readme (#18) Replace the original rrweb license with our Sentry license. Adjust the readme to inform about the purpose of this fork and to give attribution to the original authors. --- LICENSE | 29 ++++----- README.md | 172 +++++++----------------------------------------------- 2 files changed, 31 insertions(+), 170 deletions(-) diff --git a/LICENSE b/LICENSE index fce28eb837..d11896ba11 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,14 @@ -MIT License +Copyright (c) 2023 Sentry (https://sentry.io) and individual contributors. All rights reserved. -Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. +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 the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: -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 the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 3e6490f17b..fefcc0e451 100644 --- a/README.md +++ b/README.md @@ -1,160 +1,28 @@

- -

-

- Try rrweb + + Sentry +

-# rrweb - -**[The rrweb documentary (in Chinese, with English subtitles)](https://www.bilibili.com/video/BV1wL4y1B7wN?share_source=copy_web)** - -[![Join the chat at slack](https://img.shields.io/badge/slack-@rrweb-teal.svg?logo=slack)](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg) -[![Twitter Follow](https://img.shields.io/badge/twitter-@rrweb__io-teal.svg?logo=twitter)](https://twitter.com/rrweb_io) -![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.js?compression=gzip&label=total%20gzip%20size) -![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/record/rrweb-record.min.js?compression=gzip&label=recorder%20gzip%20size) -[![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb) - -[δΈ­ζ–‡ζ–‡ζ‘£](./README.zh_CN.md) - -> I have joined Github Sponsors and highly appreciate your sponsorship. - -rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web. - -## Guide - -[**πŸ“š Read the rrweb guide here. πŸ“š**](./guide.md) - -[**🍳 Recipes 🍳**](./docs/recipes/index.md) - -## Project Structure - -rrweb is mainly composed of 3 parts: - -- **[rrweb-snapshot](https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-snapshot/)**, including both snapshot and rebuilding features. The snapshot is used to convert the DOM and its state into a serializable data structure with a unique identifier; the rebuilding feature is to rebuild the snapshot into corresponding DOM. -- **[rrweb](https://github.com/rrweb-io/rrweb)**, including two functions, record and replay. The record function is used to record all the mutations in the DOM; the replay is to replay the recorded mutations one by one according to the corresponding timestamp. -- **[rrweb-player](https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-player/)**, is a player UI for rrweb, providing GUI-based functions like pause, fast-forward, drag and drop to play at any time. - -## Roadmap - -- rrdom: an ad-hoc DOM for rrweb session data [#419](https://github.com/rrweb-io/rrweb/issues/419) -- storage engine: do deduplication on a large number of rrweb sessions -- more end-to-end tests -- compact mutation data in common patterns -- provide plugins via the new plugin API, including: - - XHR plugin - - fetch plugin - - GraphQL plugin - - ... +# Sentry rrweb Fork -## Internal Design +This repo is a fork of [rrweb](https://github.com/rrweb-io/rrweb). The purpose is to apply patches and bugfixes to rrweb and release Sentry-internal packages with our patches included. All credits and attribution for rrweb go to the original creators of the library and all its contributors. -- [serialization](./docs/serialization.md) -- [incremental snapshot](./docs/observer.md) -- [replay](./docs/replay.md) -- [sandbox](./docs/sandbox.md) +From this monorepo, Sentry maintains and publishes the following NPM packages: -## Contribute Guide +- `@sentry-internal/rrweb` (corresponds to the [original `rrweb` package](https://www.npmjs.com/package/rrweb)) +- `@sentry-internal/rrdom` (corresponds to the [original `rrdom` package](https://www.npmjs.com/package/rrdom)) +- `@sentry-internal/rrweb-player` (corresponds to the [original `rrweb-player` package](https://www.npmjs.com/package/rrweb-player)) +- `@sentry-internal/rrweb-snapshot` (corresponds to the [original `rrweb-snapshot` package](https://www.npmjs.com/package/rrweb-snapshot)) -Since we want the record and replay sides to share a strongly typed data structure, rrweb is developed with typescript which provides stronger type support. - -[Typescript handbook](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html) - -1. Fork this repository. -2. Run `yarn install` in the root to install required dependencies for all sub-packages (note: `npm install` is _not_ recommended). -3. Run `yarn dev` in the root to get auto-building for all the sub-packages whenever you modify anything. -4. Navigate to one of the sub-packages (in the `packages` folder) where you'd like to make a change. -5. Patch the code and run `yarn test` to run the tests, make sure they pass before you commit anything. -6. Push the code and create a pull request. - -Protip: You can run `yarn test` in the root folder to run all the tests. - -In addition to adding integration tests and unit tests, rrweb also provides a REPL testing tool. - -[Using the REPL tool](./guide.md#REPL-tool) - -## Core Team Members - - - - - - - - -
- - -
Yuyz0112 -
-
- - -
Mark-Fenng -
-
- - -
eoghanmurray -
-
- - -
Juice10 -
-
- -## Who's using rrweb +# rrweb - - - - - - - - - - - -
- - - - - - - - - - - - - - The first ever UX automation tool - -
- - - - - - Remote Access & Co-Browsing - -
+

+ +

+

+ Check out the original rrweb Repo +

+

+ rrweb.io +

From 7dc9da1c02851dcd1a131801c2c35afb9c97559e Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Fri, 20 Jan 2023 15:49:22 +0100 Subject: [PATCH 3/6] ref(repo): Add `@sentry-internal` namespace to rrweb package names (#17) rename the rrweb packages by prepending our `@sentry-internal` namespace. I opted to take the internal one over the usual @sentry namespace as I find it more fitting for the purpose we want to release these packages for. --- packages/rrdom/package.json | 4 ++-- packages/rrdom/rollup.config.js | 2 ++ packages/rrdom/src/document-nodejs.ts | 6 +++++- packages/rrweb-player/package.json | 4 ++-- packages/rrweb-player/src/Controller.svelte | 8 ++++---- packages/rrweb-player/src/Player.svelte | 4 ++-- packages/rrweb-player/src/main.ts | 2 +- packages/rrweb-player/typings/index.d.ts | 7 +++++-- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 4 ++-- packages/rrweb/src/record/iframe-manager.ts | 2 +- packages/rrweb/src/record/index.ts | 6 +++++- packages/rrweb/src/record/mutation.ts | 2 +- packages/rrweb/src/record/observer.ts | 6 +++++- packages/rrweb/src/record/observers/canvas/2d.ts | 2 +- .../rrweb/src/record/observers/canvas/canvas-manager.ts | 2 +- packages/rrweb/src/record/observers/canvas/canvas.ts | 2 +- packages/rrweb/src/record/observers/canvas/webgl.ts | 2 +- packages/rrweb/src/replay/index.ts | 2 +- packages/rrweb/src/replay/virtual-styles.ts | 2 +- packages/rrweb/src/types.ts | 2 +- packages/rrweb/src/utils.ts | 2 +- packages/rrweb/test/integration.test.ts | 2 +- packages/rrweb/test/record/webgl.test.ts | 2 +- packages/rrweb/test/utils.ts | 2 +- packages/rrweb/typings/record/iframe-manager.d.ts | 2 +- packages/rrweb/typings/replay/virtual-styles.d.ts | 2 +- packages/rrweb/typings/types.d.ts | 2 +- packages/rrweb/typings/utils.d.ts | 2 +- 29 files changed, 53 insertions(+), 36 deletions(-) diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index a1ed991ca5..eb5d4b435e 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,5 +1,5 @@ { - "name": "rrdom", + "name": "@sentry-internal/rrdom", "version": "0.1.2", "scripts": { "dev": "rollup -c -w", @@ -33,7 +33,7 @@ "rollup": "^2.56.3", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.30.0", - "rrweb-snapshot": "^1.1.14", + "@sentry-internal/rrweb-snapshot": "^1.1.14", "ts-jest": "^27.0.5", "tslib": "^2.3.1", "typescript": "^3.9.5" diff --git a/packages/rrdom/rollup.config.js b/packages/rrdom/rollup.config.js index 80baed3473..d0117e98e9 100644 --- a/packages/rrdom/rollup.config.js +++ b/packages/rrdom/rollup.config.js @@ -55,6 +55,7 @@ for (let config of baseConfigs) { name: config.name, format: 'iife', file: pkg.unpkg.replace(pkg.name, config.path), + extend: true, }, ], }, @@ -67,6 +68,7 @@ for (let config of baseConfigs) { format: 'iife', file: toMinPath(pkg.unpkg).replace(pkg.name, config.path), sourcemap: true, + extend: true, }, ], }, diff --git a/packages/rrdom/src/document-nodejs.ts b/packages/rrdom/src/document-nodejs.ts index aff8d90512..2125b44bdc 100644 --- a/packages/rrdom/src/document-nodejs.ts +++ b/packages/rrdom/src/document-nodejs.ts @@ -1,4 +1,8 @@ -import { INode, NodeType, serializedNodeWithId } from 'rrweb-snapshot'; +import { + INode, + NodeType, + serializedNodeWithId, +} from '@sentry-internal/rrweb-snapshot'; import { NWSAPI } from 'nwsapi'; import { parseCSSText, camelize, toCSSText } from './style'; const nwsapi = require('nwsapi'); diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index ec09c21361..903868609d 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb-player", + "name": "@sentry-internal/rrweb-player", "version": "0.7.14", "devDependencies": { "@rollup/plugin-commonjs": "^11.0.0", @@ -25,7 +25,7 @@ }, "dependencies": { "@tsconfig/svelte": "^1.0.0", - "rrweb": "^1.1.3" + "@sentry-internal/rrweb": "^1.1.3" }, "scripts": { "build": "rollup -c", diff --git a/packages/rrweb-player/src/Controller.svelte b/packages/rrweb-player/src/Controller.svelte index 95b92ebb71..d3303ac688 100644 --- a/packages/rrweb-player/src/Controller.svelte +++ b/packages/rrweb-player/src/Controller.svelte @@ -1,11 +1,11 @@