Live data from Hacker News

The React Is “just” JavaScript Myth

daverupert.com

21–30 of 45 posts

Re: The React Is “just” JavaScript Myth

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

Have been developing with React for last 3 years, and recently started building with Vue JS.

React's core philosophy is JS everywhere - there's no template, no HTML, no CSS; only JS. As much as possible, write JS, and if you can, pure JS.

It has its benefits - you can have code formatter to format your JSX, unit test any part of your code, or write integration tests with mount, or write snapshot tests. Extremely easy and natural to compose various components - because it's a function calling another function.

Vue is magic, and its own DSL rules will get in your way. For instance, inside the Vue templates you cannot use `this`. However, inside your methods and computed, you have to.

Coming from Angular 1, Vue JS would look feel like a breeze.

Never could make ESLint work on my Vue files, tried all plugins. Some parts of the code it lints, and some parts of the code it doesn't.

Inside your template, Vue.config can be undefined; so you've to assign it to something in mounted(), and then get it to work.

Vue artisans tell me Vue supports "this" or "that". I don't want something that supports A or B - I want something where A and B are inherently supported from the ground up.

It's not all bad. VueX is pretty cool, kinda like Redux without the drama. And I cannot stress this enough - it's insanely easy to go through a Vue codebase and pick up the business logic of your app.

It still takes me some time to get used to a new React codebase.

Overall, I felt Vue is really good to build MVP and get your product off the ground, but it starts to show why you need React's discipline in your codebase with growing requests from users to add new features and support more platforms.

Then again, I'm new to Vue JS; so ask me again in a year. Am keeping an open mind.

Re: The React Is “just” JavaScript Myth

#22
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} )

I learned this the hard way, coming from React to Vue land; that v-for on an element would also repeat the element itself.

With React, it was pretty clear which element / component would repeat.

Re: The React Is “just” JavaScript Myth

#23

Having an ecosystem does not, in my humble opinion, make writing a React application feel substantively different from writing a pure JS application. Yes, JSX is not part of the core language (yet), but it's the closest to pure JS we are going to get considering developers' need for an intuitive, expressive, and virtually bulletproof templating language. Before learning React, I built some decent-sized applications w…

Out of curiosity, what do you think about lit-html[1]? The main thing I’m interested in there is that it’s based on native web technologies so you don’t need the huge non-standard React stack just to be able to load a file. Having has similar experiences with frameworks in the past I’m increasingly inclined only to use things which are moving in the direction of web standards to reduce the amount of churn.

1. https://github.com/Polymer/lit-html/blob/master/README.md

Re: The React Is “just” JavaScript Myth

#24
React has certainly inspired a huge shift in how we architect frontend web apps, and I think I'd rather view it on those terms instead of just how much you might buy into React's worldview and all of the libraries that subscribe to it when building your app.

React is one particularly well-regarded implementation of a virtual DOM library with one way databinding and ever since then we've seen various flavours of it with innovations of their own: Elm and the architecture that inspired Redux, ReasonML, reflex-frp, CLJS/Om Vue, Cycle.js, Glimmer, etc... React, as far as I know it, was the first for the web and while it might have been well-known in other situations, we were all scrambling around trying to solve the data-binding problem when building anything large scale in JS.

In that way, React's impact on the frontend ecosystem is profound much in the way jQuery's impact was back in the darker days, and what that technology has allowed us to do without depending on React itself is significant, much more so than its own ecosystem.

Re: The React Is “just” JavaScript Myth

#25
post #19
post #17

Earlier quoted context omitted.

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

I don't really see how complex animations is something React (or any UI framework) should be responsible for ?

Re: The React Is “just” JavaScript Myth

#26
post #25
post #19

Earlier quoted context omitted.

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

I don't really see how complex animations is something React (or any UI framework) should be responsible for ?

Who should be responsible if not the UI framework?

Oh, and by complex, I don't mean character animation or something. It's the stuff that is supposed to act differently than the React's internal workings.

For example, if you want to do an animation on items that disappear when the user takes an action it's not going to be easy as with plane JS manipulating the DOM. Also, you won't be able to use some nice artistic animations that were created by direct DOM manipulation.

Re: The React Is “just” JavaScript Myth

#27
post #5
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…

Perhaps a more charitable interpretation of the article is that when writing a larger application in React you'll be led from React-the-library (which is "just JavaScript") into React-the-ecosystem, which looks less like "just JavaScript" and more like the other frameworks. You can definitely write your application in React without external dependencies, but how is a beginner expected to do that, especially with all…

And? It's a criticism or interesting observation that when you build large, complex applications that they can be large and complex?

Re: The React Is “just” JavaScript Myth

#28
The benefits of React (such as its templating syntax) can be had with much simpler libraries, such as this one: https://github.com/wisercoder/uibuilder

The much touted benefit of React, DOM diffing, is useful if you have a very complex screen and you need to make surgical updates. Most applications have simple screens that can be completely re-rendered and the user won't know the difference.

Re: The React Is “just” JavaScript Myth

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

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

You can have that. You do need an index.vue file containing something like:

    
    
    
If you put that into a directory called my-component/ then you can just do:

    import MyComponent from 'my-component'
…and it will pull everything in.

Re: The React Is “just” JavaScript Myth

#30
As a long time React user (four years), I agree with this article for reasons different from what the author intended, perhaps. That's why I've recently started learning Dart and hoping that it'll catch on. I want to focus on solving the problem, not battling the ecosystem...
Post reply on HN