replay :hover rewrite - instead mutate stylesheets#1480
Draft
eoghanmurray wants to merge 7 commits intorrweb-io:masterfrom
Draft
replay :hover rewrite - instead mutate stylesheets#1480eoghanmurray wants to merge 7 commits intorrweb-io:masterfrom
:hover rewrite - instead mutate stylesheets#1480eoghanmurray wants to merge 7 commits intorrweb-io:masterfrom
Conversation
🦋 Changeset detectedLatest commit: 0a04127 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
:hover rewrite - instead mutate stylesheets
4177e18 to
17459cd
Compare
eoghanmurray
commented
May 20, 2024
| import { createMirror, Mirror, stringifyStylesheet } from '../src/utils'; | ||
|
|
||
| /* | ||
| function toEqualCss(actual: string, expected: string) { |
Contributor
Author
There was a problem hiding this comment.
I made an attempt to write my own expect matcher, but gave up due to typescript overhead and wrote norm instead
9a1a0c6 to
5456cc3
Compare
4070a92 to
85db6c2
Compare
…s programmatically after it's added to the page instead of parsing the text - means we don't have to rely on regexp parsing to get css selectors and media statements - could be adapted for use against <link> stylesheets during replay
…lesheetForReplay` until the <style> element is in the DOM
…rantee that the adapt process will not rewrite
6a91327 to
0a04127
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
switch to model where we adapt the replay stylesheets programmatically after they have been added to the page instead of parsing the text
cssTexttext value to ensure we are substituting css selectors and media statements correctly<link>stylesheets during replay#1458 points out failings in the current css parsing, and switches to
postcss. This is an alternative to that and removes all 3rd party dependencies.This PR could also be a contender as a fix for #1478 (although I suspect something else is the matter there, as I couldn't create a stylesheet with the CSS text from that)
How to help:
ignoreline and upgrading typescript to a version that incorporates Add StyleSheetList and CSSRuleList to dom.iterable.d.ts microsoft/TypeScript#23406 bugfixadaptStylesheetForReplayafter a virtual dom operation (i.e. fastforward in replayer which has a diff of adding a new stylesheet)