rrweb-io / rrweb

record and replay the web
https://www.rrweb.io/
MIT License
15.9k stars 1.38k forks source link

Added support for deprecated addRule & removeRule methods #1515

Open okejminja opened 2 weeks ago

okejminja commented 2 weeks ago

We recently had a client on our fork who still uses addRule & removeRule (bad practice, I know, but we had to support 'em)

This PR add support for deprecated methods addRule & removeRule

Instead of writing duplicate code to support these or make some sort of an abstraction I just "transpiled" the props from addRule to what insertRule accepts and called the original insertRule or deleteRule accordingly – let you guys' methods handle the rest

Also expanded the test for capturing stylesheets to test this

LMK what you think

changeset-bot[bot] commented 2 weeks ago

🦋 Changeset detected

Latest commit: ad0fa7f31dfb14bf33d8750f29387453211c8708

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

This PR includes changesets to release 9 packages | Name | Type | | -------------------- | ----- | | @rrweb/record | Patch | | rrweb | Patch | | rrweb-snapshot | Patch | | rrdom | Patch | | rrdom-nodejs | Patch | | rrweb-player | Patch | | @rrweb/types | Patch | | @rrweb/web-extension | Patch | | 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