Live data from Hacker News

React is the new jQuery

bradfrost.com

161–170 of 206 posts

Re: React is the new jQuery

#161
post #154

Earlier quoted context omitted.

I don't presume to be an expert on history (only entered the webdev domain in 2010), but didn't prototype come out at least a couple of years after jQuery?

Prototype was released like a year before jQuery.

Absolutely my bad there. Thanks for the info! jQuery's popularity must have been phenomenal, because I hadn't heard of Prototype until maybe 2011.

Re: React is the new jQuery

#162

Earlier quoted context omitted.

> A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. That's fair. > The other comparative downside of JQuery was that components started to rely on it as a shared library, which meant developers suddenly needed to do dependency management. That is (usually) a bad idea. React absolutely do…

> Who is going to want to use a dropdown component that has the entire React 15.3 lib bundled into it? And who would want a dropdown component that has its own little rendering framework inside when you are using React for that?

Maybe not for a dropdown component, but I built a calendar component that stood alone using preact and redux, and the final size was still smaller than most calendar components of similar complexity.

Re: React is the new jQuery

#163

Earlier quoted context omitted.

>cant even name a similar piece of software in web development history that is as important as jQuery. Php?

Nah, there were always tons of alternatives to PHP. What real alternatives were there to jQuery? There were none.

Mootools had a fighting chance.

Re: React is the new jQuery

#164

Earlier quoted context omitted.

I don't think JQuery ever got bad. It just got unnecessary, like you said. But it took a lot of work to convince people that it was unnecessary. A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. The other comparative downside of JQuery was that components started to rely on it as a share…

Being used to jQuery, I really see no reason not to use it in new projects. I could learn all the new native equivalents, and even then still ending up doing more work than if I'd been using jQuery, just to save a little bit of page load time and filesize, but it would almost certainly not be worth it.

Take a look at zepto (or another jquery-like library), add some feature detection for IE polyfills, and switch to using fetch for ajax calls. Unless you're using a lot of jQuery dependencies, you'll cut your download size by more than half for most browsers/users.

I'd never say don't use jQuery, and it does support some options for a minimal footprint, still there's smaller options that probably have all you need.

Re: React is the new jQuery

#165

> React is the new jQuery Anyone who uses "the new jQuery" as some sort of insult (as it seems Sara did in her tweet) probably hasn't been a developer for more than a few years or is just trying to sound smarter than they are by bashing an easy target. The reason jQuery got so popular is that it made common tasks so much easier than anything else at the time. Anyone who was doing web development before jQuery knows w…

jQuery was never bad. As a tool it was fantastic at what it did. But jQuery wasn’t just a tool, it was also community. What that community did/perpetuated was some pretty bad and ill advised practices. Plugins for everything - the old $.sum(2,2) joke applies here. DOM for state. Even sanctioned projects like jQuery UI were guilty of some terrible, awful practices. That said, React isn’t the new jQuery, it’s the new B…

I think a lot of that does happen with React. Before Redux there were so many Flux-like libraries. material-ui and react-bootstrap are very widely used for UI/UX baseline. There are a ton of options for everything, for me it comes down to the following.

react, redux, thunks (with async functions), fetch, material-ui ... those will get you a LONG way to where you need to be with react.

Re: React is the new jQuery

#166
post #86

When I see this: var formname = $(this).find('.formname'); formname.empty(); formname.append(n_input); I think why not just use plain Javascript and do this: document.querySelector('.formname').innerHTML=n_input; Coders that are attached to libraries and frameworks always seem so afraid to use the tech already available. That they don't even look at how the basic solution would look like.

Apples to apples -

    $(".formname").html(n_input);
The jQuery solution is shorter, and it works in browsers without querySelector (old IE) and without innerHTML (which is missing/readonly for some element types in old IE).

Re: React is the new jQuery

#167
post #127
post #86

When I see this: var formname = $(this).find('.formname'); formname.empty(); formname.append(n_input); I think why not just use plain Javascript and do this: document.querySelector('.formname').innerHTML=n_input; Coders that are attached to libraries and frameworks always seem so afraid to use the tech already available. That they don't even look at how the basic solution would look like.

Sorry for being terribly pedantic, but the "vanilla" version just does not do what the jQuery code does: - `this` might not be document - find might return multiple elements, not just one - if nothing matches, jQuery does not throw unlike the vanilla version I do understand it's just an example, but if you'd consider all the implicit cases the jQuery example covers, you'd end up with a lot more than a single line. I…

assuming "this" is an element... `this.querySelector` if you're intending to match multiples...

    Array.from(document.querySelectorAll(...)).forEach(x => {...})
It's not *that hard... though forEach should be on your dom collection returned, if Array.from exists, but I started shimming Array.from long before either were standard.

Re: React is the new jQuery

#168

Moved from Vue to React. A couple things drove this: Typescript support for Vue was kind of weak, and the interception of events and reactive elements ended up creating more bugs. I do love how Vue is easy to get up and going fast, but React seems more compatible with a growing team where you want stronger guarantees.

First time I read someone moving from Vue to React. I thought trend was only from React/Angular to Vue?

Vue works better for small apps, or progressive enhancement (similar to jQuery)

React works better for teams working on applications that need build tooling and dependency management anyway.

Angular, frankly I don't see why anyone would pick it over the other two. Yeah, it's got more in the box, but that bigger box takes 4x as much effort to lift off the ground.

Re: React is the new jQuery

#169

I really like the linked Vue/Jquery article in the story as well. I've built some stuff in Vue and I really like it. It can be incredibly simple. I'm not a huge fan of React. I'm really not a fan of any site that requires Javascript to view. If it's a new article and I get a blank page, I immediately stick it in archive.is. I'm not turning on Javascript for your site just to view content. Fuck that. Fix your site to…

React can definitely use Server-side rendering... but it's often used for pre-render caching, and even doughnut caching to bootstrap the full application on the client, so you see content sooner. But, it's entirely possible to pre-render and degrade gracefully.

Is it worth the effort for a fraction of a percent of technical users whining about the need for JS? probably not.

Post reply on HN