Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sentry): update with latest upstream changes #189

Merged
merged 51 commits into from
Apr 30, 2024

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Apr 26, 2024

This brings our fork up to date with the latest upstream changes except the reverted commits in #186.

develop branch will represent the rrweb changes that we want to use, master tracks upstream master, and sentry-v2 is contains our forked changes on top of develop.

KentoMoriwaki and others added 30 commits October 6, 2023 10:42
…rweb-io#1311)

* Add config option to turn off all snapshotting and related observers

 - allows RRWEB to be used for click/movement tracking alone, e.g. for a heatmaps use case
 - could also be used if there was a separate process for recording the DOM (in which case a 3rd party library like https://github.com/antonmedv/finder could be added to record targets instead of the mirror)
---------

Authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
…-io#1310)

* Extends maskTextFn to pass the HTMLElement to the deciding function

---------

Authored-by: benjackwhite <benjackwhite@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
*  export eventWithTime for consumption in typescript code
* Fix linting issues

* Apply formatting changes
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* only call createHTMLDocument where it is needed

* Perf: create the mutation document once as a 'singleton' as it can be reused

---------

Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io>
…nts (rrweb-io#1155)

* Feat: Add support for replaying :defined pseudo-class of custom elements

* add isCustom flag to serialized elements

Applying Justin's review suggestion

* fix code lint error

* add custom element event

* fix: tests (rrweb-io#1348)

* Update packages/rrweb/src/record/observer.ts

* Update packages/rrweb/src/record/observer.ts

---------

Co-authored-by: Nafees Nehar <nafees87n@gmail.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
… the DOM (rrweb-io#1349)

* masking performance: avoid the repeated calls to `closest` when recursing through the DOM
 - needsMask===true means that an ancestor has tested positively for masking, and so this node and all descendents should be masked
 - needsMask===false means that no ancestors have tested positively for masking, we should check each node encountered
 - needsMask===undefined means that we don't know whether ancestors are masked or not (e.g. after a mutation) and should look up the tree
* Add tests including an explicit characterData mutation tests 
* Further performance improvement: avoid calls to `el.matches` when on a leaf node, e.g. a `<br/>`
---------

Authored-by: eoghanmurray <eoghan@getthere.ie>
Based on initial PR rrweb-io#1338 by Alexey Babik <alexey.babik@noibu.com>
* Fix serialization and mutation of <textarea> elements taking account the duality that the value can be set in either the child node, or in the value _parameter_ (not attribute)

* Backwards compatibility: Bug fix and regression test for #112
 - this is to fix up 'historical' recordings, as duplicate textarea content should no longer be being created at record time
 - new test shows what the snapshot generated by previous versions of rrweb used to look like, hence 'bad'
 - original 0efe23f fix either didn't work or no longer works due to childNodes being appended subsequent to this part of the code
 - during review, we also verified that the `_cssText` case should still be handled okay, as there's currently no scenario where csstext is present with css child nodes of a <style>

* Masking: Fix that textarea values were being missed by the masking system if the value was recorded as a child node
 - I didn't notice that form.html was used in other tests, so lucky that I noticed that those tests also should have the 'pre value' masked out

* Simplify by always storing the textarea value in the `.value` attribute (from it's DOM property) and not as a childNode. It should still be rebuilt as a childNode rather than a property
---------

Authored-by: eoghanmurray <eoghan@getthere.ie>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
* Update Node version to LTS

* Create silver-windows-float.md
* Add UXWizz to Readme (CN)

* Add UXWizz to Readme

* Create hip-worms-relax.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* Add rrweb presentation

Add Justin Halsall open to rrweb consulting

* Create few-rockets-travel.md

* Update README.md

* Update README.md

* Fix alignment
* chore: export canvasMutation

* add changeset
* fix: console logger can serialize bigint values

* teach test jsdom is present

* add a changeset
* Update export-to-video.md

The file was pointing to the old Rrvideo repo The old repository soon is going to be closed as the Rrvideo was merged on Rrweb This change is pointing this recipe to the new and updated official doc.

* Update export-to-video.zh_CN.md

The file was pointing to the old Rrvideo repo The old repository soon is going to be closed as the Rrvideo was merged on Rrweb This change is pointing this recipe to the new and updated official doc.

Chinese version
* run tests without concurrency

* do not use cache in rpt2 during test
)

* Make properties x and y optional in mouseInteractionParam

The event representing a mouse interaction of focus an element does not include the properties x and y. Thus, they must be defined as optional.

* Fix typings
* feat(Snapshot): Capture stylesheets designated as `rel="preload"`

* fix(Snapshot): Harden asset file extension matching

* Add changeset

* chore: Lint

* Tweak regex, add try-catch block on URL constructor
* fix: scrolling can be incorrect when fast-forwarding

* add test case

* add changeset and remove duplicate diffProps process

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
eoghanmurray and others added 21 commits March 26, 2024 16:44
…o#1431)

* We weren't recursing into media queries (or @supports etc.) to rewrite hover pseudoclasses

* The early return meant that the stylesWithHoverClass cache wasn't being populated if there were no hover selectors on the stylesheet

 - not committing the test, but modifying the existing 'add a hover class to a previously processed css string' as follows shows the problem:

--- a/packages/rrweb-snapshot/test/rebuild.test.ts
+++ b/packages/rrweb-snapshot/test/rebuild.test.ts
@@ -151,6 +185,7 @@ describe('rebuild', function () {
         path.resolve(__dirname, './css/benchmark.css'),
         'utf8',
       );
+      cssText = cssText.replace(/:hover/g, '');

       const start = process.hrtime();
       addHoverClass(cssText, cache);

* Replace `min-device-width` and similar with `min-width` as the former looks out at the browser viewport whereas we need it to look at the replayer iframe viewport

* Add some tests to show how the hover replacement works against selector lists. I believe these were failing in a previous version of rrweb as I had some local patches that no longer seem to be needed to handle these cases

* Update name of function to reflect that 'addHoverClass' does more than just :hover. I believe this function is only exported for the purposes of use in the tests

* Apply formatting changes

* Create rotten-spies-enjoy.md

* Apply formatting changes

* Add correct typing on `getSelectors`

* Refactor CSS interfaces to include optional rules

* Change `rules` to be non optional

---------

Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* Add HowdyGo to Who's using rrweb

* Create twenty-goats-kneel.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* try/catch injection of recording script in rrweb repl and stream

* Add empty changesets
)

* fix: createImageBitmap throws DOMException if source is 0

* code review

* fix

* Create breezy-cats-heal.md

* fix format

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* protect against a missing parent node during a mutation on an textNode
…layer (rrweb-io#1408)

Expose constant SKIP_TIME_THRESHOLD as `inactivePeriodThreshold` config setting in replayer
…eb-io#1432)

* Add support for capturing media attributes in rrweb-snapshot

* Add loop to mediaInteractionParam

* Add support for loop in RRMediaElement

* Add support for recording loop attribute on media elements

* Update video playback and fix bugs

* Update cross-origin iframe media attributes and player state
* Fix known issues

* Run format

* Fix linting errors

* Add comment in code for source of match logic

* Add changeset
…xt" (rrweb-io#1369)

* Add "types" field to fix error when using "moduleResolution": "NodeNext".

* Add changeset.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* better splitting of selectors - overlapping with rrweb-io#1401 
* Add test from example at PostHog/posthog#21427
* ignore brackets inside selector strings
* Add another test as noticed that it's possible to escape strings
* Ensure we are ignoring commas within strings

Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
…sion (rrweb-io#1441)

performance: remove a nested function call and an object clone during event emission

 - rename `event` to `eventWithoutTime`, but maintain backwards compatibility
 - `eventWithTime` (with time) could be renamed to `event` in a future version

This is an extension of PR rrweb-io#1339 authored by: mydea <mydea@users.noreply.github.com>
Reverts the following commits from upstream that we do not want or have
not tested yet:

- [Enable
preserveSource](297104c)
- [Fix serialization and mutation of <textarea>
elements](a2be77b)
- [Full overhawl of video & audio playback to make it more
complete](123a81e)
- [Masking: Avoid the repeated calls to closest when recursing through
the
DOM](07ac5c9)
Copy link

github-actions bot commented Apr 26, 2024

size-limit report 📦

Path Size
rrweb - record only (gzipped) 17.01 KB (+0.74% 🔺)
rrweb - record & CanvasManager only (gzipped) 19.83 KB (+0.69% 🔺)
rrweb - record only (min) 57.82 KB (+0.62% 🔺)
rrweb - record with treeshaking flags (gzipped) 15.8 KB (+0.84% 🔺)

@billyvg billyvg marked this pull request as ready for review April 26, 2024 21:46
@billyvg billyvg changed the title feat: update with latest upstream changes feat(sentry): update with latest upstream changes Apr 30, 2024
@billyvg billyvg merged commit cf9c32e into sentry-v2 Apr 30, 2024
14 checks passed
@billyvg billyvg deleted the sentry-v2-merge-with-develop branch April 30, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet