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

Sync from source repo #19

Merged
merged 11 commits into from
Feb 7, 2025
Merged

Sync from source repo #19

merged 11 commits into from
Feb 7, 2025

Conversation

gnpaone
Copy link
Collaborator

@gnpaone gnpaone commented Feb 7, 2025

No description provided.

eoghanmurray and others added 11 commits February 4, 2025 14:53
…n with `isAttachIframe`' test (rrweb-io#1636)

- it was working for me when the test was run in isolation (`-t` option), but when the entire cross-origin-iframes test was run, the change of iframe contents didn't seem to happen in time
* update actions/upload-artifact to v4

---------

Co-authored-by: Eoghan Murray <[email protected]>
* [chore] Cache yarn packages for CI

* Cache yarn in release.yml

* [chore] Update deprecated download artifact on CI (rrweb-io#1647)

* I'm merging even though ESLint is stlll failing in Github Actions as I believe it's running actions _without_ this PR applied yet
* chore(ci): track bundle size

---------

Co-authored-by: pauldambra <[email protected]>
Fix for rrweb-io#1575 where postcss was raising an exception

* adapt the entire CSS as a whole in one pass with postcss, rather than adapting each split part separately
* break up the postcss output again and assign to individual text nodes (kind of inverse of splitCssText at record side)
* impose an upper bound of 30 iterations on the substring searches to preempt possible pathological behavior
* add tests to demonstrate the scenario and prevent regression

More technical details:
* Fix algorithm; checks against `ix_end` within loop were incorrect when `ix_start` was bigger than zero.  
* Fix that length check against wrong array was causing 'should record style mutations with multiple child nodes and replay them correctly' test to fail. 
Note on last point: I haven't looked into things more deeply than that the test was complaining about missing .length after `replayer.pause(1000);`
* postcss was introduced in rrweb-io#1458 for use within adaptCssForReplay
* rrweb-io#1600 fixes the main case where invalid css could be introduced when if valid css from the output of `sheet.cssRules` was split according to how it was split across text nodes of the <style>
* the guard introduced here is still useful as we likely in future will switch to capturing the raw stylesheet contents (both <style> and <link>), at which point we will be much less confident of getting valid css
Fixes a browser 'lock up' at record time due to a presence of large amounts of css in <style> elements, which are split over multiple text nodes, which triggers the new code added in rrweb-io#1437 (see that PR for full explanation of why this all exists).  rrweb-io#1437 was not written with performance in mind as it was believed to be an edge case, but things like Grammarly browser extension (rrweb-io#1603) among other scenarios were triggering pathological behavior, some of which was solved in rrweb-io#1615.
See also rrweb-io#1640 (comment) for further discussion.

* Fix the case when there are multiple matches and we end up not finding a unique one - just go with the best guess when there are many splits by looking at the previous chunk's size
* Also add '0px' -> '0' stylesheet normalization, which also fixes the sample problem in a different way
* Add new test and modify it so that it can trigger a failure in the absence of the '0px' normalization; there may be other unknown ways of triggering a similar bug, so ensure that the primary 'best guess' method doesn't suffer a regression
* Leverage the 'best guess' method so that we can quit after 100 iterations trying to find a unique substring; hopefully this bit along with the `iterLimit` already added will prevent any future pathological cases.

Failing example extracted from large files identified by Paul D'Ambra (Posthog) ... see comment from MartinWorkfully: PostHog/posthog-js#1668
* fix: move patch function into utils to improve bundling

---------

Co-authored-by: pauldambra <[email protected]>
Co-authored-by: Justin Halsall <[email protected]>
@gnpaone gnpaone merged commit 4309de7 into master Feb 7, 2025
7 checks passed
Copy link

github-actions bot commented Feb 7, 2025

Size Change: 0 B

Total Size: 10.4 MB

ℹ️ View Unchanged
Filename Size
packages/all/dist/all.cjs 559 kB
packages/all/dist/all.js 558 kB
packages/all/dist/all.umd.cjs 562 kB
packages/all/dist/all.umd.min.cjs 273 kB
packages/packer/dist/base-B40z8PPs.cjs 18.3 kB
packages/packer/dist/base-B40z8PPs.umd.cjs 19.4 kB
packages/packer/dist/base-B40z8PPs.umd.min.cjs 10.1 kB
packages/packer/dist/base-BrE4jft0.js 18.2 kB
packages/packer/dist/pack.cjs 347 B
packages/packer/dist/pack.js 285 B
packages/packer/dist/pack.umd.cjs 2.25 kB
packages/packer/dist/pack.umd.min.cjs 1.73 kB
packages/packer/dist/packer.cjs 257 B
packages/packer/dist/packer.js 136 B
packages/packer/dist/packer.umd.cjs 1.28 kB
packages/packer/dist/packer.umd.min.cjs 1.25 kB
packages/packer/dist/unpack.cjs 769 B
packages/packer/dist/unpack.js 702 B
packages/packer/dist/unpack.umd.cjs 1.79 kB
packages/packer/dist/unpack.umd.min.cjs 1.57 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.cjs 37.6 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.js 37.5 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.cjs 38.7 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.min.cjs 22.9 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.cjs 34.3 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.js 34.2 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs 35.4 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.min.cjs 21.2 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.cjs 15 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.js 14.9 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.cjs 16.1 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.min.cjs 8.03 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.cjs 5.01 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.js 4.9 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.cjs 6.07 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.min.cjs 3.27 kB
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.cjs 681 B
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.js 548 B
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.cjs 1.76 kB
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.min.cjs 1.47 kB
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.cjs 933 B
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.js 820 B
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.cjs 2.01 kB
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.min.cjs 1.61 kB
packages/record/dist/record.cjs 379 kB
packages/record/dist/record.js 379 kB
packages/record/dist/record.umd.cjs 382 kB
packages/record/dist/record.umd.min.cjs 183 kB
packages/replay/dist/replay.cjs 389 kB
packages/replay/dist/replay.js 389 kB
packages/replay/dist/replay.umd.cjs 392 kB
packages/replay/dist/replay.umd.min.cjs 194 kB
packages/replay/dist/style.css 2.45 kB
packages/replay/dist/style.min.css 1.97 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.cjs 132 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.js 131 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.umd.cjs 134 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.umd.min.cjs 66.9 kB
packages/rrdom/dist/rrdom.cjs 150 kB
packages/rrdom/dist/rrdom.js 149 kB
packages/rrdom/dist/rrdom.umd.cjs 152 kB
packages/rrdom/dist/rrdom.umd.min.cjs 74.1 kB
packages/rrweb-player/dist/events.js 159 kB
packages/rrweb-player/dist/global.css 240 B
packages/rrweb-player/dist/rrweb-player.cjs 461 kB
packages/rrweb-player/dist/rrweb-player.js 461 kB
packages/rrweb-player/dist/rrweb-player.umd.cjs 464 kB
packages/rrweb-player/dist/rrweb-player.umd.min.cjs 223 kB
packages/rrweb-player/dist/style.css 5.57 kB
packages/rrweb-player/dist/style.min.css 5 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.cjs 167 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.js 166 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.umd.cjs 169 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.umd.min.cjs 82.8 kB
packages/rrweb/dist/rrweb.cjs 541 kB
packages/rrweb/dist/rrweb.js 541 kB
packages/rrweb/dist/rrweb.umd.cjs 543 kB
packages/rrweb/dist/rrweb.umd.min.cjs 263 kB
packages/rrweb/dist/style.css 2.45 kB
packages/rrweb/dist/style.min.css 1.97 kB
packages/types/dist/types.cjs 5.63 kB
packages/types/dist/types.js 5.38 kB
packages/types/dist/types.umd.cjs 6.66 kB
packages/types/dist/types.umd.min.cjs 3.41 kB
packages/utils/dist/utils.cjs 6.07 kB
packages/utils/dist/utils.js 5.57 kB
packages/utils/dist/utils.umd.cjs 7.1 kB
packages/utils/dist/utils.umd.min.cjs 3.98 kB

compressed-size-action

@gnpaone gnpaone deleted the sync-branch branch February 7, 2025 13:48
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.

6 participants