Conversation
83f57fd to
2795879
Compare
|
Current results in a nutshell: https://twitter.com/WebReflection/status/1723793350002725247 |
|
Awesome! Do you have plans to mirror these changes to uhtml-ssr as well as the uland part of the family? |
|
I have plans it's just that time has no plans for me ... I will eventually update the uhtml world around latest. |
|
Cool. Let me know if you are interested in any areas of contributions to make it happen. |
|
That's great !! Thanks !! uhtml is a wonderful library. |
|
Thank you! |
|
@nuxodin great question ... I feel like that's better off any stale-while-revalidate pattern but I won't forget about it in v4, not in the immediate pipe though, but needed to have |
|
thanks for clarifying 👍 |


This MR is a partial rewrite of v3 with a "back to origins" purpose and a lot of performance and RAM consumption improvements over the previous stable v3 version.
Please note that while most needed or demanding v3 features will be, eventually, ported over v4, this should be almost a drop-in replacement for v3, with the following most notable breaking changes.
Breaking Changes
uhtml(~2.5K) for default, non-keyed yet blazing fast and most common use cases,uhtml/keyed(~2.6K) for both implicit (default) and explicit keyed operations anduhtml/node(~2.2K) for one-off only use casesonclickor nativeon*handler is just directly set like any other special attribute such asvaluefor inputs or textareas, and so onclassandstyleare handled as special attributes (amongaria,dataandref) so thatclass=${value}now directly setclassNameof the element whilestyle=${value}now directly set theelement.style.cssTextbut only when the current value is different from the previous onehtml.for(...)andhtml.nodeutilities have been moved:uhtml/keyedexport provides anhtmlForand ansvgFordirect callback to create related tags. The full export there is{Hole, render, html, svg, htmlFor, svgFor, attr}and these are all typeduhtml/nodeexport provides a one-off only implementation of the logic, without ever caching details around nodes and without logic around updates ... this export is literally for one-off operations and nothing else, but as escape hatch, creating one-off content can always be done with theuhtml/keyedexport and eitherhtmlFor({})orsvgFor({})utility, still keeping performance high and memory consumption lowstring,boolean,number, or arrays within interpolationshtmlorsvgtags even to create just static text contentreffeatureMemory Improvements
bindfor the very always same callback, helping engines further to optimize for its operations. All other updates use always the exact same callback reference just passing a bit more details than before and the resulting value would update the retained one when that's different from the previous oneAbout TypeScript
This module now generates automatically all definitions in the most accurate way and it describes types also internally, hoping to welcome more TS contributors when it comes to bugs or improvements.