Live data from Hacker News

jQuery v4.0 Beta

blog.jquery.com

91–100 of 404 posts

Re: jQuery v4.0 Beta

#91

I remember jQuery from it's heyday when we used it as a replacement for Mootools. Since many people are going from React to HTMX, maybe we've made a full circle and we'll see web using just plain jQuery as well?

I came up in a similar era, I don’t think back fondly on those messes. Doing a modern app with accessibility, mobile support, real time updates, visualizations, and maybe a few PWA features with just jQuery sounds incredibly unpleasant.

I’m waiting for the HTMX hype train to meet reality too. Programming your app in pseudo attributes with a DSL is going to wear thin quickly.

Re: jQuery v4.0 Beta

#92

Earlier quoted context omitted.

> I find $.ajax() much more simple than promise, await, async of native JS. $.ajax() returns a promise. If you're calling .done() / .error() on it to handle the results -- well, that's exactly how you work with promises.

you think it's the same, but it's not even close to me .ajax({ success:function(result), error:function(xhr), } vs fetch().then((e)=>function()) is even close to being the same, then we're just not even talking the same language

You would just do:

const response = await fetch(...)

Bam, now you have the response without needing callbacks.

Re: jQuery v4.0 Beta

#93

Earlier quoted context omitted.

Second to that: jQuery is awesome. Or more specifically: the idea that websites can be built with vanilla HTML, CSS, and _optional_ JS. jQuery embraces progressive enhancement and separation of concerns pattern, which is quite the opposite of how websites are built these days. Web development starts with 10+ React import statements for components, CSS, images, and whatnot. JavaScript is a must, not optional.

About optional JS: you can have that with server-side rendering plus a modern framework (like next.js or leptos). That's certainly not as simple as vanilla html and js, but totally doable.

You sure can, but it then comes to the separation of concerns. CSS-in-JS (coupling of concerns) is the preferred option.

Re: jQuery v4.0 Beta

#94

Earlier quoted context omitted.

Also, jQuery is awesome. People have been in love with the overly complex and fancy javascript frameworks for the last 15 years or so. But jQuery doing dynamic binding to dynamically generated forms for some error states and maybe an ajax calls is literally all the javascript you need in 99% of web pages and the rest is overkill. The industry is going to move away from the complexities to React and towards more of th…

jQuery is not awesome. It was awesome 15 years ago. Now it's completely outdated. It's very hard to reason about DOM that can be manually changed by any random piece of code. That's why declarative solutions like React/Vue/Svelte are so much better.

That is not why React became popular. We have to go back to the end of the server-side ORM era. ERB templates creating an LI element in a certain manner and jQuery creating the same element. So have fun keeping those DOM elements in sync! This and the ever expanding DOM APIs led to single page applications where all of the markup was generated by the client. Cue, oh fuck this is slow and oh fuck, page loads and SEO suffers, so then we see the emergence of virtual DOMs along with server-side Javascript, and we are now generating the same DOM elements with the same code on the front and back. Then everyone realized we are making these complex applications with an untyped language with lots of warts… Flow and Typescript emerge.

Guess what? Spooky action at a distance continues with reducers, custom hooks, custom injected contexts, etc, etc.

Re: jQuery v4.0 Beta

#95
post #67

Earlier quoted context omitted.

One website that almost always gets mentioned when people talk about jQuery today is "You might not need jQuery" ( https://youmightnotneedjquery.com/ ). That site is the best ad for jQuery I've ever seen. For almost every task it describes, the jQuery code is shorter, cleaner, and more intuitive than the vanilla "modern" JS one. And that's after almost 20 years, and I don't know how many billions of dollars invested…

It's the jQuery API design. I often find myself creating functions like this one: export function $(query, root=document) { ... } jQuery acted as a role model for standard web committees. The argument for querySelector / querySelectorAll calls is literally mimicked from John Resig's groundbreaking API design.

[flagged]

Re: jQuery v4.0 Beta

#96
post #27

For those of you who are curious what drives jQuery in 2024 and beyond, you need to remember that WordPress is still more than 1/3 of the web, and the majority of installations and so many plugins critically rely on jQuery. Yes, seriously. Any advances to removing deprecated APIs or functions are great. jQuery will probably be around dominantly on the web for years to come.

They just need to add JSX support. Half the reason people use react is because of JSX.

A variant of this was tried over a decade ago, but never made it live - jQuery Templates. Not quite the same…

https://github.com/BorisMoore/jquery-tmpl

Re: jQuery v4.0 Beta

#97

For those of you who are curious what drives jQuery in 2024 and beyond, you need to remember that WordPress is still more than 1/3 of the web, and the majority of installations and so many plugins critically rely on jQuery. Yes, seriously. Any advances to removing deprecated APIs or functions are great. jQuery will probably be around dominantly on the web for years to come.

Honestly, though, given more sophisticated browser-native selectors were implemented way after jQuery was, I wonder why didn't they just make at least somewhat jQuery-compatible API. It's just way simpler.

Re: jQuery v4.0 Beta

#98
post #77

In job postings for FE developers, I usually put in this line: “A healthy disdain for jQuery” This changes nothing.

The filter works both ways.

When I see too much emotion in engineering job posts I take it as a sign that the team is more likely to be cult driven and less likely to reasonably discuss tools in terms of trade-offs.

Re: jQuery v4.0 Beta

#99
post #90

Earlier quoted context omitted.

I started with Jquery, I learned React. I prefer React. React complexity is often conflated with things like Next JS or other SPA solutions. React was originally meant to be a library for building small components that you drop into an otherwise static websites. But people usually don't talk about React unless they're talking about whole sites being in React. For that reason, I think its complexity is exaggerated. Mo…

I’m a big fan of React and jQuery but it sounds like you’re not using jQuery right. All my jQuery components were self contained and you just initialized them with $(‘[data-date-picker]’).datePicker(). It is pretty obvious to anyone looking at the code that if you remove “data-date-picker”, it stopped being a date picker.

That is true, but this is built-in to React and it's optional for JQuery. I am working on legacy projects a lot and nobody ever writes JQuery like this outside of famous libraries.

Re: jQuery v4.0 Beta

#100
post #2

In a world where many of us are actively trying to remove the last vestiges of jQuery, who is actively developing using jQuery? Genuinely curious. I’ve found that most of what I went to jQuery before is baked in now. querySelectorAll being the most powerful.

[deleted]
Post reply on HN