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

fix(rrweb): Fix some css issues with :hover and rewrite max-device-width #17

Merged
merged 12 commits into from
Jun 24, 2024

Conversation

jxiwang
Copy link
Collaborator

@jxiwang jxiwang commented Jun 21, 2024

Additional fixes for the hover class mentioned here.

Pre-requisite fix for regex issues. #16

eoghanmurray and others added 12 commits June 21, 2024 14:37
…ng 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);
… looks out at the browser viewport whereas we need it to look at the replayer iframe viewport
…or 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
…n just :hover. I believe this function is only exported for the purposes of use in the tests
Copy link

changeset-bot bot commented Jun 21, 2024

🦋 Changeset detected

Latest commit: 937a552

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@amplitude/rrweb Patch
@amplitude/rrweb-snapshot Patch
@amplitude/rrdom Patch
@amplitude/rrdom-nodejs Patch
@amplitude/rrweb-player Patch
@amplitude/rrweb-types Patch
@amplitude/rrweb-web-extension Patch
@amplitude/rrvideo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxiwang jxiwang changed the title Amp 99342 regex error hoverclas fix(rrweb): Fix some css issues with :hover and rewrite max-device-width Jun 21, 2024
@jxiwang jxiwang merged commit bf451d5 into master Jun 24, 2024
8 of 10 checks passed
@github-actions github-actions bot mentioned this pull request Jun 24, 2024
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.

4 participants