364 points | 4d ago | Discuss on Hacker News | Back to Radar
The three biggest problems with JQuery UI:
1) The quality wasn't anywhere near as good as jquery, so many times I had to correct people whose opinion of jquery encompassed jquery UI
2) They declared bankruptcy on managing the call tree spaghetti and decided to rewrite the entire thing one component at a time, which meant that simultaneously some things were changing a lot and everything else they refused to entertain bug reports on the parts that were still in the queue.
3) It took them three times as long to do the work as they expected, and the original ask was already a bit much.
Angular became a thing before they finished the work.
Unrelated, but it blew my mind when I learned that Elrond is half-man.
There's a list of large legacy sites that use jquery behind that link, including:
* Microsoft.com * Pinterest.com * Adobe.com * Yahoo.com * Wordpress.org * Digicert.com * Samsung.com * Archive.org
Until people stop making sites with Wordpress, JQuery will continue to live on for a while.
$('.mispell').hide()
No error. Just silent. This is why jQuery is not a good library other than for 2010 cross-browser development.
Wouldn't you notice with your eyes the thing didn't hide as expected?
Silent errors are by design I recall. Confirming with nearest AI... yep and a good explanation, please excuse the AI paste:
A selector is treated like a query that returns a collection (which can legitimately be empty). Applying an action to zero items isn’t an error it’s just a no-op. This is similar to how CSS works (no harm if no .foo) or how many collection methods work in other languages.W3Counter shows Around 0.07% of market share.
I wonder why IE11 is still being used or even a requirement? Especially in today's world where security could be a very serious issue.
Only on Windows 10 and 11. It still runs as it always did on previous Windowses.
What vanilla is obviously unbeatable for is, you're writing a snippet of JS that you can hand anyone[1] to run with no dependency requirements. Some codebases may be explicitly incompatible with JQ, so knowing how to do all the JQ basics "vanilla" is an important skill so you don't have to bring in a "big" (relatively, I mean) library to support a 7-line function.
[1] for example, an embed code, an analytics tag, or a script to customize the markup on a page.
I do frequently, partially because I tend to branch new projects from old ones, and the old ones often used jQuery. Updating everything to vanilla would be a lot of effort for little gain.
I wonder how it feels for the original jQuery developers. They solved some big problems, then their ideas were just copied into Javascript itself, and their pioneering library became decried as old and irrelevant--even though it works just fine, and still solves some niche problems.
I'm a jquery fanboy, and enjoyed seeing native JS copy good patterns, it only confirms jquery were onto something.
All good, native JS is now better because it copied. Although $('.foo').hide() wasn't copied but should have been. Hiding stuff is an archetypal biological need!
Nothing stopping Jquery 5 and beyond doing something different like, I dunno, "game enginey" helper things, IOT tricks, it can do whatever it wants now.
That being said it's no longer that useful for dealing with browser incompatibilities or for remote calls. I end up using a stripped version or something like https://github.com/fabiospampinato/cash
FAA ground stop: initiated
Microsoft 365: down
United Airlines: down
Github actions: down
Apple: down
Nvidia CEO: owned
Clandestine NSA network: down
jQuery: 4.1.0 released :)Now that ES and CSS5 are everywhere, the biggest feature of jQuery is list comprehensions on components. Data is also still good IMO but mostly the comprehensions.
jQuery decided that calling a function on an empty list should be a no-op, but my experience using it for a very interactive application was that nearly every time we wanted something to definitely happen or it was a bug, and the handful of times where an empty list was expected were easy to anticipate.
Because the general problem was that making a selector that continued to work correctly as features were added was a black art. Two of us wrote selectors that almost always worked, the rest of the team wrote ones that almost always broke and only very slowly onboarded our advice (also all of the stuff they already wrote was a ticking time bomb).
New features and especially tweaking the DOM tree to stay compatible with old corporate browsers would break existing functionality about a quarter of the time someone had to change the DOM structure to close a ticket and it was infuriating.
So what I want is that if .hide() is a no-op, throw an exception. And if I'm implementing the 'select all/unselect all' feature I know that the list might be empty, I can add a flag or wrap a conditional around it so I ignore the error.
Because those functions work on a very tight chunk of DOM that changes structure much much slower than the overall document structure, and also that code is quite close to the point of change if someone does change it, so has better chances of being remembered than something in the header.
You can "just" add these methods and ban raw `find` with linting?
There's a lot of things you can do when you're a sole proprietor on a project. But other developers have opinions and they expect them to be respected as much as you expect them to respect yours.
Can you think of the last project where you got everything your way? I can't, and I have a reputation of being pretty insistent about people trying my suggestions before they say no.
jQuery made the decision to do this, not JavaScript.
That was, and still is, rare! And in a time without type checking and bundling, it was vital. Match your parentheses and quotes, and your jquery code might not find what you want, but it would (likely) not throw exceptions.
For those unfamiliar, I recommend looking at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast... and searching for the 201 instances of
: this
in that file. A remarkably fluent API. We could all be so elegant.That'd be an interesting alternative reality!
What ended up happening is that I'm writing (having it written by agents) react like everybody else.
A TC39 Stage 2 proposal adds this into the language itself with the pipeline `|>` operator. [2]
Maybe not precisely the same from a technical point of view but is it just pendantry to argue against someone referring to it as a fluent interface? Happy to learn and to be corrected if required.
To suggest the pipeline proposal must not be referred to as a "fluent interface" would seem to me to be arguing semantics, ignoring the point behind the words, or the facts that they can have implied meanings or subtle changes over time.
And obviously, this is a design pattern that fits when a suitable supertype exists or xan be easily defined.
Thus, void methods are already fit for pretty much the same interface, and everything with a return value that shouldn't be of the type of that specific god-interface, doesn't fit well into a fluent interface, e.g. count().
You can be insistent on the pattern and make count() return `this` instead of a number, but that's where the pattern becomes blurry.
When I started web dev, fluent interfaces were everywhere, and the motivations, thinking about it, seem to converge about another, different thing: lazy evaluation.
This is what jQuery has in common with ORMs, I'd guess.
The development experience isn't even the most important thing, it's providing an abstraction between executing a query (hence jQuery) and chaining selectors.
Natrowing down snapshots is completely different from chaining selectors, and this is the common aspect between an ORM and a library working on the DOM.
Where it starts to feel icky, in both cases, is, when mutations are involved.
Then you have potential for confusion around when these mutations are commited.
In other words, since jQuery collections are, well not "live", like getElementsByTagName, also not snapshots, like querySelectorAll is (snapshot regarding the reference, not what it points at, of course).
jQuery combined the best of both worlds for many everyday applications.
But mentally working through an applications with complex mutations only was fun if your colleagues were disciplined.
jQuery "soup" when using many mutations, leveraging the DOM as a snychronized shared state, and mixing in some confusing closures anf loops, was also real.
I admire jQuery, but also don't miss debugging half-working giant files. Not a library issue, you can have similar issues with any library when working on dynamic frontend state.
Circling back to the point: I'm not sure whether a fluent interface is ideal for DOM manipulation.
But in any case, jQuery was used way beyond "DOM library". It was almost synonymous with "JavaScript" at some point, and putting huge blocks of imperative domain logic nested 5 closures deep into some event callback was an issue with jQuery just as it is an issue with React right now.
Same story, different day.
Note that the language with the best support for this concept is Perl, with its $_ variable.
|> docker.listContainers() filter(x => x.name == “something”) first getNetwork getIpAddress toString ping
(ignore that some of these should be chained and some should be arguments, I haven’t read the proposal fully)
They’re doubly nice in Clojure because of the lazy evaluation. You can map a pipeline over a list and it will evaluate one at a time rather than pre-evaluating and allocating memory for the whole thing.
Which true is not per se fluent interfaces, but it reads similarly.
And "fluent" -- as the name suggests -- has a lot to do with how it reads, left-to-right with no intermediate variables.
I hope https://github.com/tc39/proposal-pipeline-operator and perhaps also https://github.com/tc39/proposal-do-expressions will put it to rest.
Jquery is only not relevant if you're living in a tech bubble that demands that "new, shiny" is the only thing that could possibly be relevant.
But still everywhere!
Software has a way of sticking around.
They have the small surface area of jQuery, but still aim for component-based reactivity and SSR-when-possible which just aligns more with the mental model and development preferences that have developed from the whole world of React/Next and similar.
I'd still recommend keeping it at a minimum though. Rather rely on tools like htmx.
If you intentionally don’t use a library or framework, humans generally eventually reproduce one, often very poorly.
AI doesn’t even try, it just slops and barfs and writes until something works
But to answer your question: Easier to read, easier to write, easier to understand.
code has to be human centric and not influencer centric. Awww, this is not so chic anymore. If you use this you are a peasant, BUT if you use this, well, you are king.
I had to use it on a legacy site recently and forgot how nice it was and it all just came back to me too. Didn’t need docs either. That’s a sign of a very well designed lib
$('#selector').html('new <strong>text</strong>').attr('foo', 'bar');
There is a ton of stuff you can do now with JS directly that JQuery had to compensate for, that's why GitHub spent the effort to move off of JQ years ago.
CSS and JS has come a long way. I will even venture out to say that UI development does not suck these days, it's even a little enjoyable. You no longer have to spend 3 hours vertically aligning text in a div and then test it in four different browsers.
$ = (q) => document.querySelector(q)
and $$ = (q) => document.querySelectorAll(q)
and you're good to gojQuery returned useful collections. DOM methods return an anemic NodeList which doesn't even implement Array interface.
$('body').childNodes.forEach(console.log)
I see a beautiful collection thereVery beautiful.
BTW, browsers didn't even add forEach to it until several years after they added document.querySelectorAll lol
Edit. https://caniuse.com/?search=nodelist
NodeList appeared in 2006(Firefox) - 2008 (Safari) - 2010 (Chrome)
forEach on it appeared in... 2016.
$ = (selector) => Array.from(document.querySelectorAll(selector))
Still not as good as the original, but somewhat usable at least :/ var $$ = q => document.querySelectorall(q).values()
Then you have access to a bunch of iterator methodshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
jQuery really changed the game by letting an average developer actually use Javascript to enhance a web page. Granted I want to go back to the days when no one used Javascript and the Internet was a giant mess of terrible 8bit graphics and anonymous friends, but thank you jQuery for everything you did. It is not your fault humans are terrible.
So often was the case that the two ran together, especially with IE6.
And while most of the use cases for jQuery have long since died out with things like classList, querySelector, etc, I do feel there's probably value in a framework that focuses on minor enhancements to a site rather than being the backbone of the whole thing. Like if you want a React or Angular or Vue equivalent, something like jQuery would be a terrible choice, but a lot of sites are static ones where the only scripting needed would be for minor things like dropdown menus or slideshows, and I can see a modern, lean library like this being a decent choice there.
Probably more than use React, by total domains alone. It's a bit like WordPress; so ubiquitous you forget it's even there, and with a long tail that will outlive many people reading this.
[edit] I just checked, and I still have one major production site whose backend calls still run:
`let req:XMLHttpRequest = new XMLHttpRequest(); req.onreadystatechange = ()=> {`
Approximately 64% of all websites—or roughly 67 million live domains—currently use jQuery.
When most code is and will be written by AI, why would I sacrifice performance for syntactic sugar?
We just had a T1 line blow up the entire US air control infrastructure, so I'll happily assume people are still using old garbage in critical workflows.
1: https://blog.jquery.com/2026/11/17/jquery-4-1-0-and-3-8-0-re...
First, modern vanilla JS APIs have been available for more than ten years. A browser without them is absolutely ancient.
And for the browsers that are truly that old, you can use nearly-weightless polyfills instead of jQuery.
hot take: we should not be supporting them.
(i get that this is a hard sell if you use your website to make money)
Another fun bit was when one of the employee ATMs glitched out and we say a nice shiny windows 98 desktop staring back at us.
Should we support those older browsers? Probably not, as a whole. Does someone still have to? Almost certainly.
My only data point was my Blog felt significantly snappier on my 5 year old phone - especially on bad 4G connections - when i simply ditched jQuery and used Vanilla JS.
> The latest version of jQuery (v4.0.0) is 76.8 kB minified and 27.0 kB minified + gzipped.
Very much so. jQuery had 2 major selling points - (1) browser polyfills and (2) conciseness, as per their slogan, "Write less, do more". It seems (2) has been largely forgotten since (1) has been rendered obsolete. Its idea of running functions on a collection often made scripts end up at one-third to one-half of the equivalent vanilla JS, which needs loops to do the same thing.
You'd probably usually chain that inside the callback. Instead of addClass('foo').hide(), you'd do el.classList.add('foo'); el.hidden = true; or something. It's not 1:1, but also it's not really that big a deal.
Still pretty handy syntax sugar to have around in userscripts though.
It's sort of the same sort of less-is-more mindset of jQuery but for the modern reactive-component model - intentionally small, allows SSR swapping when possible (like HTMX), and adds the layers of reactivity that can still only be reasonably done with frontend scripting.
You just don't need this. No jquery, no react, no tailwind, no fowntawesome, no external libs, no malware attack vectors, no waiting for a new update that never comes. It is all poison, just don't drink it and you'll be fine
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!
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.
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");
} const response = await fetch("/stream");
for await (const value of response.body) {
console.log("Received", value.length, "bytes");
}
console.log("Finished")Did not know this library is still being maintained
One thing I still regularly use jQuery for, though, that's rarely mentioned, is its event model. You can put a listener on any object, not just things in the DOM. Any data object can trigger an event. This is incredibly powerful for isolating logic from DOM elements and events. A frequent use case is for DOM elements to contain a reference to a data object that may be replicated elsewhere on the page. The data object sets up and tears down visual elements, listening for interaction, then dispatches a custom event. Your core logic listens for events on the data object instead of on every individual element that might refer to it. I usually delegate the draw routine for e.g. html snippets of a card or an interactive element to the data object itself in a draw() function that returns a string which incidentally jQuery handles quite nicely inserting into the DOM without needing to explicitly call createElement.
I wrote my own implementation of this a long time ago, but in the end, that feature plus the other ergonomics of jQuery still make it my go-to today over vanilla js. And pretty much everything I write is without any reactive framework (other than my own vanilla component/templating/remoting system), so the overhead is barely noticeable.
Not just as a framework but its documentation is also probably an inspiration for later libs. It was the first site for me where you could see the code and result together on the same page at the same place. And the discoverability of widgets was also great and exciting in a way.
Just open the firebug console, and try the examples for selectors, callbacks etc.
* brief snapshots on what’s interesting, valuable and good about some random thing
thx for sharing and taking the time to write it noduerme
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
But by this, I don't wanna say you should. It's also of course newer than what jQuery did, and might be inspired by it (just like Sizzle influenced the QuerySelector API, and CoffeeScript influenced arrow functions).
Comments are loaded live from Hacker News and are not stored by Mid or Real.