| ▲ | jQuery 4(blog.jquery.com) |
| 322 points by OuterVale 7 hours ago | 102 comments |
| |
|
| ▲ | blakewatson 5 hours ago | parent | next [-] |
| Related: This is a nice write-up of how to write reactive jQuery. It's presented as an alternative to jQuery spaghetti code, in the context of being in a legacy codebase where you might not have access to newer frameworks. https://css-tricks.com/reactive-jquery-for-spaghetti-fied-le... |
| |
| ▲ | Klaster_1 5 hours ago | parent | next [-] | | I used this approach before and it indeed works better than the 2010-style jQuery mess. A good fit for userscripts too, where the problem you attempt to solve is fairly limited and having dependencies, especially with a build steps, is a pain. Note that you don't need jQuery for this at all, unless you are somehow stuck with ancient browser support as a requirement - querySelector, addEventListener, innerHtml - the basic building blocks of the approach - have been available and stable for a long time. | | |
| ▲ | doix 5 hours ago | parent [-] | | Unfortunately, nowadays writing userscripts is much harder than it used to be. Most websites are using some sort of reactive FE framework so you need to make extensive use of mutationObservers (or whatever the equivalent is in jQuery I guess). | | |
| ▲ | hebelehubele an hour ago | parent | next [-] | | I often go for `setInterval` over `MutationObserver` because it works and I don't need instant reactivity and I don't have to think too much about it. | |
| ▲ | egeozcan an hour ago | parent | prev | next [-] | | It's easier to write with LLMs. One-off projects (the way I treat userscripts) is where they really shine. Oh the horrible things I do with Instagram... | |
| ▲ | Klaster_1 3 hours ago | parent | prev [-] | | Very true. I guess that depends on what websites you find issues with? I just checked mine and all of those are quality of life improvements for fully server rendered sites like HN or phpBB forums. | | |
| ▲ | doix 3 hours ago | parent [-] | | Yeah, I mostly use it for QoL improvements but for work related things. So Jira, Bitbucket, GitHub, Linear etc. basically whatever my employer uses. Back in the early 2010s most of that software was fully server rendered. Nowadays it's pretty rare for that to be the case. I just try and get LLMs to do it for me because I'm lazy, and they like to use setInterval instead of mutationObservers and if it works, I just live with the inefficiency. | | |
| ▲ | mschuster91 43 minutes ago | parent [-] | | The Atlassian stack is particularly bad to extend IMHO given that there are sooooo many API endpoints that their UI calls and most of them are dog slow. |
|
|
|
| |
| ▲ | lioeters 2 hours ago | parent | prev [-] | | This brought me flashbacks of jQuery spaghetti monsters from years ago, some were Backbone related. In retrospect, over-engineered React code can be worse than decently organized jQuery code, but some jQuery mess was worse than any React code. So I guess I'm saying, React did raise the bar and standard of quality - but it can get to be too much, sometimes a judicious use of old familiar tool gets the job done. |
|
|
| ▲ | flomo 3 hours ago | parent | prev | next [-] |
| Whenever HTMX comes up here, I always think "isn't that just some gobbledy-gook which replaces about 3 lines of imperative jquery?" Anyway, jQuery always did the job, use it forever if it solves your problems. |
| |
| ▲ | sgt an hour ago | parent | next [-] | | I pretty much use HTMX and vanilla JS to solve most problems, when I use Django at least. Keeps things simple and gives that SPA feel to the app too. | |
| ▲ | gbalduzzi 3 hours ago | parent | prev | next [-] | | The problem with jQuery is that, being imperative, it quickly becomes complex when you need to handle more than one thing because you need to cover imperatively all cases. | | |
| ▲ | flomo 2 hours ago | parent [-] | | Yeah, that's the other HN koan about "You probably don't need React if..." But if you are using jquery/vanilla to shove state into your HTML, you probably actually do need something like react. |
| |
| ▲ | hsbauauvhabzb 2 hours ago | parent | prev [-] | | These days I’ve moved to native JS, but hot damn the $() selector interface was elegant and minimal vs document.getElement[s]by[attribute)]. While presumably jquery is slower than native selectors, maybe that could be pre-computed away. | | |
|
|
| ▲ | karim79 6 hours ago | parent | prev | next [-] |
| Still one of my favourite libs on the whole planet. I will always love jQuery. It is responsible for my career in (real) companies. Live on jQuery! Go forth and multiply! |
|
| ▲ | b3ing 6 hours ago | parent | prev | next [-] |
| Nice to see it still around and updated. The sad part is I guess this means React will be around in 2060. |
| |
| ▲ | altern8 2 hours ago | parent | next [-] | | What's wrong with React? It made it so much better to build apps vs. spaghetti jQuery. I still have nightmares about jeeping track of jQuery callbacks | | |
| ▲ | lopatin 44 minutes ago | parent [-] | | The problem with React is that it solved frontend. So the options are to 1. Code React all day and be happy with it. 2. Come up with reasons why it's bad. There are many talented and intellectually curious people in the field which lean towards 2. | | |
| ▲ | gmac 30 minutes ago | parent [-] | | The problem with React IMHO is it’s so dominant and so annoyingly over-engineered for many problems. I use Mithril and find it much less fuss. |
|
| |
| ▲ | mikeaskew4 5 hours ago | parent | prev | next [-] | | by 2060 React Native should be up to v0.93 | |
| ▲ | b65e8bee43c2ed0 6 hours ago | parent | prev [-] | | there are already de facto two Reacts. by 2060, there will be five. | | |
| ▲ | 2muchcoffeeman 5 hours ago | parent [-] | | Two Reacts!? | | |
| ▲ | o_m 33 minutes ago | parent | next [-] | | The main divide now is client side React versus Server Components usually with a node.js backend | |
| ▲ | exac 5 hours ago | parent | prev | next [-] | | As someone who doesn't use React, there is React Native (for iOS & Android), and React (and that can be server-rendered or client-rendered). | | | |
| ▲ | tcoff91 5 hours ago | parent | prev [-] | | class components & function components. | | |
| ▲ | afiori 3 hours ago | parent [-] | | That is the least interesting divide in the react community |
|
|
|
|
|
| ▲ | rationably 6 hours ago | parent | prev | next [-] |
| Unbelievably, still supports IE 11 which is scheduled to be deprecated in jQuery 5.0 |
| |
| ▲ | indolering 2 hours ago | parent | next [-] | | It looks like it was done to not delay the 4.0 release. Since they follow semvar, that means it won't get the axe until 5.0 [1]. Pretty wild considering that 3.0 was released 10 years ago. But maybe they will scope this one better: they were talking about getting 4.0 released in 2020 back in 2019! [1]: https://github.com/jquery/jquery/pull/5077
[2]: https://github.com/jquery/jquery/issues/4299 | |
| ▲ | tartoran 6 hours ago | parent | prev | next [-] | | Backwards compatibility. Apparently there are still some people stuck on IE11. It's nice that jQuery still supports those users and the products that they are still running. | | |
| ▲ | kstrauser 3 hours ago | parent | next [-] | | This is the part that I find the strangest: > We also dropped support for other very old browsers, including Edge Legacy, iOS versions earlier than the last 3, Firefox versions earlier than the last 2 (aside from Firefox ESR), and Android Browser. Safari from iOS 16, released in 2022, is more modern in every conceivable way than MSIE 11. I'd also bet there are more people stuck with iOS 16- than those who can only use IE 11, except maybe at companies with horrid IT departments, in which case I kind of see this as enabling them to continue to suck. I'd vote to rip the bandaid off. MSIE is dead tech, deader than some of the other browsers they're deprecating. Let it fade into ignomony as soon as possible. | | |
| ▲ | sebazzz 2 hours ago | parent | next [-] | | “Support” here probably means “we’re testing jQuery for compatibility on those web browsers” - likely Safari from iOS 16 still runs this version of jQuery just fine. However, running automated test suites or support bugfixing for those clients is a lot harder than spinning up some Microsoft-provided VM with IE11 on it. | | | |
| ▲ | croes 37 minutes ago | parent | prev | next [-] | | It’s rarely a horrid IT department but some special or legacy software without modern replacement | |
| ▲ | troupo 2 hours ago | parent | prev [-] | | > Safari from iOS 16, released in 2022, is more modern in every conceivable way than MSIE 11. There are likely millions if not tens of millions of computers still running MSIE11. There are likely to be no devices running iOS 16 | | |
| ▲ | kstrauser 2 hours ago | parent | next [-] | | According to Cloudflare, there are almost no users still on MSIE of any version.[0] Statcounter says there are about 4.6% of iOS users still on iOS 16.[1] My gut instinct is that there are multiple times more people using iOS 16 today than MSIE of any version. [0] https://radar.cloudflare.com/reports/browser-market-share-20... [1] https://gs.statcounter.com/os-version-market-share/ios/mobil... | | |
| ▲ | pmontra 2 minutes ago | parent | next [-] | | I visited a distillery in 2020. Their machines were managed by HP laptops running Windows XP. Those machines and those laptops and that Windows XP are probably still there with their old IE browser. | |
| ▲ | troupo an hour ago | parent | prev [-] | | IIRC public counters tend to miss corporate networks. |
| |
| ▲ | Strom an hour ago | parent | prev [-] | | > There are likely to be no devices running iOS 16 My iPhone X is stuck on iOS 16 with no way to upgrade. However, the phone is still working well. Despite being in daily use for 8 years it still has 81% battery capacity, has never been dropped, has a great OLED screen, can record 4K@60 video. It is far more responsive than a brand new 2025 $200 Android phone from e.g. Xiaomi. It still gets security patches from Apple. The only real shortcoming compared to a modern iPhone is the low light camera performance. That and some app developers don't support iOS 16 anymore, so e.g. I can't use the ChatGPT app and have to use it via the browser, but the Gemini app works fine. |
|
| |
| ▲ | phinnaeus 6 hours ago | parent | prev | next [-] | | Are those people/products upgrading jQuery though? | |
| ▲ | jbullock35 6 hours ago | parent | prev [-] | | Who is still stuck on IE 11---and why? | | |
| ▲ | flomo 3 hours ago | parent | next [-] | | There are some really retrograde government and bigcorps, running ten year old infrastructure. And if that is your customer-base? You do it. Plus I worked on a consumer launch site for something you might remember, and we got the late requirement for IE7 support, because that's what the executives in Japan had. No customers cared, but yeah it worked in IE7. | | | |
| ▲ | ejmatta 6 hours ago | parent | prev | next [-] | | Some corporate machines still run XP. Why upgrade what works? | | | |
| ▲ | ddtaylor 6 hours ago | parent | prev | next [-] | | I think anything still using ActiveX like stuff or "native" things. Sure, it should all be dead and gone, but some might not be and there is no path forward with any of that AFAIK. | |
| ▲ | simondotau 2 hours ago | parent | prev [-] | | Surely by this point someone has written a 0-day for MSIE 11 which gets root and silently installs an Internet Explorer skinned Chromium. If not, someone should get onto that. —Signed, everyone |
|
| |
| ▲ | ulrischa 4 hours ago | parent | prev [-] | | Not everybody in the world can use modern hard- and software.
There are tons of school computer labs running old software | | |
| ▲ | halapro 4 hours ago | parent [-] | | Yes, run jQuery 3. Crazy to think that software running inside IE11 should use the latest version of a library. |
|
|
|
| ▲ | chao- 4 hours ago | parent | prev | next [-] |
| I cannot express how much I admire the amount of effort jQuery puts into their upgrade tools. |
|
| ▲ | hypnot 2 hours ago | parent | prev | next [-] |
| It's amazing how much jQuery is still used today. Even on modern websites you can often find it included (browser devtools -> jQuery in the console, and see). And not just on hobbyist sites, but on serious company websites and their web tools as well. |
| |
| ▲ | KellyCriterion 2 hours ago | parent [-] | | Curious: Whats the current behemoth instead of JQ? I perceive it as still being the de-facto standard? | | |
|
|
| ▲ | gethly 3 hours ago | parent | prev | next [-] |
| jQuery was peak JavaScript. Good times, I'm glad it is still around. |
| |
| ▲ | shevy-java 3 hours ago | parent [-] | | It is still used by many websites. | | |
| ▲ | marticode 3 hours ago | parent [-] | | Indeed. Though a lot of its feature found their way into plain vanilla Javascript and browsers, the syntax is still so much easier with jQuery. |
|
|
|
| ▲ | lrvick 2 hours ago | parent | prev | next [-] |
| Everything I ever used jquery for 15 years ago, I found myself able to do with the CSS and the JS standard library maybe 10 years ago. I honestly am confused when I see jquery used today for anything. Is there still anything jquery does you cannot easily do with a couple lines of stdlib? |
| |
| ▲ | simondotau 2 hours ago | parent | next [-] | | The terse and chainable jQuery syntax is more readable, easier to remember, and thus more pleasant to maintain. Rewriting for stdlib is easy, but bloats out the code by forcing you to pepper in redundant boilerplate on nearly every line. | |
| ▲ | jampekka 2 hours ago | parent | prev [-] | | Jquery does many things in one line that requires a couple lines of stdlib. Writing less code is what libraries are for. | | |
| ▲ | glemion43 2 hours ago | parent [-] | | Until you have to upgrade it and it bites you | | |
| ▲ | jampekka 2 hours ago | parent [-] | | jQuery's big point was to give a consistent API over inconsistent browser implementations, so it typically saves you from bites more often than it bites you. |
|
|
|
|
| ▲ | ulrischa 3 hours ago | parent | prev | next [-] |
| I still love the simplicity a ajax call can be done in Jquery |
| |
|
| ▲ | jusonchan81 5 hours ago | parent | prev | next [-] |
| The first time I truly enjoyed web development was when I got the hang of jQuery. Made everything so much simple and usable! |
| |
| ▲ | Joel_Mckay 5 hours ago | parent [-] | | jQuery made a messy ecosystem slightly less fragmented. Combined with CKEditor it effectively tamed a lot of web-developer chaos until nodejs dropped. =3 |
|
|
| ▲ | rtbruhan00 33 minutes ago | parent | prev | next [-] |
| It’s refreshing to see jQuery 4 |
|
| ▲ | indolering 4 hours ago | parent | prev | next [-] |
| I love that they support ES6 modules, Trusted Types, and CSP! The clearing out of old APIs that have platform replacements is nice to see too! |
|
| ▲ | johanyc an hour ago | parent | prev | next [-] |
| is there any reason to use jquery if you've never used it before |
|
| ▲ | maxpert 4 hours ago | parent | prev | next [-] |
| jQuery is the last time I felt a library doing magic! Nothing has matched the feelings since then. |
| |
| ▲ | Minor49er 4 hours ago | parent [-] | | Not even modern vanilla JavaScript? | | |
| ▲ | marticode 2 hours ago | parent [-] | | It's fairly close now but so much more verbose: ie document.getElementById('theID') vs $('#theID') | | |
| ▲ | majewsky 2 hours ago | parent [-] | | Nearly every time I write something in JavaScript, the first line is const $ = (selector) => document.querySelector(selector). I do not have jQuery nostalgia as much as many others here, but that particular shorthand is very useful. For extra flavor, const $$ = (selector) => document.querySelectorAll(selector) on top. |
|
|
|
|
| ▲ | shevy-java 3 hours ago | parent | prev | next [-] |
| I am still using jQuery. |
|
| ▲ | NetOpWibby 4 hours ago | parent | prev | next [-] |
| I remember being scared of jQuery and then being scared of vanilla JS. My, how time flies. Incredible it's still being maintained. |
|
| ▲ | MarkdownConvert 6 hours ago | parent | prev | next [-] |
| Long-time user here. It served me well for years, though I haven't really touched it since the 3.0 days. Glad to see it's still being maintained. |
|
| ▲ | yread 4 hours ago | parent | prev | next [-] |
| Hmm maybe i can finally move on from 2.x |
|
| ▲ | madduci 4 hours ago | parent | prev | next [-] |
| This is huge. jQuery is still my way to go for any website requiring some custom interaction that isn't available in vanilla js. |
|
| ▲ | netbioserror 6 hours ago | parent | prev | next [-] |
| I was surprised that for most of my smaller use cases, Zepto.js was a drop-in replacement that worked well. I do need to try the jQuery slim builds, I've never explored that. |
| |
| ▲ | NetOpWibby 4 hours ago | parent [-] | | Zepto! That's a name I haven't heard in years. I don't remember how it happened but I'm still a member of the ZeptoJS org on Github. | | |
| ▲ | indolering 2 hours ago | parent [-] | | I really like that project! Why don't y'all hand it over to someone willing to do maintenance or at least archive it? |
|
|
|
| ▲ | tpoacher 4 hours ago | parent | prev | next [-] |
| still needs more jQuery |
|
| ▲ | tonijn 6 hours ago | parent | prev | next [-] |
| No love for $…? |
|
| ▲ | gocsjess 5 hours ago | parent | prev | next [-] |
| jQuery is v4 now, but a lot of sites esp. wordpress still have 1.11 or 1.12 and only uses them to either doing modals(popover), show/hide(display), or ajax(fetch). |
| |
| ▲ | nchmy 4 hours ago | parent [-] | | WordPress ships with 3.x and is already looking to update to 4 |
|
|
| ▲ | thrownawaysz 38 minutes ago | parent | prev | next [-] |
| The group photo is a perfect example of why DEI is important |
| |
|
| ▲ | maxloh 6 hours ago | parent | prev [-] |
| Even after migrating to ES modules, jQuery is still somewhat bloated. It is 27 kB (minified + gzipped) [0]. In comparison, Preact is only 4.7 kB [1]. [0]: https://bundlephobia.com/package/jquery@4.0.0 [1]: https://bundlephobia.com/package/preact@10.28.2 |
| |
| ▲ | topspin 3 hours ago | parent | next [-] | | > Preact is only 4.7 kB Is there some outlier place where people using virtual DOM frameworks don't also include 100-200kb of "ecosystem" in addition to the framework? I suppose anything is possible, but I've never actually seen it. I have seen jQuery only sites. You get a lot for ~27kB. | | |
| ▲ | downsplat 2 hours ago | parent [-] | | I do that when I need to make a simple SPA. Plain Vue plus a few tiny add-ons of my own. |
| |
| ▲ | onion2k 6 hours ago | parent | prev [-] | | jQuery does a lot more though, and includes support older browsers. | | |
| ▲ | halapro 4 hours ago | parent | next [-] | | > includes support older browsers Which is entirely the issue. Supporting a browser for the 10 users who will update jQuery in 2025 is insane. | | |
| ▲ | mejutoco 3 hours ago | parent | next [-] | | Breaking backwards compatibility to turn 27kb into less because of "bloat" makes less sense to me. | |
| ▲ | shevy-java 3 hours ago | parent | prev [-] | | It is definitely more than 10 users. |
| |
| ▲ | ZeroAurora 3 hours ago | parent | prev [-] | | Officially they state they only support 2 latest versions of chrome. But considering their support of IE11, that's actually a lot. |
|
|