Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From https://htmx.org/:

> Why should only <a> and <form> be able to make HTTP requests?

> Why should only click & submit events trigger them?

> Why should only GET & POST be available?

> Why should you only be able to replace the entire screen?

I love their motivation points, but do you really need 11kb of gzipped js to do this? At that point it's almost like a frontend library itself (mithriljs is only 9.5kb gzipped).



You can tear out some of the stuff (sse support, web sockets) and shrink it ~2k. Do away with the events mechanism and extension points, knock down the configuration options, drop IE support and probably get it down to around 6 or 7k.

It could certainly be smaller, but to support things like CSS transitions and so forth it takes some code. I've tried to keep the power-to-weight ratio high by creating a rich events model and extensions mechanism to take pressure off the core library. My goal was to keep it under 10k, but I couldn't do it (I may pull SSE and WebSocket support out to try to tuck it under 10k again.)

On the other hand, compare it with the average image on a website, and 11k isn't bad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: