Skip to content

Commit 5f5c00d

Browse files
billyvgmdellanoceYunFeng0817mydeaLms24
authored
feat: Upgrade to rrweb2 (#107)
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io> Co-authored-by: mdellanoce <mdellanoce@users.noreply.github.com> Co-authored-by: Yun Feng <yun.feng0817@gmail.com> Co-authored-by: Francesco Novy <francesco.novy@sentry.io> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
1 parent 58c9104 commit 5f5c00d

File tree

141 files changed

+14631
-4163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+14631
-4163
lines changed

.changeset/fluffy-planes-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'rrweb': patch
3+
---
4+
5+
Feat: Add support for replaying :defined pseudo-class of custom elements

.changeset/little-moons-camp.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'rrweb-snapshot': minor
3+
'rrweb': minor
4+
---
5+
6+
feat: Better masking of option/radio/checkbox values

.changeset/smart-ears-refuse.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'rrweb-snapshot': patch
3+
---
4+
5+
Feat: Add 'isCustom' flag to serialized elements.
6+
7+
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.

.changeset/twenty-tables-call.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'rrweb-snapshot': patch
3+
'rrweb': patch
4+
---
5+
6+
Add `maskAttributesFn` to be called when transforming an attribute. This is typically used to determine if an attribute should be masked or not.

.craft.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
github:
2+
owner: getsentry
3+
repo: rrweb
4+
changelogPolicy: none
5+
preReleaseCommand: bash scripts/craft-pre-release.sh
6+
requireNames:
7+
- /^sentry-internal-rrweb-snapshot-.*\.tgz$/
8+
- /^sentry-internal-rrweb-player-.*\.tgz$/
9+
- /^sentry-internal-rrweb-.*\.tgz$/
10+
- /^sentry-internal-rrdom-.*\.tgz$/
11+
targets:
12+
- name: github
13+
includeNames: /^sentry-.*.tgz$/
14+
- name: npm
15+
includeNames: /^sentry-.*.tgz$/

.github/workflows/ci-cd.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: Tests
1+
name: Build & Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/**
8+
pull_request:
49

510
concurrency: ${{ github.workflow }}-${{ github.ref }}
611

712
jobs:
8-
release:
13+
job_test:
914
name: Tests
1015
runs-on: ubuntu-latest
1116
steps:
@@ -19,6 +24,7 @@ jobs:
1924
uses: actions/setup-node@v3
2025
with:
2126
node-version: lts/*
27+
cache: 'yarn'
2228

2329
- name: Install Dependencies
2430
run: yarn install --frozen-lockfile
@@ -39,3 +45,34 @@ jobs:
3945
name: image-diff
4046
path: packages/rrweb/test/*/__image_snapshots__/__diff_output__/*.png
4147
if-no-files-found: ignore
48+
49+
job_artifacts:
50+
needs: job_test
51+
name: Upload Artifacts
52+
runs-on: ubuntu-latest
53+
# Build artifacts are only needed for releasing workflow.
54+
if: startsWith(github.ref, 'refs/heads/release/')
55+
steps:
56+
- name: Checkout Repo
57+
uses: actions/checkout@v3
58+
59+
- name: Setup Node.js lts/*
60+
uses: actions/setup-node@v3
61+
with:
62+
node-version: lts/*
63+
cache: 'yarn'
64+
65+
- name: Install Dependencies
66+
run: yarn install --frozen-lockfile
67+
68+
- name: Build Tarballs
69+
env:
70+
NODE_OPTIONS: "--max_old_space_size=4096"
71+
run: yarn build:tarball
72+
73+
- name: Upload Artifacts
74+
uses: actions/upload-artifact@v3
75+
with:
76+
name: ${{ github.sha }}
77+
path: |
78+
${{ github.workspace }}/packages/**/*.tgz

.github/workflows/release.yml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
1-
name: Release
2-
1+
name: Prepare Release
32
on:
4-
push:
5-
branches:
6-
- master
7-
8-
concurrency: ${{ github.workflow }}-${{ github.ref }}
9-
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Version to release
7+
required: true
8+
force:
9+
description: Force a release even when there are release-blockers (optional)
10+
required: false
11+
merge_target:
12+
description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional)
13+
required: false
1014
jobs:
1115
release:
12-
name: Release
1316
runs-on: ubuntu-latest
17+
name: 'Release a new version'
1418
steps:
15-
- name: Checkout Repo
16-
uses: actions/checkout@v3
17-
18-
- name: Setup Node.js lts/*
19-
uses: actions/setup-node@v3
19+
- uses: actions/checkout@v3
2020
with:
21-
node-version: lts/*
22-
23-
- name: Install Dependencies
24-
run: yarn install --frozen-lockfile
25-
26-
- name: Create Release Pull Request or Publish to npm
27-
id: changesets
28-
uses: changesets/action@v1
29-
with:
30-
publish: yarn run release
21+
token: ${{ secrets.GH_RELEASE_PAT }}
22+
fetch-depth: 0
23+
- name: Prepare release
24+
uses: getsentry/action-prepare-release@v1
3125
env:
32-
NODE_OPTIONS: '--max-old-space-size=4096'
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35-
36-
# - name: Send a Slack notification if a publish happens
37-
# if: steps.changesets.outputs.published == 'true'
38-
# # You can do something when a publish happens.
39-
# run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"
26+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
27+
with:
28+
version: ${{ github.event.inputs.version }}
29+
force: ${{ github.event.inputs.force }}
30+
merge_target: ${{ github.event.inputs.merge_target }}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3+
## 2.0.0-beta11.0
4+
5+
- Sentry fork of rrweb@2.0.0-alpha.11 with additional masking features
6+
37
## v1.0.0
48

5-
### Featrues & Improvements
9+
### Features & Improvements
610

711
- Support record same-origin non-sandboxed iframe.
812
- Support record open-mode shadow DOM.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license:
2+
13
MIT License
24

35
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
1921
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2022
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2123
SOFTWARE.
24+
25+
Our modifications to this project are also released under the MIT license:
26+
27+
Copyright (c) 2023 Functional Software, Inc. dba Sentry
28+
29+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
30+
and associated documentation files (the "Software"), to deal in the Software without restriction,
31+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
32+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
33+
furnished to do so, subject to the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included in all copies or substantial
36+
portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
39+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
40+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
42+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Sentry rrweb Fork
8+
9+
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.
10+
11+
From this monorepo, Sentry maintains and publishes the following NPM packages:
12+
13+
- `@sentry-internal/rrweb` (corresponds to the [original `rrweb` package](https://www.npmjs.com/package/rrweb))
14+
- `@sentry-internal/rrdom` (corresponds to the [original `rrdom` package](https://www.npmjs.com/package/rrdom))
15+
- `@sentry-internal/rrweb-player` (corresponds to the [original `rrweb-player` package](https://www.npmjs.com/package/rrweb-player))
16+
- `@sentry-internal/rrweb-snapshot` (corresponds to the [original `rrweb-snapshot` package](https://www.npmjs.com/package/rrweb-snapshot))
17+
18+
# rrweb
19+
120
<p align="center">
221
<img width="100px" height="100px" src="https://www.rrweb.io/favicon.png">
322
</p>
423
<p align="center">
5-
<a href="https://www.rrweb.io/" style="font-weight: bold">Try rrweb</a>
24+
<a href="https://github.com/rrweb-io/rrweb" style="font-weight: bold">Check out the original rrweb Repo</a>
25+
</p>
26+
<p align="center">
27+
<a href="https://rrweb.io" style="font-weight: bold">rrweb.io</a>
628
</p>
729

830
# rrweb

0 commit comments

Comments
 (0)