Skip to content

Conversation

JAForbes
Copy link
Collaborator

@JAForbes JAForbes commented Aug 14, 2025

Release v2.3.5

Changelog

Patch Changes

Assorted Performance Improvements (@kfule)

This PR improves performance through the following changes: Adoption of the spread syntax, which can be optimized in modern browsers.

Bump actions/checkout from 4 to 5 in the normal group (@dependabot[bot])

Bumps the normal group with 1 update: actions/checkout. Updates actions/checkout from 4 to 5. Release notes.

Bumps the normal group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: normal
...

Signed-off-by: dependabot[bot] <[email protected]>
@JAForbes JAForbes added dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code labels Aug 14, 2025
@JAForbes JAForbes requested a review from a team as a code owner August 14, 2025 20:22
@JAForbes JAForbes added patch dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code labels Aug 14, 2025
* hyperscriptVnode: use spread syntax

The implementation adopts spread syntax, inspired by the approach mentioned in the comments. However, argument handling has been adjusted for better performance.

Using spread syntax not only allows related comments to be deleted, but also slightly reduces bundle size and improves benchmarks by several percent.

All existing tests pass successfully.

Note that spread syntax does not seem to be supported by the existing internal bundler in some cases, so the bundler has also been updated to prevent incorrect suffix handling.

* allow attrs to be undefined and execute early return in `execSelector()`

Since commit f9e5163, attrs is never null/undefined. However, `m.render()` takes into account the case where attrs is null/undefined, and it is better to use undefined from a performance point of view.

Also, early return within `execSelector()` contributes to further performance improvement.

Some tests are changed because of the null/undefined attrs. This commit may be breaking from this point of view, but the v2.0.4 era allows for attrs to be null/undefined and the impact will be quite small.

* use the cached attrs as-is and skip `updateAttrs()` if the static attrs are identical

Since `compileSelector()` generates attrs objects containing only strings (no functions or nested objects). So, `updateAttrs()` can safely be skipped by checking the equality of the cached attrs objects themselves if the objects do not contain form attributes.

If you mainly use the "static" attrs and do not use dynamic attrs, skipping `updateAttrs()` allows significant performance improvements.

Also, the added checks are lightweight and there appears to be little or no performance degradation due to these checks.

This commit itself is not a breaking change in the sense that it passes all existing tests. The checks in `m.render()` above and the form attribute checks in `compileSelector()` result in a minor increase in code volume, though.

* refactor execSelector()

This state.attrs.className != null check is redundant.

* README: drop IE11 support

It seems that the current codebase (including generator, dom-for and spread syntax) already has little support for IE11 because it requires transpiling as well as polyfills.

* prevents existing tests from being changed

As this results in a slight decrease in performance improvement, comments regarding potential performance improvements have also been added.

* use a common empty attrs object

This simplifies the processing within execSelector.

* cachedAttrsIsStaticMap: use WeakMap to avoid potential memory leaks

* hyperscriptVnode: add performance sensitivity comments

* cachedAttrsIsStaticMap: revert back to Map from WeakMap with comments

* pass emptyAttrs to the Map constructor

This slightly reduces the bundle size.
@dead-claudia dead-claudia requested a review from a team as a code owner August 25, 2025 02:39
@dead-claudia dead-claudia merged commit 6c7b0b0 into release Aug 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants