Skip to content

Commit 375e8a1

Browse files
authored
Merge pull request #25 from Sv443-Network/changeset-release/main
2 parents cc80c3e + 38002d7 commit 375e8a1

File tree

7 files changed

+35
-41
lines changed

7 files changed

+35
-41
lines changed

.changeset/curvy-needles-obey.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

.changeset/fifty-students-talk.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/hot-wolves-jog.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.changeset/khaki-cobras-bathe.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/tender-zoos-fix.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# @sv443-network/userutils
22

3+
## 3.0.0
4+
5+
### Major Changes
6+
7+
- 1859022: `onSelector()` has been turned into the `SelectorObserver` class to reduce the performance impact on larger sites:
8+
9+
- 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
10+
- separate instances can be disabled and reenabled individually on demand
11+
- separate instances can have different MutationObserver options set to further reduce performance impact
12+
- 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)
13+
- when using chaining, separate instances can be created and have listeners added to them before their base element is available in the DOM tree
14+
- 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)
15+
- there are now multiple methods to get and delete specific listeners
16+
17+
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 of the constructor), then change the old function's name and it should work as before.
18+
For more info and examples, please view the [SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#selectorobserver)
19+
20+
### Minor Changes
21+
22+
- 0db73b5: Removed the limiter (DynamicsCompressorNode) from `amplifyMedia()` for clear and undistorted audio.
23+
24+
**Notable changes:**
25+
26+
- The property `source` has been renamed to `sourceNode` to fit the naming of the `gainNode` property
27+
- A boolean property `enabled` has been added to check if the amplification is enabled or not
28+
- The parameter `initialMultiplier` has been renamed to `initialGain` to reduce confusion (it is not a multiplier strictly speaking)
29+
30+
- 736784f: Added function `randomId()` to randomly generate cryptographically strong hexadecimal IDs
31+
- 563e515: Added utility type `NonEmptyArray` for typing an array with at least 1 item
32+
33+
### Patch Changes
34+
35+
- a123da6: Added `@linkcode` references to the JSDoc in-IDE documentation
36+
337
## 2.0.1
438

539
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sv443-network/userutils",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"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",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

0 commit comments

Comments
 (0)