Skip to content

Commit

Permalink
feat: add new css parser - postcss (rrweb-io#1458)
Browse files Browse the repository at this point in the history
* feat: add new css parser

* make selectors change

* selectors and tests

* media changes

* remove old css references

* better variable name

* use postcss and port tests

* fix media test

* inline plugins

* fix failing multiline selector

* correct test result

* move tests to correct file

* cleanup all tests

* remove unused css-tree

* update bundle

* cleanup dependencies

* revert config files to master

* remove d.ts files

* update snapshot

* reset rebuilt test

* apply fuzzy css matching

* remove extra test

* Fix imports

* Newer versions of nswapi break rrdom-nodejs tests.
Example:
 FAIL  test/document-nodejs.test.ts > RRDocument for nodejs environment > RRDocument API > querySelectorAll
TypeError: e[api] is not a function
 ❯ byTag ../../node_modules/nwsapi/src/nwsapi.js:390:37
 ❯ Array.<anonymous> ../../node_modules/nwsapi/src/nwsapi.js:327:113
 ❯ collect ../../node_modules/nwsapi/src/nwsapi.js:1578:32
 ❯ Object._querySelectorAll [as select] ../../node_modules/nwsapi/src/nwsapi.js:1533:36
 ❯ RRDocument.querySelectorAll src/document-nodejs.ts:96:24

* Migrate from jest to vitest

* Order of selectors has changed with postcss

* Remove unused eslint

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
  • Loading branch information
daibhin and Juice10 authored Jun 27, 2024
1 parent db20184 commit 89ae4d2
Show file tree
Hide file tree
Showing 9 changed files with 3,723 additions and 5,745 deletions.
2 changes: 1 addition & 1 deletion packages/rrdom-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"nwsapi": "^2.2.0",
"nwsapi": "2.2.0",
"rrdom": "^2.0.0-alpha.16",
"rrweb-snapshot": "^2.0.0-alpha.16"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/rrweb-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@
"vite": "^5.3.1",
"vite-plugin-dts": "^3.9.1",
"vitest": "^1.4.0"
},
"dependencies": {
"postcss": "^8.4.38"
}
}
Loading

0 comments on commit 89ae4d2

Please sign in to comment.