Live data from Hacker News

jQuery v4.0 Beta

blog.jquery.com

201–210 of 404 posts

Re: jQuery v4.0 Beta

#201
post #89
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…

This is incredible and such a great ad for jQuery. It's almost as if the creator(s) built that site ironically. So many examples are way clearer and easier in jQuery, like this one: JQUERY: $(el).toggle(); IE8+: function toggle(el) { if (el.style.display == 'none') { el.style.display = ''; } else { el.style.display = 'none'; } } Gotta love that "modern" triple attribute repetition. From: https://youmightnotneedjquery…

> Gotta love that "modern" triple attribute repetition.

You can golf it down a bit:

    el.style.display=el.style.display == 'none' ? '' : 'none';

Re: jQuery v4.0 Beta

#202

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.

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…

You still need some kind of application framework. Jquery is just a low level utility. But higher level you need to maintain architecture. Specially in spa's

Re: jQuery v4.0 Beta

#203

I remember building web apps in the days before jQuery, it was a mess. The DOM APIs were full of quirks, and all the libraries that predated jQuery had their own issues. These days, we have better options for building complex web apps, including much-improved native APIs. I don't think I've started a new project using jQuery in 10 years. But for maintainin a lightweight website that just needs a little bit of interac…

Especially the events! Those were browser-specific nightmares

Re: jQuery v4.0 Beta

#204
post #180

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…

React was developed by Facebook. I don't think they did it for small components on otherwise static sites.

Facebook was a fairly static site back then, but small is a relative term here. I don't mean to say it was only meant to do that. Just that the origins of React are a far cry from the complexity of SPA frameworks like Next JS. And it can still be used as quite a simple drop in component system. Nothing is stopping you from doing that. Which is why people often say React is not a framework but a library, because it's true.

https://legacy.reactjs.org/blog/2013/06/05/why-react.html

Re: jQuery v4.0 Beta

#206

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…

You still need some kind of application framework. Jquery is just a low level utility. But higher level you need to maintain architecture. Specially in spa's

You don't "need" an application framework.

People have been building websites (even SPAs) before the 2010s and they didn't "need" these frameworks.

Given what we know today, I'll grant you that in some cases people would want to use a framework, but it's hardly a necessity unless the context provides more specific requirements.

Re: jQuery v4.0 Beta

#207

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.

Yesterday I wrote a custom page which dumped out a table for some investigation. I threw jquery and a tablesorter plug-in. Without JS you get the table, but with you can easily sort and filter. Took about 2 minutes to add the optional filter. The backend is bash of course.

For tables my favorite jQuery plug-in is: https://datatables.net/

Have a page with some tables? A few lines of jQuery and you have search sorting etc. It can be customized but defaults are fine.

This is how abstractions and progressive enhancement should be done.

Re: jQuery v4.0 Beta

#208
post #154

Earlier quoted context omitted.

The async/await design is absolute garbage and no one will ever convince me otherwise. `fetch` is a particularly egregious example: it has all kinds of insane random quirks that you need to memorize. For example, how do I handle an error there? What's the obvious way to handle it? Is response null or something? Well, not exactly, you need to check for: response.ok; // false response.status; // 404 Um, okay, I get it.…

There are many popular wrappers like axios that fix some of these things.

The fact that these kinds of wrappers exist instead of the most popular wrappers eventually ending up standardized in JS directly is mind-boggling.

Re: jQuery v4.0 Beta

#209

Earlier quoted context omitted.

Maybe unpopular opinion but JSX is inferior to something like the Vue templating system. I much prefer to have HTML with some JS sprinkled in than JS that looks like HTML but isn’t.

Most of us devs had "separation of concerns is critical" drilled into us for many, many years. For that reason alone, JSX just gives me the baddest of smells when I look at it.

How does jsx not have separation of concerns? I get what you are referring to but that's not SoC as I know it

Re: jQuery v4.0 Beta

#210

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.

1/3 of the web does not mean much. Are you referring to web usage or just the number of web pages?
Post reply on HN