diff --git a/.changeset/fluffy-planes-retire.md b/.changeset/fluffy-planes-retire.md
new file mode 100644
index 0000000000..41e9601704
--- /dev/null
+++ b/.changeset/fluffy-planes-retire.md
@@ -0,0 +1,5 @@
+---
+'rrweb': patch
+---
+
+Feat: Add support for replaying :defined pseudo-class of custom elements
diff --git a/.changeset/little-moons-camp.md b/.changeset/little-moons-camp.md
new file mode 100644
index 0000000000..776f214f40
--- /dev/null
+++ b/.changeset/little-moons-camp.md
@@ -0,0 +1,6 @@
+---
+'rrweb-snapshot': minor
+'rrweb': minor
+---
+
+feat: Better masking of option/radio/checkbox values
diff --git a/.changeset/smart-ears-refuse.md b/.changeset/smart-ears-refuse.md
new file mode 100644
index 0000000000..0aaaabcf0f
--- /dev/null
+++ b/.changeset/smart-ears-refuse.md
@@ -0,0 +1,7 @@
+---
+'rrweb-snapshot': patch
+---
+
+Feat: Add 'isCustom' flag to serialized elements.
+
+This flag is used to indicate whether the element is a custom element or not. This is useful for replaying the :defined pseudo-class of custom elements.
diff --git a/.changeset/twenty-tables-call.md b/.changeset/twenty-tables-call.md
new file mode 100644
index 0000000000..add796cc59
--- /dev/null
+++ b/.changeset/twenty-tables-call.md
@@ -0,0 +1,6 @@
+---
+'rrweb-snapshot': patch
+'rrweb': patch
+---
+
+Add `maskAttributesFn` to be called when transforming an attribute. This is typically used to determine if an attribute should be masked or not.
diff --git a/.craft.yml b/.craft.yml
new file mode 100644
index 0000000000..724499a422
--- /dev/null
+++ b/.craft.yml
@@ -0,0 +1,15 @@
+github:
+ owner: getsentry
+ repo: rrweb
+changelogPolicy: none
+preReleaseCommand: bash scripts/craft-pre-release.sh
+requireNames:
+ - /^sentry-internal-rrweb-snapshot-.*\.tgz$/
+ - /^sentry-internal-rrweb-player-.*\.tgz$/
+ - /^sentry-internal-rrweb-.*\.tgz$/
+ - /^sentry-internal-rrdom-.*\.tgz$/
+targets:
+ - name: github
+ includeNames: /^sentry-.*.tgz$/
+ - name: npm
+ includeNames: /^sentry-.*.tgz$/
diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml
index cf64ccca07..0b9b9be9b3 100644
--- a/.github/workflows/ci-cd.yml
+++ b/.github/workflows/ci-cd.yml
@@ -1,11 +1,16 @@
-name: Tests
+name: Build & Tests
-on: [push, pull_request]
+on:
+ push:
+ branches:
+ - master
+ - release/**
+ pull_request:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
- release:
+ job_test:
name: Tests
runs-on: ubuntu-latest
steps:
@@ -19,6 +24,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
+ cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
@@ -39,3 +45,34 @@ jobs:
name: image-diff
path: packages/rrweb/test/*/__image_snapshots__/__diff_output__/*.png
if-no-files-found: ignore
+
+ job_artifacts:
+ needs: job_test
+ name: Upload Artifacts
+ runs-on: ubuntu-latest
+ # Build artifacts are only needed for releasing workflow.
+ if: startsWith(github.ref, 'refs/heads/release/')
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v3
+
+ - name: Setup Node.js lts/*
+ uses: actions/setup-node@v3
+ with:
+ node-version: lts/*
+ cache: 'yarn'
+
+ - name: Install Dependencies
+ run: yarn install --frozen-lockfile
+
+ - name: Build Tarballs
+ env:
+ NODE_OPTIONS: "--max_old_space_size=4096"
+ run: yarn build:tarball
+
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ github.sha }}
+ path: |
+ ${{ github.workspace }}/packages/**/*.tgz
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f870937fd3..e6335c507e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,39 +1,30 @@
-name: Release
-
+name: Prepare Release
on:
- push:
- branches:
- - master
-
-concurrency: ${{ github.workflow }}-${{ github.ref }}
-
+ workflow_dispatch:
+ inputs:
+ version:
+ description: Version to release
+ required: true
+ force:
+ description: Force a release even when there are release-blockers (optional)
+ required: false
+ merge_target:
+ description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional)
+ required: false
jobs:
release:
- name: Release
runs-on: ubuntu-latest
+ name: 'Release a new version'
steps:
- - name: Checkout Repo
- uses: actions/checkout@v3
-
- - name: Setup Node.js lts/*
- uses: actions/setup-node@v3
+ - uses: actions/checkout@v3
with:
- node-version: lts/*
-
- - name: Install Dependencies
- run: yarn install --frozen-lockfile
-
- - name: Create Release Pull Request or Publish to npm
- id: changesets
- uses: changesets/action@v1
- with:
- publish: yarn run release
+ token: ${{ secrets.GH_RELEASE_PAT }}
+ fetch-depth: 0
+ - name: Prepare release
+ uses: getsentry/action-prepare-release@v1
env:
- NODE_OPTIONS: '--max-old-space-size=4096'
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
-
- # - name: Send a Slack notification if a publish happens
- # if: steps.changesets.outputs.published == 'true'
- # # You can do something when a publish happens.
- # run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"
+ GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
+ with:
+ version: ${{ github.event.inputs.version }}
+ force: ${{ github.event.inputs.force }}
+ merge_target: ${{ github.event.inputs.merge_target }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8521fa79c2..4be0c11285 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,12 @@
# Changelog
+## 2.0.0-beta11.0
+
+- Sentry fork of rrweb@2.0.0-alpha.11 with additional masking features
+
## v1.0.0
-### Featrues & Improvements
+### Features & Improvements
- Support record same-origin non-sandboxed iframe.
- Support record open-mode shadow DOM.
diff --git a/LICENSE b/LICENSE
index fce28eb837..1b6395aae4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,5 @@
+This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license:
+
MIT License
Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc.
@@ -19,3 +21,22 @@ 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.
+
+Our modifications to this project are also released under the MIT license:
+
+Copyright (c) 2023 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 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 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.
\ No newline at end of file
diff --git a/README.md b/README.md
index d198499df9..20ee8654b5 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,30 @@
+
+
+# Sentry rrweb Fork
+
+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.
+
+From this monorepo, Sentry maintains and publishes the following NPM packages:
+
+- `@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))
+
+# rrweb
+
# rrweb
diff --git a/guide.md b/guide.md
index d7807bf00d..7084ece014 100644
--- a/guide.md
+++ b/guide.md
@@ -142,13 +142,18 @@ The parameter of `rrweb.record` accepts the following options.
| checkoutEveryNms | - | take a full snapshot after every N ms refer to the [checkout](#checkout) chapter |
| blockClass | 'rr-block' | Use a string or RegExp to configure which elements should be blocked, refer to the [privacy](#privacy) chapter |
| blockSelector | null | Use a string to configure which selector should be blocked, refer to the [privacy](#privacy) chapter |
+| unblockSelector | null | Use a string to configure which selector should not be blocked, refer to the [privacy](#privacy) chapter |
| ignoreClass | 'rr-ignore' | Use a string or RegExp to configure which elements should be ignored, refer to the [privacy](#privacy) chapter |
| ignoreSelector | null | Use a string to configure which selector should be ignored, refer to the [privacy](#privacy) chapter |
| ignoreCSSAttributes | null | array of CSS attributes that should be ignored |
+| maskAllText | false | mask all text content as \* |
| maskTextClass | 'rr-mask' | Use a string or RegExp to configure which elements should be masked, refer to the [privacy](#privacy) chapter |
+| unmaskTextClass | null | Use a string or RegExp to configure which elements should be unmasked, refer to the [privacy](#privacy) chapter |
| maskTextSelector | null | Use a string to configure which selector should be masked, refer to the [privacy](#privacy) chapter |
+| unmaskTextSelector | null | Use a string to configure which selector should be unmasked, refer to the [privacy](#privacy) chapter |
| maskAllInputs | false | mask all input content as \* |
| maskInputOptions | { password: true } | mask some kinds of input \* refer to the [list](https://github.com/rrweb-io/rrweb/blob/588164aa12f1d94576f89ae0210b98f6e971c895/packages/rrweb-snapshot/src/types.ts#L77-L95) |
+| maskAttributeFn | - | callback before transforming attribute. can be used to mask specific attributes |
| maskInputFn | - | customize mask input content recording logic |
| maskTextFn | - | customize mask text content recording logic |
| slimDOMOptions | {} | remove unnecessary parts of the DOM refer to the [list](https://github.com/rrweb-io/rrweb/blob/588164aa12f1d94576f89ae0210b98f6e971c895/packages/rrweb-snapshot/src/types.ts#L97-L108) |
@@ -173,6 +178,7 @@ You may find some contents on the webpage which are not willing to be recorded,
- An element with the class name `.rr-block` will not be recorded. Instead, it will replay as a placeholder with the same dimension.
- An element with the class name `.rr-ignore` will not record its input events.
- All text of elements with the class name `.rr-mask` and their children will be masked.
+- All text of elements with the optional unmasking class name `unmaskTextClass` and their children will be unmasked, unless any child is marked with `.rr-mask`.
- `input[type="password"]` will be masked by default.
- Mask options to mask the content in input elements.
diff --git a/lerna.json b/lerna.json
index cfec287607..f4571cfc5f 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,7 +1,6 @@
{
"version": "independent",
"npmClient": "yarn",
- "useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish new version"
diff --git a/package.json b/package.json
index e6669ce15c..4c0cd4bfa5 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,7 @@
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
- "@monorepo-utils/workspaces-to-typescript-project-references": "^2.8.2",
+ "@monorepo-utils/workspaces-to-typescript-project-references": "^2.10.2",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"browserslist": "^4.21.4",
@@ -29,6 +29,7 @@
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-tsdoc": "^0.2.16",
+ "lerna": "^7.1.4",
"markdownlint": "^0.25.1",
"markdownlint-cli": "^0.31.1",
"prettier": "2.8.4",
@@ -36,7 +37,8 @@
"typescript": "^4.9.5"
},
"scripts": {
- "build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepublish'",
+ "build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepare'",
+ "build:tarball": "yarn lerna run build:tarball",
"test": "yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references --check' 'yarn turbo run test'",
"test:watch": "yarn turbo run test:watch",
"test:update": "yarn turbo run test:update",
diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json
index 58aad4a681..a85cea3980 100644
--- a/packages/rrdom-nodejs/package.json
+++ b/packages/rrdom-nodejs/package.json
@@ -1,13 +1,13 @@
{
- "name": "rrdom-nodejs",
- "version": "2.0.0-alpha.11",
+ "name": "@sentry-internal/rrdom-nodejs",
+ "version": "2.0.0-beta11.0",
"scripts": {
"dev": "rollup -c -w",
"bundle": "rollup --config",
"bundle:es-only": "cross-env ES_ONLY=true rollup --config",
"check-types": "tsc -noEmit",
"test": "jest",
- "prepublish": "npm run bundle",
+ "prepare": "npm run bundle",
"lint": "yarn eslint src/**/*.ts"
},
"keywords": [
@@ -45,11 +45,11 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
+ "@sentry-internal/rrdom": "2.0.0-beta11.0",
+ "@sentry-internal/rrweb-snapshot": "2.0.0-beta11.0",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
- "nwsapi": "^2.2.0",
- "rrdom": "^2.0.0-alpha.11",
- "rrweb-snapshot": "^2.0.0-alpha.11"
+ "nwsapi": "^2.2.0"
},
"browserslist": [
"supports es6-class"
diff --git a/packages/rrdom-nodejs/src/document-nodejs.ts b/packages/rrdom-nodejs/src/document-nodejs.ts
index 1d13970d34..b7b796444a 100644
--- a/packages/rrdom-nodejs/src/document-nodejs.ts
+++ b/packages/rrdom-nodejs/src/document-nodejs.ts
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
-import { NodeType as RRNodeType } from 'rrweb-snapshot';
+import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
import type { NWSAPI } from 'nwsapi';
import type { CSSStyleDeclaration as CSSStyleDeclarationType } from 'cssstyle';
import {
@@ -14,7 +14,7 @@ import {
ClassList,
IRRDocument,
CSSStyleDeclaration,
-} from 'rrdom';
+} from '@sentry-internal/rrdom';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
const nwsapi = require('nwsapi');
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
diff --git a/packages/rrdom-nodejs/test/document-nodejs.test.ts b/packages/rrdom-nodejs/test/document-nodejs.test.ts
index ba3c6144d8..b42fc59098 100644
--- a/packages/rrdom-nodejs/test/document-nodejs.test.ts
+++ b/packages/rrdom-nodejs/test/document-nodejs.test.ts
@@ -3,7 +3,7 @@
*/
import * as fs from 'fs';
import * as path from 'path';
-import { NodeType as RRNodeType } from 'rrweb-snapshot';
+import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
import {
RRCanvasElement,
RRCDATASection,
@@ -16,7 +16,7 @@ import {
RRStyleElement,
RRText,
} from '../src/document-nodejs';
-import { buildFromDom } from 'rrdom';
+import { buildFromDom } from '@sentry-internal/rrdom';
describe('RRDocument for nodejs environment', () => {
describe('RRDocument API', () => {
diff --git a/packages/rrdom-nodejs/tsconfig.json b/packages/rrdom-nodejs/tsconfig.json
index 0c2f119853..88f7b03681 100644
--- a/packages/rrdom-nodejs/tsconfig.json
+++ b/packages/rrdom-nodejs/tsconfig.json
@@ -10,13 +10,18 @@
"sourceMap": true,
"rootDir": "src",
"outDir": "build",
- "lib": ["es6", "dom"],
+ "lib": [
+ "es6",
+ "dom"
+ ],
"skipLibCheck": true,
"declaration": true,
"importsNotUsedAsValues": "error"
},
"compileOnSave": true,
- "exclude": ["test"],
+ "exclude": [
+ "test"
+ ],
"include": [
"src",
"test.d.ts",
diff --git a/packages/rrdom/LICENSE b/packages/rrdom/LICENSE
new file mode 100644
index 0000000000..1b6395aae4
--- /dev/null
+++ b/packages/rrdom/LICENSE
@@ -0,0 +1,42 @@
+This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license:
+
+MIT License
+
+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:
+
+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.
+
+Our modifications to this project are also released under the MIT license:
+
+Copyright (c) 2023 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 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 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.
\ No newline at end of file
diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json
index f7122da917..724072c7cc 100644
--- a/packages/rrdom/package.json
+++ b/packages/rrdom/package.json
@@ -1,6 +1,6 @@
{
- "name": "rrdom",
- "version": "2.0.0-alpha.11",
+ "name": "@sentry-internal/rrdom",
+ "version": "2.0.0-beta11.0",
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme",
"license": "MIT",
"main": "lib/rrdom.cjs",
@@ -20,11 +20,13 @@
},
"scripts": {
"dev": "rollup -c -w",
+ "build:tarball": "npm pack",
"bundle": "rollup --config",
"bundle:es-only": "cross-env ES_ONLY=true rollup --config",
"check-types": "tsc -noEmit",
"test": "jest",
- "prepublish": "npm run bundle",
+ "typings": "tsc -d --declarationDir typings",
+ "prepare": "npm run typings && npm run bundle",
"lint": "yarn eslint src/**/*.ts"
},
"bugs": {
@@ -32,7 +34,7 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
- "@rrweb/types": "^2.0.0-alpha.11",
+ "@sentry-internal/rrweb-types": "2.0.0-beta11.0",
"@types/jest": "^27.4.1",
"@types/puppeteer": "^5.4.4",
"@typescript-eslint/eslint-plugin": "^5.23.0",
@@ -47,6 +49,6 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
- "rrweb-snapshot": "^2.0.0-alpha.11"
+ "@sentry-internal/rrweb-snapshot": "2.0.0-beta11.0"
}
}
diff --git a/packages/rrdom/rollup.config.js b/packages/rrdom/rollup.config.js
index 5bd346673f..af7d6fa597 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/diff.ts b/packages/rrdom/src/diff.ts
index f37f298106..f530259e11 100644
--- a/packages/rrdom/src/diff.ts
+++ b/packages/rrdom/src/diff.ts
@@ -2,7 +2,7 @@ import {
NodeType as RRNodeType,
Mirror as NodeMirror,
elementNode,
-} from 'rrweb-snapshot';
+} from '@sentry-internal/rrweb-snapshot';
import type {
canvasMutationData,
canvasEventWithTime,
@@ -10,7 +10,7 @@ import type {
scrollData,
styleDeclarationData,
styleSheetRuleData,
-} from '@rrweb/types';
+} from '@sentry-internal/rrweb-types';
import type {
IRRCDATASection,
IRRComment,
diff --git a/packages/rrdom/src/document.ts b/packages/rrdom/src/document.ts
index a053009a76..12373dd502 100644
--- a/packages/rrdom/src/document.ts
+++ b/packages/rrdom/src/document.ts
@@ -1,4 +1,4 @@
-import { NodeType as RRNodeType } from 'rrweb-snapshot';
+import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
import { parseCSSText, camelize, toCSSText } from './style';
export interface IRRNode {
parentElement: IRRNode | null;
diff --git a/packages/rrdom/src/index.ts b/packages/rrdom/src/index.ts
index eeddb03e1c..f1e9323c3a 100644
--- a/packages/rrdom/src/index.ts
+++ b/packages/rrdom/src/index.ts
@@ -1,12 +1,12 @@
import {
NodeType as RRNodeType,
createMirror as createNodeMirror,
-} from 'rrweb-snapshot';
+} from '@sentry-internal/rrweb-snapshot';
import type {
Mirror as NodeMirror,
IMirror,
serializedNodeWithId,
-} from 'rrweb-snapshot';
+} from '@sentry-internal/rrweb-snapshot';
import type {
canvasMutationData,
canvasEventWithTime,
@@ -14,7 +14,7 @@ import type {
scrollData,
styleSheetRuleData,
styleDeclarationData,
-} from '@rrweb/types';
+} from '@sentry-internal/rrweb-types';
import {
BaseRRNode as RRNode,
BaseRRCDATASectionImpl,
diff --git a/packages/rrdom/test/diff.test.ts b/packages/rrdom/test/diff.test.ts
index 3f18a6ee7e..c418adf870 100644
--- a/packages/rrdom/test/diff.test.ts
+++ b/packages/rrdom/test/diff.test.ts
@@ -8,7 +8,7 @@ import {
serializedNodeWithId,
createMirror,
Mirror as NodeMirror,
-} from 'rrweb-snapshot';
+} from '@sentry-internal/rrweb-snapshot';
import {
buildFromDom,
getDefaultSN,
@@ -25,14 +25,14 @@ import {
sameNodeType,
} from '../src/diff';
import type { IRRElement, IRRNode } from '../src/document';
-import { Replayer } from 'rrweb';
+import { Replayer } from '@sentry-internal/rrweb';
import type {
eventWithTime,
canvasMutationData,
styleDeclarationData,
styleSheetRuleData,
-} from '@rrweb/types';
-import { EventType, IncrementalSource } from '@rrweb/types';
+} from '@sentry-internal/rrweb-types';
+import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types';
import { compileTSCode } from './utils';
const elementSn = {
diff --git a/packages/rrdom/test/document.test.ts b/packages/rrdom/test/document.test.ts
index 38a35e505f..d0cd27a49d 100644
--- a/packages/rrdom/test/document.test.ts
+++ b/packages/rrdom/test/document.test.ts
@@ -1,7 +1,7 @@
/**
* @jest-environment jsdom
*/
-import { NodeType as RRNodeType } from 'rrweb-snapshot';
+import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
import {
BaseRRDocumentImpl,
BaseRRDocumentTypeImpl,
diff --git a/packages/rrdom/test/virtual-dom.test.ts b/packages/rrdom/test/virtual-dom.test.ts
index b99aca5ae4..4d3cfe4750 100644
--- a/packages/rrdom/test/virtual-dom.test.ts
+++ b/packages/rrdom/test/virtual-dom.test.ts
@@ -15,7 +15,7 @@ import {
NodeType,
NodeType as RRNodeType,
textNode,
-} from 'rrweb-snapshot';
+} from '@sentry-internal/rrweb-snapshot';
import {
buildFromDom,
buildFromNode,
diff --git a/packages/rrdom/tsconfig.json b/packages/rrdom/tsconfig.json
index 450e56e151..ed182cbd3f 100644
--- a/packages/rrdom/tsconfig.json
+++ b/packages/rrdom/tsconfig.json
@@ -10,7 +10,10 @@
"sourceMap": true,
"rootDir": "src",
"outDir": "build",
- "lib": ["es6", "dom"],
+ "lib": [
+ "es6",
+ "dom"
+ ],
"skipLibCheck": true,
"declaration": true,
"importsNotUsedAsValues": "error"
@@ -24,7 +27,9 @@
}
],
"compileOnSave": true,
- "exclude": ["test"],
+ "exclude": [
+ "test"
+ ],
"include": [
"src",
"../rrweb/src/record/workers/workers.d.ts",
diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json
index 5472c8981a..c5c368b8c9 100644
--- a/packages/rrvideo/package.json
+++ b/packages/rrvideo/package.json
@@ -1,6 +1,6 @@
{
- "name": "rrvideo",
- "version": "2.0.0-alpha.11",
+ "name": "@sentry-internal/rrvideo",
+ "version": "2.0.0-beta11.0",
"description": "transform rrweb session into video",
"main": "build/index.js",
"bin": {
@@ -13,26 +13,27 @@
"scripts": {
"install": "playwright install",
"build": "tsc",
+ "build:tarball": "npm pack",
"test": "jest",
"check-types": "tsc -noEmit",
- "prepublish": "yarn build"
+ "prepare": "yarn build"
},
"author": "yanzhen@smartx.com",
"license": "MIT",
"devDependencies": {
+ "@sentry-internal/rrweb-types": "2.0.0-beta11.0",
"@types/fs-extra": "11.0.1",
"@types/jest": "^27.4.1",
"@types/minimist": "^1.2.1",
"@types/node": "^18.15.11",
"jest": "^27.5.1",
- "ts-jest": "^27.1.3",
- "@rrweb/types": "^2.0.0-alpha.11"
+ "ts-jest": "^27.1.3"
},
"dependencies": {
"@open-tech-world/cli-progress-bar": "^2.0.2",
+ "@sentry-internal/rrweb-player": "2.0.0-beta11.0",
"fs-extra": "^11.1.1",
"minimist": "^1.2.5",
- "playwright": "^1.32.1",
- "rrweb-player": "^2.0.0-alpha.11"
+ "playwright": "^1.32.1"
}
}
diff --git a/packages/rrvideo/src/cli.ts b/packages/rrvideo/src/cli.ts
index 600c531a23..e1e716b69e 100644
--- a/packages/rrvideo/src/cli.ts
+++ b/packages/rrvideo/src/cli.ts
@@ -3,7 +3,7 @@ import * as fs from 'fs';
import * as path from 'path';
import minimist from 'minimist';
import { ProgressBar } from '@open-tech-world/cli-progress-bar';
-import type { RRwebPlayerOptions } from 'rrweb-player';
+import type { RRwebPlayerOptions } from '@sentry-internal/rrweb-player';
import { transformToVideo } from './index';
const argv = minimist(process.argv.slice(2));
diff --git a/packages/rrvideo/src/index.ts b/packages/rrvideo/src/index.ts
index 0909746929..ed81abe0ce 100644
--- a/packages/rrvideo/src/index.ts
+++ b/packages/rrvideo/src/index.ts
@@ -1,11 +1,11 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import { chromium } from 'playwright';
-import { EventType, eventWithTime } from '@rrweb/types';
-import type { RRwebPlayerOptions } from 'rrweb-player';
+import { EventType, eventWithTime } from '@sentry-internal/rrweb-types';
+import type { RRwebPlayerOptions } from '@sentry-internal/rrweb-player';
const rrwebScriptPath = path.resolve(
- require.resolve('rrweb-player'),
+ require.resolve('@sentry-internal/rrweb-player'),
'../../dist/index.js',
);
const rrwebStylePath = path.resolve(rrwebScriptPath, '../style.css');
diff --git a/packages/rrvideo/test/events/example.ts b/packages/rrvideo/test/events/example.ts
index 00701fd6ca..aac875ca9b 100644
--- a/packages/rrvideo/test/events/example.ts
+++ b/packages/rrvideo/test/events/example.ts
@@ -1,5 +1,5 @@
-import { EventType, IncrementalSource } from '@rrweb/types';
-import type { eventWithTime } from '@rrweb/types';
+import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types';
+import type { eventWithTime } from '@sentry-internal/rrweb-types';
const now = Date.now();
const events: eventWithTime[] = [
diff --git a/packages/rrweb-player/LICENSE b/packages/rrweb-player/LICENSE
new file mode 100644
index 0000000000..1b6395aae4
--- /dev/null
+++ b/packages/rrweb-player/LICENSE
@@ -0,0 +1,42 @@
+This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license:
+
+MIT License
+
+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:
+
+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.
+
+Our modifications to this project are also released under the MIT license:
+
+Copyright (c) 2023 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 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 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.
\ No newline at end of file
diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json
index f545256267..40ff11bb10 100644
--- a/packages/rrweb-player/package.json
+++ b/packages/rrweb-player/package.json
@@ -1,10 +1,10 @@
{
- "name": "rrweb-player",
- "version": "2.0.0-alpha.11",
+ "name": "@sentry-internal/rrweb-player",
+ "version": "2.0.0-beta11.0",
"devDependencies": {
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
- "@rrweb/types": "^2.0.0-alpha.11",
+ "@sentry-internal/rrweb-types": "2.0.0-beta11.0",
"@types/offscreencanvas": "^2019.6.4",
"eslint-config-google": "^0.14.0",
"eslint-plugin-svelte3": "^4.0.0",
@@ -23,16 +23,17 @@
"tslib": "^2.0.0"
},
"dependencies": {
- "@tsconfig/svelte": "^1.0.0",
- "rrweb": "^2.0.0-alpha.11"
+ "@sentry-internal/rrweb": "2.0.0-beta11.0",
+ "@tsconfig/svelte": "^1.0.0"
},
"scripts": {
"build": "rollup -c",
+ "build:tarball": "npm pack",
"dev": "rollup -c -w",
- "prepublishOnly": "yarn build",
"start": "sirv public",
"validate": "svelte-check",
- "prepublish": "yarn build",
+ "typings": "tsc -d --declarationDir typings",
+ "prepare": "yarn typings && yarn build",
"lint": "yarn eslint src/**/*.ts"
},
"description": "rrweb's replayer UI",
diff --git a/packages/rrweb-player/src/Controller.svelte b/packages/rrweb-player/src/Controller.svelte
index 5a352e6dd0..cb2dbb19e4 100644
--- a/packages/rrweb-player/src/Controller.svelte
+++ b/packages/rrweb-player/src/Controller.svelte
@@ -1,11 +1,11 @@
+{#if showController}
+