Live data from Hacker News

React is the new jQuery

bradfrost.com

121–130 of 206 posts

Re: React is the new jQuery

#121

Does React or other cool frameworks have alternatives to jQuery UI components or you need to build your own calendars,dropdowns, accordions.

React has everything (calendars, dropdowns, accordions and so on).

Can you link to the official repository? last time I checked you had to find something on github that mostly were incomplete and the best components were jQuery wrappers

Re: React is the new jQuery

#122
post #68

I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shi…

Not a snarky comment, but have you had to share this code with other developers? If so, how did you find getting them up to speed without shared conventions?

I have a team of 4 devs working for me. It took them a week to get up to speed with and work with full efficiency. Everyone knows JavaScript. It's nothing new, we're just using it without any added syntax. Everything is familiar.

Re: React is the new jQuery

#123

Earlier quoted context omitted.

What does "an entire framework" mean? Because you can just make React the little news and weather widget in the corner of your app / website, as the only React component. Same with Vue. The people for whom ripping out React or Vue leads to a blank page are those who wanted an app from the ground-up. If anything, React is losing because it doesn't include enough out of the box. If you wanted to build a news widget, fi…

> What does "an entire framework" mean? Because you can just make React the little news and weather widget in the corner of your app / website, as the only React component. Same with Vue. Is there a step-by-step tutorial for this? I was googling for one yesterday, because I have a legacy app and want to start moving small components (like datagrids) out of server-side rendering and into components. The best I found w…

I've been spending hours and hours the last few days working with react/vuejs/react native/native script+vue. It's hard picking a stack for staticish sites/pwa/pwa+e/spa/mobile! Throw in moving from .NET/IIS to .NET Core and tinkering with Node.JS/Express and your head is going to be spinning like mine (let alone worrying about authentication, API first, SSR)

Right now I'm moving an old webforms project to .NET Core + MVC / Razor and am going to try building out some components in both react and vue to see how it goes.

As for some links:

Here is slightly old .NET/MVC5 article: https://www.red-gate.com/simple-talk/dotnet/asp-net/a-real-w...

Vuejs for .NET/MVC5: https://medium.com/corebuild-software/vue-js-and-net-mvc-b5c... https://medium.com/@hyounoosung/integrating-vue-js-2-0-to-ne... https://medium.com/@disjfa/using-vue-js-in-existing-websites...

Re: React is the new jQuery

#124
post #77
post #68

I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shi…

Curious are you writing newer style javascript with polyfills or just plain old school javascript?

Es2018 all the way. Web workers, classes, Isomorphic code, generators, async await, etc with a splash of Babel Devs have never been happier. Everything just works and online documentation is Rich and plentiful.

Plus as I said, core logic works on both server and client and we have offline support as an added bonus.

Re: React is the new jQuery

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

Real life example: https://caniuse.com/#feat=urlsearchparams if you need to support IE11 then you can't use the URLSearchParams object. Your best bet is still a jQuery library.

Re: React is the new jQuery

#126
post #75
post #68

I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shi…

Do you have any advice for developing this way? I've found myself too sticking in the VanillaJS camp, but not being able to talk about React seems to dissuade potential employers.

My only advice would be to stay consistent, find patterns and genralize stuff. I do see the irony of making a framework of my own in the process of doing all that. I just embrace that. Everything is exactly how we want it and we know each line that executes on the machine. Makes development a breeze. There is nothing that react can do that vanilla js can't with reasonably same amount of effort. But stay open-minded. What helped me was that I worked with angular first to see how not to do front end (angular.js). I also regularly check out how react, angular, Vue, etc handle the same problems that I have. That usually gives an inspiration.

In the end it's hard to believe how fast JavaScript can be even on smaller devices.

Re: React is the new jQuery

#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 see your point, but using off examples like this don't really sell it too well.

Re: React is the new jQuery

#128
post #68

I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shi…

While I am sure this is possible even for complex applications I will also claim those projects are virtually unmaintainable by anyone that is not you.

You can of course prove me wrong and point us to a complex vanilly JS application you wrote.

Re: React is the new jQuery

#129
post #68

I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shi…

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. If that turns out to be too difficult then it's not the code or framework's fault. Staying strict about how to do things is a concept that exists irrespective of framework or no framework.

Re: React is the new jQuery

#130

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

Back when browsers were wildly incompatible jquery was a life saver. Sure you could do painful dom code and then have all kinds of libraries that have to be loaded in the right order to support all browsers or you could just include jquery. Now in the era of the progressive web app SPA jquery is outdated. Even for low level dom its still outdated because modern browsers follow standards really tightly especially comp…

jQuery also predates standards such as querySelectorAll and fetch, so no, it wasn't just compensating for browser incompatibilities; it also provided a far more pleasant API.

React is in a similar boat - it provides a far more pleasant experience keeping the DOM in sync with your application state, in a way that Web Components don't (although they have other advantages that make them great when used together with React).

Post reply on HN