You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.
0 commit comments