Live data from Hacker News

The React Is “just” JavaScript Myth

daverupert.com

11–20 of 45 posts

Re: The React Is “just” JavaScript Myth

#11
post #8
post #6

Earlier quoted context omitted.

Just out of curiosity, what are your thoughts on Vue? I've heard a lot of good things about it.

I dislike the templating language, preferring jsx which is mostly standard js syntax, e.g.: Vue: {{i}} React: items.map((i) => {i} )

IIRC you can use JSX with Vue via a Babel plugin [1]. I can't vouch for it personally but it should be pretty easy to use.

[1] https://github.com/vuejs/babel-plugin-transform-vue-jsx#usag...

Re: The React Is “just” JavaScript Myth

#12
post #6
post #2

> React is so much more than “just JavaScript”. React is an ecosystem. I feel like it’s a disservice to anyone trying to learn to diminish all that React entails. React shows up on the scene with Babel, Webpack, and JSX (which each have their own learning curve) then quickly branches out into technologies like Redux, React-Router, Immutable.js, Axios, Jest, Next.js, Create-React-App, GraphQL, and whatever weird plugi…

Just out of curiosity, what are your thoughts on Vue? I've heard a lot of good things about it.

I love Vue, so much of what it does just feels right.

My one complaint is that Vue components place templating, code and styles in a single file and I'd prefer a directory with three (or more) separate files.

Re: The React Is “just” JavaScript Myth

#13
As an "Angular-guy" I can ensure you that with Angular we use also builders, minifiers and even TypeScript compiler. And testing is a separate story with painful moments. Of course, we have much more tools out of the box - we don't have to look for a good router, for example.

But there is no paradise of one magic tool in the web development.

Re: The React Is “just” JavaScript Myth

#14
> I sometimes browse React projects and look at the import blocks to see if I recognize any of the dependencies; I probably average about ~8%.

This is very true, not just because of the libraries you don't know yet but also because those you do know are continuously evolving. I've been working in the React ecosystem for about 4 years now. I think constantly keeping an eye on the changing ecosystem, and constantly changing the way you do things where it makes sense, just comes with the territory now. You just have to accept it as a way of working, if you're going to enjoy working with React (and JS generally).

Whenever I've locked down dependencies and just got my head down and built stuff for a few months, without fail every time I've looked up I've realised that there are now multiple things in my stack that are 'outdated' and there are some genuinely better ways of doing things (some really are just different and equally good, and it's fine to ignore those) that have evolved and been evaluated and ultimately embraced by the community in parallel in the few short months I've had my head down.

To be honest it's what I love about the JS ecosystem in general - it's an environment of continual improvement and blisteringly fast pace of change.

Re: The React Is “just” JavaScript Myth

#15
post #6

Earlier quoted context omitted.

Just out of curiosity, what are your thoughts on Vue? I've heard a lot of good things about it.

I love Vue, so much of what it does just feels right. My one complaint is that Vue components place templating, code and styles in a single file and I'd prefer a directory with three (or more) separate files.

I don’t think it’s a requirement. You can use Vue simply by including it from CDN and just sprinkle some functionality on a page.

Re: The React Is “just” JavaScript Myth

#16
post #10

The jQuery api was hundreds of different methods, the best of which are now available natively in JavaScript. React has a very small api, I hardly ever refer to the documentation (unlike when I was a jQuery or Angular developer) I agree that people reach too early for helper libraries but you can go a long way in pure React.

Because React doesn't manipulate the DOM directly you're leaving every convention and tool about DOM manipulation behind, which means that the moment you want to do something more complex than composing components you either have to re-invent the wheel or use the brand new wheels that somebody re-invented.

React is brilliant but makes simple stuff that no one was thinking on anymore hard and complex again. So if you don't want to think about how to handle an AJAX request and an animation like it's 2004 you can just slap a library on top of React(and worry about the page size and loading strategies).

React is a statement, a revolution, it is about disowning the old Web and building it from scratch.

Re: The React Is “just” JavaScript Myth

#17
post #16
post #10

The jQuery api was hundreds of different methods, the best of which are now available natively in JavaScript. React has a very small api, I hardly ever refer to the documentation (unlike when I was a jQuery or Angular developer) I agree that people reach too early for helper libraries but you can go a long way in pure React.

Because React doesn't manipulate the DOM directly you're leaving every convention and tool about DOM manipulation behind, which means that the moment you want to do something more complex than composing components you either have to re-invent the wheel or use the brand new wheels that somebody re-invented. React is brilliant but makes simple stuff that no one was thinking on anymore hard and complex again. So if you…

fetch and CSS handle AJAX and animation absolutely fine with native calls and work well with React, why would you bring in a library to handle these?

Re: The React Is “just” JavaScript Myth

#18
Personally I strongly disagree that you need to be "all in" on the React ecosystem if you don't want your knowledge to evaporate (as the author puts it):

I've been using React since 2015 when it was still in beta, so I witnessed the evolution and invention of the whole ecosystem around it firsthand.

And while it's true that the team and community introduced many new tools and technologies, you could probably still use the original React documentation from 2015 to build a simple app (as to my knowledge no backwards-incompatible syntax changes were introduced).

Also, for 99 % of apps you probably don't need the full-blown React stack like React Router, Redux, server-side rendering, hot reloading, transpiling with Babel, bundling with Webpack2 etc. I routinely build small React apps for websites (e.g. for contact forms) using just vanilla React.js (actually Preact.js as it has a smaller footrprint) without any of the amenities listed above, and sometimes I even write old-style ES5 code and use JS-based tags instead of JSX.

So please only introduce additional complexity (in form of tools, libraries and add-ons) if you really really need it. The more complex your toolchain, the more effort you will spend just maintaining and upgrading it instead of doing productive work (frontend devs who tried upgrading Webpack and Babel.js to the latest version in an existing project with many dependencies probably know what I'm taking about).

Re: The React Is “just” JavaScript Myth

#19
post #17
post #16

Earlier quoted context omitted.

Because React doesn't manipulate the DOM directly you're leaving every convention and tool about DOM manipulation behind, which means that the moment you want to do something more complex than composing components you either have to re-invent the wheel or use the brand new wheels that somebody re-invented. React is brilliant but makes simple stuff that no one was thinking on anymore hard and complex again. So if you…

fetch and CSS handle AJAX and animation absolutely fine with native calls and work well with React, why would you bring in a library to handle these?

You bring animation libraries in when your UI animations don't necessarily match the component lifecycles and you don't want to do something basic. Well, you don't have to bring in animation libraries but then you'll have to engineer it by yourself and handle all the quirks.

In React you simulate a DOM(or whatever) instead of working on a DOM that's handled by the browser(or whatever).

It's just like the difference of a real-world physics and simulated physics. In the real world, you can throw a rock and the nature will handle everything. On a simulation, you will have to think about all kind of details to make your simulation as realistic as possible.

Re: The React Is “just” JavaScript Myth

#20
This confuses React with the react eco system.

I am a happy producrive React user and I don't know two figs about the wider eco system.

Whatever man, React is just JavaScript and they've learnt what not to do from Adobe Flex, that is why I am so fast and productive in it

Post reply on HN