Live data from Hacker News

UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

unsuckjs.com

101–110 of 194 posts

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#101

Earlier quoted context omitted.

What changed to make GPL more "dangerous" - and to whom? I was under the impression that nearly every Linux distro uses GPL code in the kernel and/or userland.

https://www.gnu.org/licenses/gpl-faq.en.html#SystemLibraryEx... The GPL carves out exceptions for the use of system libraries. But, as for the "dangerous" part: * I work in an industry in which software patents are required to survive. Personally, I hate software patents, but it is a reality until the law changes. As such, the GPL invalidates patents, making anything GPL completely off limits. That means that I would…

IIRC, it's not about private use but about distribution. We publish libraries under MIT, since other corporate users would very likely need to distribute those.

But the higher-level Apps we publish under GPL, so that downstream is obligated to keep it open-source (but there is no obligation to submit a PR upstream).

And there are more than a few companies that use our GPL stuff, internally and don't redistrubute and therefore don't have to make their internal modifications available under GPL -- because there is no distribution happening.

I'm not a lawyer but our decision was informed by one who has prior experience in IP, licensing and specifically FOSS-style licenses.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#102

There should be another row that which of these can be included as a standalone javascript lib in html instead of requiring NPM.

Which means any content would be rendered after page load, worsening performance compared to frameworks like Next.

No it doesn't, for some of these at least you can render the page server side and the reactive components become reactive a bit later on, isn't that how next would work as well? It's a blend of server side and front end interactivity right?

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#103

Earlier quoted context omitted.

The king of "use JS frameworks, output pure HTML" is Astro. ( https://astro.build/ ) It's basically an SSG where you can use a number of frameworks to write your components, and shipping any JS is explicitly opt-in.

Astro is pretty nice too, I was going to write my blog with it but I liked the instant page transitions that NextJS provides out of the box for which I couldn't find a suitable solution in Astro.

Astro is adding (optional) client-side routing. I’m excited about that.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#104

Earlier quoted context omitted.

The king of "use JS frameworks, output pure HTML" is Astro. ( https://astro.build/ ) It's basically an SSG where you can use a number of frameworks to write your components, and shipping any JS is explicitly opt-in.

Astro is pretty nice too, I was going to write my blog with it but I liked the instant page transitions that NextJS provides out of the box for which I couldn't find a suitable solution in Astro.

Doesn’t NextJS do that with client-side JS though?

I recently moved from Gatsby, which did that — and the transitions sure are instantaneous — to Astro, which outputs plain HTML pages. Each navigation is a request to the server. Yeah, they take a touch longer. But the response is tiny.

You could always `preload`?

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#105
post #97

Earlier quoted context omitted.

> 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 starting out and learning new things. Same here, and I couldn't agree more. Had minified library soup with dynamic page content been the norm back then it would've been much harder to get…

Irony is that javascript handlers on elements were frowned upon in 90s/00s because of separate of concerns that HTML should be HTML and JS should attach it's events in a separate file. Now all of these libraries have an onclick that mirrors those original JS event handlers in the same html with no separation!

Only thing missing is inlining your css styles on each element, only a mad man would try that though... [cough]... https://github.com/samwillis/x-style

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#106

Earlier quoted context omitted.

Which means any content would be rendered after page load, worsening performance compared to frameworks like Next.

No it doesn't, for some of these at least you can render the page server side and the reactive components become reactive a bit later on, isn't that how next would work as well? It's a blend of server side and front end interactivity right?

You can’t render server side if you only use the library in a client-side script tag.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#107

Earlier quoted context omitted.

A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?

An installation of chrome is roughly 1,500mb. You realize that's mostly code that all needs to work right?

Yeah and an operating system has 10s of millions of lines of code. Does that mean everything else comes without a cost? Also point here is you got options for a much lighter framework, which you bluntly missed.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#108

Earlier quoted context omitted.

A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?

An installation of chrome is roughly 1,500mb. You realize that's mostly code that all needs to work right?

chrome and nextjs do not share a use case. Whereas chrome is a web browser nextjs is a framework for building web applications.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#109
post #68

do not use lit and webcomponents under any circumstances, please

Why not?

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.

Re: UnsuckJS: Progressively enhance HTML with lightweight JavaScript libraries

#110

I can do the same thing via NextJS and output pure HTML and CSS without any JS at all. Or with server components, output only the minimal JS needed. Not sure why everyone wants to write a programming language inside HTML like lit does.

A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?

> A fresh install of NextJS is roughly 150MB. You realise that's mostly code that all needs to work right?

Really??

Post reply on HN