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
2 people authored and jxiwang committed Oct 22, 2024
1 parent fee67b5 commit b834f12
Show file tree
Hide file tree
Showing 8 changed files with 3,722 additions and 5,745 deletions.
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 b834f12

Please sign in to comment.