News for hackers. Stuff that matters.
Re:Cash: An absurdly small jQuery alternative for modern bro... by NoahKAndrews on Sunday November 03, 2024 @06:57PM (#42037155)
How big are your projects? It's very strange to me that you would want to have just a single JS file per project. Even if you want to avoid bundlers, ES modules make it easy to import code from other files.
Re:Cash: An absurdly small jQuery alternative for modern bro... by mrweasel on Monday November 04, 2024 @03:39AM (#42039675)
> How big are your projects?

In terms of Javascript, as little as I can possibly get away with. The web stuff that I do is mostly CRUD type apps, which can be done entirely server side. The Javascript is only where it make the user experience better, so basic form help or to do a modal, things like that.

Re:Cash: An absurdly small jQuery alternative for modern bro... by niutech on Friday November 15, 2024 @04:04AM (#42145129)
Importing an ES module without a bundler involves making a HTTP request, which costs time.

Better KISS and fit all of JS in a single script.

Re:Cash: An absurdly small jQuery alternative for modern bro... by mg on Friday November 15, 2024 @05:23AM (#42145551)

    which costs time
No sure this holds true anymore.

When you go to a site like reddit.com which uses HTTP/2, you see a gazillion of requests for JS files, many starting at the same time and ending at the same time.

I think that is because newer HTTP versions can put multiple requests in the same data packet. And even HTTP/3 is now supported by over 90% of browsers.