Skip to content

Commit

Permalink
[HIG] add Highlight features for rrweb up to rrweb@1.1.3
Browse files Browse the repository at this point in the history
parent 5992f03
author Jay Khatri <jaykhatrimail@gmail.com> 1608000413 -0500
committer Vadim Korolik <vkorolik@gmail.com> 1666033419 -0700
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIyBAABCgAdFiEE5qJt+0KcVgDpzp9NmG2rb3pHHDQFAmNNpwsACgkQmG2rb3pH
 HDT+Qg/2Lwz671fehqmv/yC4LksqoSVdFH1JG0e61qKEaUqaCGST/c0GqUpHiI7D
 Y3yFTlhatbWqaDV+bpJ/9KzB3cRtOhV6URbw5xLrhsR3pGEzNqv4c+ZkaWR2U32k
 pSFidY7MZTJURbEosOR0cXc+WhHfiVEgzJ6/ny6e4r7zY6gBbE66DLVRNelhMwW7
 wdpwzh4KcfLroOecA49skgvTj7xO3Bv3B5X2Ok2Rch18WzWiFDDVYFdIiArf7Kua
 /gIn1AybT6B6nb4kl99H763zATHLXKdWeLS9nFySGG73ILVpaefMS5cHZnmvmw10
 6hltrcYpcZTbPJCV9npFUS+1ViSTK8FpegBVtlUZj5+ZhL3I+McBYyzjgrv/67vc
 fJKkVCgtgkEgbHHwouw4KnsyRZLcb4/0krOhyqdEKHxmEy+nNvIQ6OVyw4+vYW5B
 DN84bQ9wWC/p5wEdhJoEz7o42o2UYboGW9Gmzpsef7NaK0MUZr/XHMonOvwL9Yd+
 STe9WjkVgWs3Ah6WQrXyYHDsxyn/PXCquSQK1qfnj5qSa3Aajrn1MHVYwNN1IdmL
 4+Yn+JQe43Ahb3BEUVuD1w0V3cZs15UoHfKbNuc1VGKfmbvztu/48gwvUCE/BgkG
 E33iWf+6LcSjQJvEM8HHsBmMq64QOP2Tnsklfn/WJMZF41Pvbg==
 =P0Tg
 -----END PGP SIGNATURE-----

add typings

change

change

more changes to release

change

change

try again

try again

try again

try again

change

change

change

v0.9.12

change

change

added npm ignore

change

change

chagne

change

change

change

change

change

Preprocess inactive segments

Cleaned up code

Renamed, and removed generated file changes

change

change

change

bump version

delete old files

change

add typings

change

try again

change

another change

change

change

change

change

Undef handling for intervals

Another check

