Live data from Hacker News

React is the new jQuery

bradfrost.com

201–206 of 206 posts

Re: React is the new jQuery

#201

Earlier quoted context omitted.

You also get convention. jQuery didn't offer much of that once you started gluing its functions together... I can usually jump into someone's react code and get what's going on pretty quickly unless they did something really gnarly with incredibly nested props. Even then, at least I still know where to drill down. With jQuery soup, you didn't get that luxury. Being able to have an entire team know how to build compon…

jQuery had a lot of convention, for both it and it's plugins. jQuery + co. have very consistent "look and feel"

I agree that the library has great convention. I actually learned quite a bit from that API when I was starting out. The only problem was you could really abuse the usage of the API.

I'm realizing now that this isn't a fair comparison. React 'wins' here largely because it has a smaller scope. It's for giving functionality to templates built in the library using a certain approach. jQuery was far more open ended and far less opinionated. That was as much it's strength as it's weakness.

It's definitely not a direct comparison. But I do think react is a nice safe tool for larger teams.

Re: React is the new jQuery

#202

Earlier quoted context omitted.

Do you find it difficult because it suggests you need to deal with JS modules and building? After you get your tooling setup, you can just include a node in your DOM that React will target and mutate.

I find it difficult because of understanding how to get it to fit with an existing directory layout. And maybe existing scripts in the build. But yes, setting up the tooling is overwhelming. create-react-app says in the README: "If you need to integrate React code with a server-side template framework like Rails or Django, or if you’re not building a single-page app, consider using nwb, or Neutrino which are more fle…

I might prescribe that you go to reactiflux (not associated) or other popular chat communities to get some more live help for getting your tooling up. I suspect that if tooling were resolved, so much discussion of churn would disappear overnight.

Re: React is the new jQuery

#203
post #161

Earlier quoted context omitted.

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.

I think Rails used to include it as a default.

Re: React is the new jQuery

#204

Earlier quoted context omitted.

I agree you can do that but I feel like frameworks are more about teamwork. I can't imagine having a team of 10 with varying levels of JS experience/passion and telling them all to "just write nice simple vanilla JS that we can all agree is clean and simple" and expect that to happen.

I don't have a ton of experience leading team's using react, angular etc but I assume you are referring to the fact that there are multiple ways of doing things in vanilla js world whereas only one way in react world. That can make things easier for teams but I believe that's a lazy excuse. Choice is never a bad thing and it's literally the job of a tech lead to establish conventions, tell devs what flow to follow. I…

Have strict team conventions and being afforded the time to try an enforce them is great. Agreed. It doesn't always end up working like that in my experience though. Frameworks often have a community that provides some convention guidance. Rails, for example, is huge on this. You can tell a developer "stick to the general Rails way of doing this" and they will often be able to follow that instruction. Is that lazy? Sure, probably. But I also consider it to be a feature of a framework.

Re: React is the new jQuery

#205

As a member of a busy, small team with a Rails app and a jQuery heavy front-end... I agree. We use React in a few places and wanted to simply introduce it slowly and "convert to React where we could". It simply has not worked out for us. We have typical server side rendered HTML that has been progressively enhanced with sprinkles of JS (jQuery + various plugins). We do not and cannot book much developer time for refa…

Thanks for sharing, this is exactly what I am considering doing at the moment. Any thoughts on https://news.ycombinator.com/item?id=17213264 ?

For us the difficulty is that with React you need to let React control it's piece of the DOM. We have lots of jQuery UI components. For example, we use Select2. So let's say a dev tries to redo a jQuery heavy form in React. It's mostly fine but there's a Select2 component in there and some WYSIWYG jQuery plugin on a text area. You can't just initialize those with the React component because React will complain about jQuery touching the DOM it controls. So now you either have to find React versions of those jQuery components or properly wrap the jQuery components you have with React which, IMO, can be a bit funky and ends up feeling kind of wrong. Basically, you can end up down a rabbit hole. If you're intention is to truly modernize you're JS and your happy to rip out old jQuery plugins and make changes like that then it's fine. We just didn't have the dev budget to always be doing that.

Re: React is the new jQuery

#206

Earlier quoted context omitted.

> 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.

Yeah, Preact is great for standalone widgets
Post reply on HN