Earlier quoted context omitted.
Where are you getting those numbers from? The minified code is about 40kB before compression and about 13kB with gzip. https://bundlephobia.com/package/htmx.org@4.0.0
103KB is the actual source code. You should not be reading or debugging the minimized or gzip/transport bytes.
Htmx 4.0
241–245 of 245 posts
Re: Htmx 4.0
#242I have been reading: https://www.goodreads.com/book/show/192405005-hypermedia-sys... and still having a hard time wrapping my mind around all of this. The thing which I would really like to see is a stand-alone IDE with a straight-forward "Hello World" as an on-ramp.
Re: Htmx 4.0
#243Earlier quoted context omitted.
Not react yet, but it is approaching the early 2010 jQuery and Backbone vibes, so give it another 5 years and it will converge to React.
The htmx creator has made similar things for a long time, if anything htmx has diverged from those ideas by taking Intercooler.js and stripping out the bundled jQuery to simplify it and create htmx. See https://news.ycombinator.com/item?id=49496634
Re: Htmx 4.0
#244Earlier quoted context omitted.
No, you misunderstand what is going on. htmx is an exercising in learning web development by someone who didn’t follow 2 decades of web development progress. He is catching up though, now approaching the early 2010s jQuery (moxi) and backbonejs era with fixiproject.org
Htmx is a direct descendant of Intercooler.js, which has been around since circa 2013, more than a decade. Intercooler still exists and is used in production, and you can clearly see that it works almost exactly the same way as htmx does today, it just bundles jQuery together. The creator has been working on these ideas for a long time, but the core idea–swapping HTML from the server into the DOM–has been constant th…
Re: Htmx 4.0
#245Earlier quoted context omitted.
Because serialisation and deserialisation have a price and you almost never need what you describe
Who pays it? And I disagree, we definitely use the same API for other contexts.
- If the server is responding with JSON, the client has to parse, decode, and validate the JSON. Then it has to transform it into HTML DOM nodes. Finally, it can inject them into the DOM.
- If the server is responding with a bespoke non-JSON data structure, it's the same situation as above except even more work because a third-party, non-standard library has to decode this structure into something (most likely JSON) and then transform the JSON into HTML nodes, etc. etc.
- If the server is responding with straight-up HTML, the client uses the browser's HTML parser to directly transform it into HTML nodes and inject it into the page. And by the way, the browser engine is essentially a function that is highly optimized for exactly this use case–parsing bytes into DOM nodes.
'We' might use the same API but it's widely accepted that generally the same API doesn't work for all contexts. See https://samnewman.io/patterns/architectural/bff/#general which details the many well-known problems with having a single API for different contexts.