Add custom build command (#21)

Switch to version `1.0.4` of `rrweb-snapshot` (#23)

Added support for inactive threshold (#20)

* Added support for inactive threshold

* Updated version num

* Prettified

* Fixed names

* Fixed name

* Renamed

Missed an edge case where the last part of a session is inactive, and  counted that as active.  (#24)

* Added support for inactive threshold

* Updated version num

* Prettified

* Fixed names

* Fixed name

* Renamed

* Cleaned code and added handling for edge cases

* Updated package num

Anthony/hig 156 change the color style of the cursor to (#25)

* Added support for inactive threshold

* Updated version num

* Prettified

* Fixed names

* Fixed name

* Renamed

* Cleaned code and added handling for edge cases

* Updated package num

* More skip customize, changed cursor

* Update package version

* Changed to use webpack instead of rollup

Co-authored-by: Jay Khatri <j@jaykhatri.com>

* Fixed files

* Added missing styles from CDN

Co-authored-by: Jay Khatri <j@jaykhatri.com>

Anthony/hig 190 move rrweb getactivityinterval logic (#27)

* Added support for inactive threshold

* Updated version num

* Prettified

* Fixed names

* Fixed name

* Renamed

* Cleaned code and added handling for edge cases

* Updated package num

* More skip customize, changed cursor

* Update package version

* Changed to use webpack instead of rollup

Co-authored-by: Jay Khatri <j@jaykhatri.com>

* Fixed files

* Added missing styles from CDN

* Moved activity intervals calculation

* Updated version

Co-authored-by: Jay Khatri <j@jaykhatri.com>

Anthony/hig 190 move rrweb getactivityinterval logic (#28)

* Added support for inactive threshold

* Updated version num

* Prettified

* Fixed names

* Fixed name

* Renamed

* Cleaned code and added handling for edge cases

* Updated package num

* More skip customize, changed cursor

* Update package version

* Changed to use webpack instead of rollup

Co-authored-by: Jay Khatri <j@jaykhatri.com>

* Fixed files

* Added missing styles from CDN

* Moved activity intervals calculation

* Updated version

* Only calculate intervals once

* Updated version

Co-authored-by: Jay Khatri <j@jaykhatri.com>

john/hig-231-block-recording-on-all-text-nodes (#30)

* Adds text randomization

* Update blocked styles

* Add privacy mode

* Don't record images

* v0.10.0

* Rename flag to enableStrictPrivacy

* Set redacted style on replayer side

Consider allevents for inactivity (#31)

* Consider allevents for inactivity

* Remove log

* skip inactive

Don't record value attribute on password inputs (#32)

* Don't record password

* v0.10.2

Redact the value attribute on mutations (#33)

* Redact the value attribute on mutations

* v0.10.3

Added 2s delay (#34)

* Added 2s delay

* updated version

* Changed back to fast_forwarding

Update rrweb (#35)

* fix: sometimes currentTime is smaller than the totalTime when player is finished (#445)

plus: fix the problem that sometimes return value of getCurrentTime() is negative

* Fix broken link to design docs

* Update to fflate (#448)

* Update to fflate

* Update docs, bundler config

* Scroll replayer iframe on firstFullsnapshot (#451)

* upgrade snapshot

* Release 0.9.12

* Protect against generation of no-change viewport resize events. (#454)

I noticed 8 or 10 of these events being generated in a multi-tab browsing session on Chrome 87.0 on Win10.  I'm speculating they were generated as a side effect of changing tabs but I can't recreate

* fix #452 check isBlocked on add mutation's target

* Release 0.9.13

* let mouse tail duration respect timer speed

* clean addList when meet a corner case

* fix #460 ignore added node that are not in document anymore

* upgrade 0.9.14

* Release 0.9.14

* Tweaks to timings to get tests passing on my dev laptop (#466)

* Tweaks to timings to get tests passing on my dev laptop - hopefully this makes tests more deterministic

* Okay understand what's going on now that the test has run in the travis environment

* fix #469 try to get original MutationObserver
We found Angular's zone module will patch MutationObserver which
make the browser hang in some scenarios.
Reference: angular/angular#26948

* Discovered that the common case of mouse movement or scrolling happening during `takeFullSnapshot` was causing mutations to be immediately emitted, contrary to the goal of rrweb-io/rrweb#385 (#470)

* Don't remove the style attributes altogether from tests; they are an important part of the mutations (#468)

These were removed in rrweb-io/rrweb@8ed1c99 in order to smooth over differences in test environments
so have maintained that by converting pixel values to 'Npx' (could also try rounding, but didn't attempt that)

* read __rrMutationObserver from window

* update guide (#483)

* Fix RangeError: Maximum call stack size exceeded (#479)

Saw this line cause issues in production, causing the following error:

```
RangeError Maximum call stack size exceeded
```

I believe this is caused by javascript engine max argument length - see note from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#using_apply_and_built-in_functions

> The consequences of applying a function with too many arguments (that is, more than tens of thousands of arguments) varies across engines. (The JavaScriptCore engine has hard-coded argument limit of 65536.

* Impl record iframe (#481)

* Impl record iframe

* iframe observe

* temp: add bundle file to git

* update bundle

* update with pick

* update bundle

* fix fragment map remove

* feat: add an option to determine whether to pause CSS animation when playback is paused (#428)

set pauseAnimation to true by default

* fix: elements would lose some states like scroll position because of "virtual parent" optimization (#427)

* fix: elements would lose some state like scroll position because of "virtual parent" optimization

* refactor: the bugfix code

bug: elements would lose some state like scroll position because of "virtual parent" optimization

* fix: an error occured at applyMutation(remove nodes part)

error message:
Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node

* pick fixes

* revert ignore file

* re-impl iframe record

* re-impl iframe replay

* code housekeeping

* move multi layer dimension calculation to replay side

* update test cases

* teardown test server

* upgrade rrweb-snapshot with iframe load timeout

Co-authored-by: Lucky Feng <yun.feng@smartx.com>

* remove debugging warning (#486)

I can't see a reason for the warning here so believe it's a debugging statement that crept in?

* Add prettier as a dependency (#487)

* start impl rrdom

* upgrade rrweb-snapshot to 1.0.7

* Adding prepare npm statement (#490)

* added prepare statement

* using master rrweb snapshot

Co-authored-by: filip slatinac <filipslatinac@MacBook-Pro-2.local>

* Added mousemoveCallback threshold option to sampling config. (#492)

* Added mousemoveCallback threshold option to sampling config.

* Added mousemoveCallback to definitions file.

* Add yarn support for installing unreleased rrweb as a dependency  (#497)

* Use prepack instead of prepare for yarn support

* add prepare and prepack

for yarn v1 & v2 compatibility

* Create .npmignore

* update guide

* close #501 do not count attach iframe event in checkout

* close #491 check whether link node is head

* update test snapshot

* fix lint errors

* add hiring link

* impl #507 export takeFullSnapshot as a public API

* Update observer.md (#504)

Fixed some grammatical errors

* add an experiment config to set max speed in fast forward

* Handle event undefined in initMoveObserver (#515)

* fix: errors of replaying iframe records (#520)

* fix: errors of replaying iframe records

error1:
HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type '#document' may not be inserted inside nodes of type '#document-fragment'.
code: parent.appendChild(target)

error2:
Uncaught DOMException: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.
code: parent.appendChild(target);

* improve the comment for bugfix

* rename node_modules in es bundle to ext

* fix: inaccurate mouse position (#522)

1. Position of mouse was inaccurate when replaying and this PR will fix it.
2. Fix the bug that if one nested iframe has a scale transform and the position of mouse was inaccurate as well.

* impl shadow DOM manager
part of #38
1. observe DOM mutations in shadow DOM
2. rebuild DOM mutations in shadow DOM

* Fix docs to point to correct event format (#523)

* Fix docs to point to correct event attribute

* Update customize-replayer.zh_CN.md

* correct event object in guide

* Update guide.zh_CN.md

* Update snapshot to Release 1.1.1

Co-authored-by: Lucky Feng <yun.feng@smartx.com>
Co-authored-by: Fanis Katsimpas <katsimpas.f@gmail.com>
Co-authored-by: Lucky Feng <f18846188605@gmail.com>
Co-authored-by: 101arrowz <arjunbarrett@gmail.com>
Co-authored-by: Jarosław Salwa <armata007@gmail.com>
Co-authored-by: Yanzhen Yu <yanzhen@smartx.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
Co-authored-by: zzq0826 <770166635@qq.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
Co-authored-by: Moji Izadmehr <m.eezadmehr@gmail.com>
Co-authored-by: Filip Slatinac <Fslat092@uottawa.ca>
Co-authored-by: filip slatinac <filipslatinac@MacBook-Pro-2.local>
Co-authored-by: Province Innovation <69924001+provinceinnovation@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Season <season@huzhenjiandeMacBook-Pro.local>
Co-authored-by: arshabh-copods <77658085+arshabh-copods@users.noreply.github.com>
Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>

Disable onAddHoverClass and duplicate full snapshot (#36)

* Don't rebuild full snapshot

* Add config for hover class

* Revert "Update rrweb (#35)"

This reverts commit 5dc4ca2.

* Bump version

fix-rrweb-patch (#37)

* Make check conditional

* Update to 0.11.0

Bump (#38)

Skip the first fullSnapshotBuild (#39)

User events for inactivity calculation (#40)

Make sure we publish a production build (#41)

Pull in fix for #528 from rrweb (#42)

Buffer modifications to virtual stylesheets (#43)

Test rrweb 1.0.1

Co-authored-by: Lucky Feng <yun.feng@smartx.com>
Co-authored-by: filip slatinac <filipslatinac@MacBook-Pro-2.local>
Co-authored-by: zhaoziqiu <zhaoziqiu@meituan.com>
Co-authored-by: yz-yu <yanzhen@smartx.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yash Kumar <yashkumar@Yashs-MacBook-Pro-2.local>
Co-authored-by: Lucky Feng <294889365@qq.com>
Co-authored-by: Vladimir Milenko <vladimir.milenko@uber.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
Co-authored-by: Fanis Katsimpas <katsimpas.f@gmail.com>
Co-authored-by: Lucky Feng <f18846188605@gmail.com>
Co-authored-by: 101arrowz <arjunbarrett@gmail.com>
Co-authored-by: Jarosław Salwa <armata007@gmail.com>
Co-authored-by: Yanzhen Yu <yanzhen@smartx.com>
Co-authored-by: zzq0826 <770166635@qq.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
Co-authored-by: Moji Izadmehr <m.eezadmehr@gmail.com>
Co-authored-by: Filip Slatinac <Fslat092@uottawa.ca>
Co-authored-by: Province Innovation <69924001+provinceinnovation@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Season <season@huzhenjiandeMacBook-Pro.local>
Co-authored-by: arshabh-copods <77658085+arshabh-copods@users.noreply.github.com>
Co-authored-by: Yakko Majuri <38760734+yakkomajuri@users.noreply.github.com>
Co-authored-by: re-fort <refort.dev@gmail.com>
Co-authored-by: Ziqiu Zhao <39512431+ZzqiZQute@users.noreply.github.com>
Co-authored-by: yashkumar18 <yashkumar1820@gmail.com>
Co-authored-by: bachmanity1 <81428651+bachmanity1@users.noreply.github.com>
Co-authored-by: Omair Nabiel <nabiel.omair@gmail.com>

Copy rrweb-io/rrweb#630 for DragEvent errors (#45)

Record and replay nested stylesheet rules (#46)

john/hig-1014-2nd-attempt-at-stitches-fix-in-rrweb (#47)

Apply nested styles refactor https://github.com/rrweb-io/rrweb/pull/667/files

john/hig-1046-apply-rrweb-css-change (#48)

Update Mirror to support null IDs

John/hig-1121-add-rrweb-patch-for-element-blocking (#49)

Set the blockClass background color to the same as the color (#51)

John/hig-1053-strictprivacy-mode-is-injecting-random (#52)

gc virtual style map when DOM has been removed (#53)

Monkeypatch each iframe (#54)

Update rrweb to 1.0.7 (#55)

Pause animations on pseudo elements (#56)

Add webgl recording and playback (#57)

Webgl-patches (#58)

* Add diffs

* Add missing changes

* Bump version

Patch webgl support for older Safari browsers

Make sure WebGL instance exists before saving

More patches for webgl recording

Update mouse cursor to make it visible on dark and light backgrounds

Bump version

Support loading CORS fonts through our proxy (#59)

John/hig-1919-update-rrweb (#60)

* Port over remaining webgl changes

* More updates

* https://github.com/rrweb-io/rrweb/pull/810/files

* https://github.com/rrweb-io/rrweb/pull/720/files

* Update package version

Make sure text mutations respect strict privacy mode (#61)

John/hig-1930-sync-rrweb-changes (#62)

* Sync change

* Port fix: an error when I stop the recording process

Change click behavior/visual (#63)

Silence the "please add custom even after start recording" (#64)

John/hig-1984-pull-in-rrweb-sequential-id-pr (#65)

* Add sequential IDs

* rrweb-io/rrweb#840

* bump version

Export sequential ID plugin

Ignore recording rrweb internal click events for canvas elements

John/hig-1998-apply-rrweb-commits (#66)

[HIG-2114] add replace events function for use by chunking (#67)

bump version (#68)

https://github.com/rrweb-io/rrweb/pull/866/files (#69)

remove promise to resolve immediately (#70)

baseline time check should include offset to avoid replaying past events (#71)

v1.1.20

fix rollup config (#72)

fix the bundle script so that we can use rrweb directly from a <script/> tag for use in server-side rrweb rendering (HIG-2197).

[HIG-2269] ensure invalid DOM nesting doesn't crash rrweb (#73)

Replaying an app with invalid DOM nesting may crash rrweb.
Print console warning instead of crashing.

highlight: merge rrweb (#74)

Update our fork based on rrweb@1.1.3 April 2022 Release
https://github.com/rrweb-io/rrweb/releases/tag/rrdom%400.1.2

highlight: merge rrweb (#74)

Update our fork based on rrweb@1.1.3 April 2022 Release
https://github.com/rrweb-io/rrweb/releases/tag/rrdom%400.1.2

merge rrweb #903 performance improvements (#75)

primarily to bring in Speed up snapshotting of many new dom nodes (#903)

Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yz-yu <yanzhen@smartx.com>
Co-authored-by: Rahul Lingala <88366029+rahulrelicx@users.noreply.github.com>
Co-authored-by: Dmytro Kozlovskyi <kozlovskidmytro@gmail.com>

remove testing from github actions

fix lerna publish step

improve error handling in rrdom (#76)

During live mode, we encounter rrdom errors related to
the replay of iframes. Ensure we handle these errors correctly rather
than crashing.

integrate fix for live mode #923 (#77)

[rrweb PR 923](rrweb-io/rrweb#923)

revert error catching code

merge rrweb PR #909 (#78)

rrweb-io/rrweb#909 with follow-up fix rrweb-io/rrweb#926

set empty link elements to loaded by default

Clean up stylesheet manager

Remove attribute mutation code

Update packages/rrweb/test/record.test.ts

Update packages/rrweb/test/record.test.ts

Update packages/rrweb/test/record.test.ts

Bump minimist from 1.2.5 to 1.2.6 (#902)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](substack/minimist@1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Speed up snapshotting of many new dom nodes (#903)

* Speed up snapshotting of many new dom nodes

By avoiding reflow we shave about 15-25% off our snapshotting time

* Improve newlyAddedElement docs

* Optimize needMaskingText by using el.closest and less recursion

* Serve all rrweb dist files

* Split serializeNode into smaller functions

Makes it easier to profile

* Slow down cpu enhance tracing on fast machines

* Increase timeout

* Perf: only loop through ancestors when they have something to compare to

* Perf: `hasNode` is cheaper than `getMeta`

* Perf: If parents where already checked, no need to do it again

* Perf: reverse for loops are faster

Because they only do the .lenght check once. In this case I don't think we'll see much performance gains if any

* Clean up code

* Perf: check ancestors once with isBlocked

* guessing this might fixes canvas test

* Update packages/rrweb/src/record/observers/canvas/webgl.ts

Co-authored-by: yz-yu <yanzhen@smartx.com>

* Fix #904 (#906)

Properly remove crossorigin attribute

* Bump minimist from 1.2.5 to 1.2.6 (#902)

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](substack/minimist@1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: yz-yu <yanzhen@smartx.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Move require out of time sensitive assert

Update packages/rrweb/scripts/repl.js

Update packages/rrweb/test/record.test.ts

Update packages/rrweb/src/record/index.ts

Add todo

Add waitForRAF, its more reliable than waitForTimeout

Remove flaky tests

Add recording stylesheets in iframes

Remove variability from flaky test

Make test more robust

Fix naming

Update dive-into-event.md (#914)

move browser-only rrdom features to the new rrdom package (#913)

integrate turborepo in monorepo (#918)

* integrate turborepo in monorepo

* integrate turborepo in monorepo

unify typescript version and rollup plugins (#921)

Add test cases for inlineImages

Add test cases for inlineImages

Record iframe mutations cross page

Test: should record images inside iframe with blob url after iframe was reloaded

update rrweb-snapshot

Handle negative ids in rrdom correctly

When iframes get inserted they create untracked elements, both on the dom and rrdom side.
Because they are untracked they generate negative numbers when fetching the id from mirror.
This creates a problem when comparing and fetching ids across mirrors.
This commit tries to get away from using negative ids as much as possible in rrdom's comparisons

remove rrdom diff debug log statements

fix rrweb canvas recording crash (#79)

slow canvas loading can cause the canvas manager worker to crash.
also fix a merge conflict in rrweb styles file.

obfuscate text for highlight-mask class (#84)

Use the `obfuscateText` function as a default masking transform for the `highlight-mask` css class.

update versions

update rrweb to #947 (#83)

merge up to rrweb-io/rrweb#947

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
Co-authored-by: Yanzhen Yu <yanzhen@smartx.com>
Co-authored-by: Jimmy Liu <sicong.liu98@gmail.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>

[HIG-2525] ensure highlight-mask blocks image src (#85)

`highlight-mask` class should be evaluated during image snapshotting to drop the image src.

publish rrweb

[HIG-2525] v2.1.4 make highlight-mask obfuscate images (#86)

`highlight-mask` class should hide images.

remove accidental console log (#87)

adds eslint rule to error on console logs

fix highlight-mask image obfuscation (#88)

fix how `highlight-mask` class obfuscates images
ensure image obfuscation works for `inline-images` enabled.

support canvas downsampling configuration (#89)

canvas recording takes snapshots at full canvas resolution
this is too slow to record at higher fps.
allow specifying canvas manager ratio and quality so that
the canvas can be imaged at lower quality and resolution to allow higher FPS recording

we now support the following `record` parameters for canvas settings:
* sampling.canvas.fps
* sampling.canvas.resizeQuality
* sampling.canvas.resizeFactor
* sampling.canvas.maxSnapshotDimension

sample recording @ 0.2 factor, low quality, 15 fps
https://app.highlight.run/1/sessions/KnAGq8rRSnafG7zXwp8ahpzFAqFd

fix client mutation observer check (#90)

ensure the element on which `.contains()` is called is a node.

Sort attributes to make `rr_*` attributes handled last

`rr_dataURL` overwrites `src` attribute, because of this we need to evaluate `rr_dataURL` last so it doesn't accidentally get overwritten again.
  • Loading branch information
jay-khatri authored and Vadman97 committed Oct 17, 2022
1 parent 2286c11 commit d3dff5e
Show file tree
Hide file tree
Showing 66 changed files with 868 additions and 167 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Eslint Check

on: [pull_request]

jobs:
eslint_check_upload:
runs-on: ubuntu-latest
name: ESLint Check and Report Upload

steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Install Dependencies
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- name: Build Packages
run: yarn build:all
- name: Test Code Linting
run: yarn turbo run lint
- name: Save Code Linting Report JSON
run: yarn lint:report
# Continue to the next step even if this fails
continue-on-error: true
- name: Upload ESLint report
uses: actions/upload-artifact@v3
with:
name: eslint_report.json
path: eslint_report.json

Annotation:
# Skip the annotation action in PRs from the forked repositories
if: github.event.pull_request.head.repo.full_name == 'rrweb-io/rrweb'
needs: eslint_check_upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: eslint_report.json
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Rrweb
on: push
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.15.0
registry-url: https://registry.npmjs.org
- name: Install
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- name: Build all
run: yarn build:all
# - name: Test all
# run: yarn test
- name: Setup Publish Env
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
if: github.ref == 'refs/heads/master'
run: yarn lerna publish from-package -y
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
node-version: 16
cache: 'yarn'
- name: Install Dependencies
run: yarn
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- name: Build Packages
run: yarn build:all
- name: Eslint Check
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ rrweb refers to 'record and replay the web', which is a tool for recording and r

[**🍳 Recipes 🍳**](./docs/recipes/index.md)

## Version History

### 2.0.0

This version updates the highlight rrweb fork on rrweb 1.1.3 April 2022 Release.
Because this is a major update, it may not be suitable for customers looking for stable recording and replay functionality.
However, the major update brings lots of rrweb features that have been in development. See the rrweb release notes for more details.

## Project Structure

rrweb is mainly composed of 3 parts:
Expand Down
14 changes: 7 additions & 7 deletions guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ The parameter of `rrweb.record` accepts the following options.
| emit | required | the callback function to get emitted events |
| checkoutEveryNth | - | take a full snapshot after every N events<br />refer to the [checkout](#checkout) chapter |
| checkoutEveryNms | - | take a full snapshot after every N ms<br />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 |
| blockClass | 'highlight-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 |
| ignoreClass | 'rr-ignore' | Use a string or RegExp to configure which elements should be ignored, refer to the [privacy](#privacy) chapter |
| ignoreClass | 'highlight-ignore' | Use a string or RegExp to configure which elements should be ignored, refer to the [privacy](#privacy) chapter |
| ignoreCSSAttributes | null | array of CSS attributes that should be ignored |
| maskTextClass | 'rr-mask' | Use a string or RegExp to configure which elements should be masked, refer to the [privacy](#privacy) chapter |
| maskTextClass | 'highlight-mask' | Use a string or RegExp to configure which elements should be masked, refer to the [privacy](#privacy) chapter |
| maskTextSelector | null | Use a string to configure which selector should be masked, refer to the [privacy](#privacy) chapter |
| maskAllInputs | false | mask all input content as \* |
| maskInputOptions | { password: true } | mask some kinds of input \*<br />refer to the [list](https://github.com/rrweb-io/rrweb/blob/588164aa12f1d94576f89ae0210b98f6e971c895/packages/rrweb-snapshot/src/types.ts#L77-L95) |
Expand All @@ -166,9 +166,9 @@ The parameter of `rrweb.record` accepts the following options.

You may find some contents on the webpage which are not willing to be recorded, then you can use the following approaches:

- 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.
- An element with the class name `.highlight-block` will not be recorded. Instead, it will replay as a placeholder with the same dimension.
- An element with the class name `.highlight-ignore` will not record its input events.
- All text of elements with the class name `.highlight-mask` and their children will be masked.
- `input[type="password"]` will be masked by default.
- Mask options to mask the content in input elements.

Expand Down Expand Up @@ -299,7 +299,7 @@ The replayer accepts options as its constructor's second parameter, and it has t
| skipInactive | false | whether to skip inactive time |
| showWarning | true | whether to print warning messages during replay |
| showDebug | false | whether to print debug messages during replay |
| blockClass | 'rr-block' | element with the class name will display as a blocked area |
| blockClass | 'highlight-block' | element with the class name will display as a blocked area |
| liveMode | false | whether to enable live mode |
| insertStyleRules | [] | accepts multiple CSS rule string, which will be injected into the replay iframe |
| triggerFocus | true | whether to trigger focus during replay |
Expand Down
14 changes: 7 additions & 7 deletions guide.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ setInterval(save, 10 * 1000);
| emit | 必填 | 获取当前录制的数据 |
| checkoutEveryNth | - | 每 N 次事件重新制作一次全量快照<br />详见[“重新制作快照”](#重新制作快照)章节 |
| checkoutEveryNms | - | 每 N 毫秒重新制作一次全量快照<br />详见[“重新制作快照”](#重新制作快照)章节 |
| blockClass | 'rr-block' | 字符串或正则表达式,可用于自定义屏蔽元素的类名,详见[“隐私”](#隐私)章节 |
| blockClass | 'highlight-block' | 字符串或正则表达式,可用于自定义屏蔽元素的类名,详见[“隐私”](#隐私)章节 |
| blockSelector | null | 所有 element.matches(blockSelector)为 true 的元素都不会被录制,回放时取而代之的是一个同等宽高的占位元素 |
| ignoreClass | 'rr-ignore' | 字符串或正则表达式,可用于自定义忽略元素的类名,详见[“隐私”](#隐私)章节 |
| ignoreClass | 'highlight-ignore' | 字符串或正则表达式,可用于自定义忽略元素的类名,详见[“隐私”](#隐私)章节 |
| ignoreCSSAttributes | null | 应该被忽略的 CSS 属性数组 |
| maskTextClass | 'rr-mask' | 字符串或正则表达式,可用于自定义忽略元素 text 内容的类名,详见[“隐私”](#隐私)章节 |
| maskTextClass | 'highlight-mask' | 字符串或正则表达式,可用于自定义忽略元素 text 内容的类名,详见[“隐私”](#隐私)章节 |
| maskTextSelector | null | 所有 element.matches(maskTextSelector)为 true 的元素及其子元素的 text 内容将会被屏蔽 |
| maskAllInputs | false | 将所有输入内容记录为 \* |
| maskInputOptions | { password: true } | 选择将特定类型的输入框内容记录为 \*<br />类型详见[列表](https://github.com/rrweb-io/rrweb/blob/588164aa12f1d94576f89ae0210b98f6e971c895/packages/rrweb-snapshot/src/types.ts#L77-L95) |
Expand All @@ -162,9 +162,9 @@ setInterval(save, 10 * 1000);

页面中可能存在一些隐私相关的内容不希望被录制,rrweb 为此做了以下支持:

- 在 HTML 元素中添加类名 `.rr-block` 将会避免该元素及其子元素被录制,回放时取而代之的是一个同等宽高的占位元素。
- 在 HTML 元素中添加类名 `.rr-ignore` 将会避免录制该元素的输入事件。
- 所有带有`.rr-mask`类名的元素及其子元素的 text 内容将会被屏蔽。
- 在 HTML 元素中添加类名 `.highlight-block` 将会避免该元素及其子元素被录制,回放时取而代之的是一个同等宽高的占位元素。
- 在 HTML 元素中添加类名 `.highlight-ignore` 将会避免录制该元素的输入事件。
- 所有带有`.highlight-mask`类名的元素及其子元素的 text 内容将会被屏蔽。
- `input[type="password"]` 类型的密码输入框默认不会录制输入事件。
- 配置中还有更为丰富的隐私保护选项。

Expand Down Expand Up @@ -295,7 +295,7 @@ replayer.destroy();
| skipInactive | false | 是否快速跳过无用户操作的阶段 |
| showWarning | true | 是否在回放过程中打印警告信息 |
| showDebug | false | 是否在回放过程中打印 debug 信息 |
| blockClass | 'rr-block' | 需要在回放时展示为隐藏区域的元素类名 |
| blockClass | 'highlight-block' | 需要在回放时展示为隐藏区域的元素类名 |
| liveMode | false | 是否开启直播模式 |
| insertStyleRules | [] | 可以传入多个 CSS rule string,用于自定义回放时 iframe 内的样式 |
| triggerFocus | true | 回放时是否回放 focus 交互 |
Expand Down
21 changes: 21 additions & 0 deletions packages/rrdom-nodejs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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.
10 changes: 5 additions & 5 deletions packages/rrdom-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrdom-nodejs",
"version": "0.1.6",
"name": "@highlight-run/rrdom-nodejs",
"version": "0.1.8",
"scripts": {
"dev": "rollup -c -w",
"bundle": "rollup --config",
Expand Down Expand Up @@ -46,11 +46,11 @@
"typescript": "^4.7.3"
},
"dependencies": {
"@highlight-run/rrdom": "0.1.17",
"@highlight-run/rrweb-snapshot": "1.1.31",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"nwsapi": "^2.2.0",
"rrdom": "^0.1.6",
"rrweb-snapshot": "^2.0.0-alpha.3"
"nwsapi": "^2.2.0"
},
"browserslist": [
"supports es6-class"
Expand Down
4 changes: 2 additions & 2 deletions packages/rrdom-nodejs/src/document-nodejs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { NodeType as RRNodeType } from 'rrweb-snapshot';
import { NodeType as RRNodeType } from '@highlight-run/rrweb-snapshot';
import type { NWSAPI } from 'nwsapi';
import type { CSSStyleDeclaration as CSSStyleDeclarationType } from 'cssstyle';
import {
Expand All @@ -14,7 +14,7 @@ import {
ClassList,
IRRDocument,
CSSStyleDeclaration,
} from 'rrdom';
} from '@highlight-run/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
Expand Down
4 changes: 2 additions & 2 deletions packages/rrdom-nodejs/test/document-nodejs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '@highlight-run/rrweb-snapshot';
import {
RRCanvasElement,
RRCDATASection,
Expand All @@ -16,7 +16,7 @@ import {
RRStyleElement,
RRText,
} from '../src/document-nodejs';
import { buildFromDom } from 'rrdom';
import { buildFromDom } from '@highlight-run/rrdom';

describe('RRDocument for nodejs environment', () => {
describe('RRDocument API', () => {
Expand Down
Loading

0 comments on commit d3dff5e

Please sign in to comment.