Skip to content

Commit

Permalink
chore: create new release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 17, 2023
1 parent f06a300 commit 49259c1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
14 changes: 0 additions & 14 deletions .changeset/hot-wolves-jog.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-zoos-fix.md

This file was deleted.

20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# @sv443-network/userutils

## 3.0.0

### Major Changes

- 1859022: `onSelector()` has been turned into the `SelectorObserver` class to reduce the performance impact on larger sites:

- its instances can be scoped to any element lower in the DOM tree, unlike before where it was always observing the entire body with all its children
- separate instances can be disabled and reenabled individually on demand
- separate instances can have different MutationObserver options set to further reduce performance impact
- the separation into instances allows for a new "chaining" paradigm where selector listeners are only added and checked for once they are actually needed (see examples in the documentation)
- every listener can have a set debounce time, so that it doesn't get called too often (works the same as the [`debounce()` function](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#debounce), but is disabled by default)
- there are now multiple methods to get and delete specific or all listeners

The `SelectorObserver.addListener()` method is backwards compatible with the old `onSelector()` function, so you can just add the class instance in front (for full backwards compat use `document.body` for the baseElement parameter), then change the old function's name and it should work as before.
For more info and examples, please view the [SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#selectorobserver)

### Patch Changes

- a123da6: Add `@linkcode` references to the JSDoc in-IDE documentation

## 2.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sv443-network/userutils",
"version": "2.0.1",
"version": "3.0.0",
"description": "Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent user configurations, modify the DOM more easily and more",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down

0 comments on commit 49259c1

Please sign in to comment.