News for hackers. Stuff that matters.
Re:jQuery 4.1.0 by dday9 on Tuesday November 17, 2026 @06:02PM (#50539479)
jQuery was a godsend during the 2000s, those were some nasty times for cross-browser capability. Man, do you remember the old way to make asynchronous requests before you could just use the $.ajax method?!

That's why I'm surprised to see still being maintained... ever since Chromium basically won the browser wars and pretty much everything's standardized now, it almost feels like it's lived out its usefulness.

I also want to say I remember it being a bit bloated too. I did work for a client who had several users live in very remote areas where every bit of bandwidth was precious, and I wanted to say that one of the issues was with jQuery. For some reason the "slim" version didn't work for the use case either. This is going off of memory and was probably 15 years ago, so I could be entirely wrong.

There's no denying it's prevalence though. Heck, datatables.net only recently phased out the jQuery dependency in April... of this year!

[dead]
Re:jQuery 4.1.0 by dday9 on Wednesday November 18, 2026 @09:52AM (#50547020)
I think you misunderstood or read past what I was saying.

I wasn't talking about version 4.1, this would have been version 1.x (maybe 1.5... it was ~15 years ago), and the issue was bandwidth usage for uber remote users. There were all sorts of tricks I remember implementing to get that project over the finish line, but one of them was definitely yoinking jQuery out of the project, despite me being a big advocate for the library.

Re:jQuery 4.1.0 by dwoldrich on Tuesday November 17, 2026 @07:15PM (#50540160)
Those original AJAX API's were pretty slick, but not well understood at the time. Surprisingly they could stream characters! The response is partially available each time onprogress fires:

  const xhr = new XMLHttpRequest();
  let lastLength = 0;

  xhr.addEventListener("progress", () => {
    const chunk = xhr.responseText.substring(lastLength);
    
    lastLength = xhr.responseText.length;

    console.log("New data:", chunk);
  });

  xhr.open("GET", "/stream");
  xhr.send();
-------------------

The modern fetch API is better though because it's a Promises API and it can stream as raw bytes, not characters:

  const response = await fetch("/stream");
  const reader = response.body.getReader();

  while (true) {
    const { value, done } = await reader.read(); 

    if (done) {    
        console.log("Finished");
        break;
    }

    console.log("Received", value.length, "bytes");
  }
Re:jQuery 4.1.0 by bastawhiz on Tuesday November 17, 2026 @07:52PM (#50540444)
It's actually a little easier these days:

  const response = await fetch("/stream");
  for await (const value of response.body) {
    console.log("Received", value.length, "bytes");
  }
  console.log("Finished")