3 ms·
> You need to do click to edit, lazy loading, infinite scroll, a live search, or anything else that you’d normally be reaching for JavaScript to accomplish, you
by niutech 3y ago
> You need to do click to edit, lazy loading, infinite scroll, a live search, or anything else that you’d normally be reaching for JavaScript to accomplish, you can now add HTMX to the stack, write a few more attributes on your HTML, get what you need done, and never have to use JavaScript.
And what is HTMX? A 44KB-minified JavaScript library! So this statement is false. If you really want to be lightweight, use pure CSS frameworks like Picnic (https://picnicss.com https://picnicss.com) or Spectre (https://github.com/niutech/spectre https://github.com/niutech/spectre) and pure HTML out-of-order streaming (https://github.com/niutech/phooos https://github.com/niutech/phooos). If you really want a sparkle of JS, use 166b (bytes, not kilobytes!) HTMZ (https://leanrada.com/htmz/ https://leanrada.com/htmz/).
- recursivedoubts 3y ago15.2k min/gz'd, 17ms over old 4g and cached forever: https://bundlephobia.com/package/htmx.org@1.9.11 https://bundlephobia.com/package/htmx.org@1.9.11
- niutech 3y agoTransfer size is one thing, but the JS code has to be parsed and executed on every web page load. Moreover, it is often loaded as a blocking <script> in <head>. My point is CSS and no JS is better than JS.
- recursivedoubts 3y agohtmx loads in partials and processes them, you don't pay the price of loading it over and over again
- niutech 3y agoIf you don't use JS at all, you don't pay the price too and it's faster since there is no JS to parse and execute - see e.g. https://github.com/niutech/phooos https://github.com/niutech/phooos