Live data from Hacker News

UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

unsuckjs.com

191–194 of 194 posts

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#191

This is a brilliant list, I'm a particular fan of HTMX and Alpine.js. The move back towards small dependancy free JS libs, in combination with modern JS ES Modules, is absolutely brilliant. I learnt web dev back in the late 90s by doing "view source", and was still learning about new things that way well over a decade later. If we can move back towards that, by not having a build step, it will be amazing for new devs…

I still wish 80 to 90% of those JS function on the list should be part of HTML5 and not as a JS library.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#192

Earlier quoted context omitted.

It sucks so much its unreal, forces OOP JS, which causes extreme amounts of boiler plate code and mutation bugs, making a simple change becomes a one week task. I'm just doing a complete rewrite of a legacy codebase made with TS, webcomponents and lit into a modern framework, which is about the only sane thing to do with it.

What's a mutation bug? In react, mutating a model is a bug. It's left up to the developer to remember not to do that. Outside of react, mutating a model seems like a natural fit for the way stuff actually works and it's not considered a bug.

I mean a bug where some variable gets mutated implicitly, as a side effect of some other code change.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#193

It would be handy to see the license. It's becoming increasingly more dangerous to use anything in the GPL family for anything but the narrowest of use cases. It's to the point that, even now, if it's GPL I refuse to incorporate it, even in personal projects. And I'm not against open source... Everything I write is MIT.

Good suggestion! I now show the license if it's set on the repo.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#194

Earlier quoted context omitted.

What if I want the website to work even when JavaScript is not turned on? I'd need a backend server and some frontend logic handling that case.

Not necessarily. It depends on what you need. For example suppose you were implementing an news reader with two panes. Left pane is a list of titles and previews, right pane is a full article for the selected item in the left pane. You can make the left pane a list of links to dedicated pages, and then add an htmx attribute to indicate that when the user has JavaScript to instead fetch a html snippet with just full a…

At that point, how big is the difference really between sending the right pane only as opposed to the whole page performance wise? I'm just not sure if this approach is worth it for me.
Post reply on HN