Live data from Hacker News

ReactJS is a tax Facebook levies on startup web development

typed.pw

21–30 of 37 posts

Re: ReactJS is a tax Facebook levies on startup web development

#21

+1. i am paying this tax tinkering with reactjs getting it to do stuff which is very trivial with normal html/js world

Here's an example of using "trivial normal html/js" inside a React component:

http://www.webpackbin.com/VkDiCyjd-

What gives you the idea you have to do everything with React if React makes something too difficult? React has escape hatches built into it for a reason.

Re: ReactJS is a tax Facebook levies on startup web development

#22

I've been using React for just about everything front-end wise for the past year. I don't think it's particularly hindered me, really. Sure, it was a learning curve, as was Redux, but now I understand those concepts better, my process is, I clone a 'react starter pack' from git, which has all of the build set-up I need, webpack, sass, ES6 etc, etc. And that's really it, I find it quicker to develop in React and Redux…

I'm quite surprised seeing quite many comments telling how they use React "for everything". Isn't React just a small[1] library that essentially does only one single thing? (And does it well) Takes a component definition, a state object, and then renders (and maintains) the component as a DOM structure? Unless I was looking into some other React that everyone's talking about, or I've had my eyes looking somewhere els…

I'm not the parent, but I think that a lot of people (like me sometimes) say React as a short for React+Redux (or other flux implementations). Parent does mention redux, so I guess it applies to them also.

Re: ReactJS is a tax Facebook levies on startup web development

#24

Earlier quoted context omitted.

I'm quite surprised seeing quite many comments telling how they use React "for everything". Isn't React just a small[1] library that essentially does only one single thing? (And does it well) Takes a component definition, a state object, and then renders (and maintains) the component as a DOM structure? Unless I was looking into some other React that everyone's talking about, or I've had my eyes looking somewhere els…

I'm not the parent, but I think that a lot of people (like me sometimes) say React as a short for React+Redux (or other flux implementations). Parent does mention redux, so I guess it applies to them also.

Yes, I suspect it, but there's also ton of other stuff besides UI component rendering and state transformations.

I mean, stuff like persistence layer (communications with some sort of storage), data model and front-end form validation, etc. I don't think React or Redux provide those.

Re: ReactJS is a tax Facebook levies on startup web development

#25

I've been using React for just about everything front-end wise for the past year. I don't think it's particularly hindered me, really. Sure, it was a learning curve, as was Redux, but now I understand those concepts better, my process is, I clone a 'react starter pack' from git, which has all of the build set-up I need, webpack, sass, ES6 etc, etc. And that's really it, I find it quicker to develop in React and Redux…

I'm quite surprised seeing quite many comments telling how they use React "for everything". Isn't React just a small[1] library that essentially does only one single thing? (And does it well) Takes a component definition, a state object, and then renders (and maintains) the component as a DOM structure? Unless I was looking into some other React that everyone's talking about, or I've had my eyes looking somewhere els…

I think the great think about React, and stop me if I've missed your point, is that they're actually just libraries, not framework's, you can just pull in the parts you need and work off of those.

Say you're just doing a single page application, with some basic logic. You can just use React on its own to create components, as you don't need an entire state life-cycle. We do this a lot to 'enhance' our statically generated sites.

Or completely on the other end of the spectrum, you can use Redux, isomorphic rendering with Nodejs for example, react-router, and you can create a complete, dynamic site, with state, storage, authentication, whatever you need.

Then you have everything in between.

So you really can use React "for everything" in my view, and that's partly why I love it so much.

I don't think React is just an "evolution of template libraries", I think React is a concept, I know React didn't invent this concept of 'components', far from it, but I think it brought about the most clear-cut, concise way of creating web components, largely thanks to React's use of JSX, I think. When you team that up with Webpack (which you totally should btw), you can house all of that components dependencies in the same directory, and call them within the component, a truly modular approach.

(I promise you I don't secretly work for Facebook, I just love React).

Re: ReactJS is a tax Facebook levies on startup web development

#26

We've already been through an era of manual DOM updates with jQuery and it was pretty horrible for anything non-trivial.

My first biggish js app was built around jQuery custom events. It started out elegant and simple, I was very happy. It then quickly became a nightmare, a very non-benign spaghetti monster.

Re: ReactJS is a tax Facebook levies on startup web development

#27
I think the real reason react is taking off is the ease of integration with es6. It's weakness is the lack of support for web components. The lack of support may cause react to lag behind dart and angular 2 in the future but right now it's a nice way to work with es6 and get some pretty good code organization. Angular 2 is going to be easier to test but people also use react with typescript for the same level of testability. But ultimately the popularity has to do with the way react integrated with babel and es6.

Re: ReactJS is a tax Facebook levies on startup web development

#28
> tricking the framework into doing what we want it to do

I read this from many framework users about many frameworks. Seems like the average developer just can't change is modus operandi to work with the framework they use.

> performance is abysmal

Yes, it's not that good, but most of the time it's enough. Many people write how you should go immutable and be pure and the performance (see pure render mixin etc.) will come. I simply switched some parts of the app, that need high-speed, out with D3 for example.

> it’s nothing that couldn’t be replicated by some simple coding conventions

True and there are many many component based frameworks to choose from. React simply has the better eco system.

> priming and funnelling programmers into their enterprise

Yes and that's probably the main selling point of React for Facebook (i.e. why they give it away for free). They already hired a bunch of devs that did some OSS work on React.

> suppressing development efficiency elsewhere

This, on the other hand, is a bit of a stretch. They don't force anyone to use it and if you did and saw the problems with it (like I did), you could simple use a different framework. There is no shortage on JS frameworks.

What I like about React, is that it has a big eco-system/community and a small API.

After using it one year, I saw its flaws (both in React and Redux) and wouldn't use it for the next project if I have the choice.

Re: ReactJS is a tax Facebook levies on startup web development

#29

Earlier quoted context omitted.

I'm quite surprised seeing quite many comments telling how they use React "for everything". Isn't React just a small[1] library that essentially does only one single thing? (And does it well) Takes a component definition, a state object, and then renders (and maintains) the component as a DOM structure? Unless I was looking into some other React that everyone's talking about, or I've had my eyes looking somewhere els…

I think the great think about React, and stop me if I've missed your point, is that they're actually just libraries, not framework's, you can just pull in the parts you need and work off of those. Say you're just doing a single page application, with some basic logic. You can just use React on its own to create components, as you don't need an entire state life-cycle. We do this a lot to 'enhance' our statically gene…

> they're actually just libraries, not framework's, you can just pull in the parts you need and work off of those

Yes, that's the good part about it. Don't get me wrong, I'm very pleased with React for what it does. However, I only see it as a piece that does one certain thing (UI components), but still needs a lot of other pieces to make a whole.

I've actually first used it exactly this way - to just animate what previously was a static server-processed . Much less work, compared to what I'd have to do if I'd wanted to use some large framework (and bend to its way of doing all things). Still, I was quite confused, as React got marketed as a sort of panacea, and when I started to actually learn what it does, I found out it's essentially just an UI library and I need other pieces for my project.

> I think React is a concept

Aha! I see your point then.

To me it's different. I see React just as glorified and fancy templating system evolution that can update the rendered object DOM in a smart way (rather than how it's with, e.g., Mustache where you have to discard the whole tree and place a new one over), properly preserving the DOM nodes and their internal states.

It really looks like an evolution to me:

- First, we had, e.g. Mustache (and myriad of others). They had one global template-wide state and rendered to a monolithic string without nodes.

- Then came Backbone (and then Angular) that had layered states. A monolith broken to pieces. Not yet atoms, though.

- Then came React and every node had its internal state, nicely propagated through the tree. To me it seems like a logical evolution. I'm not saying it's any trivial or an obvious step (it must've required a lot of effort to come with a nice implementation that React is), but not something ground-breaking either.

Then there's Redux that does some FRP state transformations. But to me it's not React, as it doesn't even really depend on it (although very few use it otherwise, and even those who do probably do so only as proof-of-concept "hey, look, I can use it with [e.g.] Vue!").

Then there's, say, Immutable.js that does data structures that play nicely with FRP. Or, say, various communication libraries (ranging from jQuery.ajax and whatwg-fetch to Restful.js or Socket.IO). To me, such things are certainly not part of React. That's why I was surprised at "React" doing "everything".

Guess, it's just a terminology issue then. Seems that many just call everything "React"...

Re: ReactJS is a tax Facebook levies on startup web development

#30
I see a lot of handwaving on the side of "just" (fun activity: search for the word "just" on this page) using vanilla JavaScript. Can anyone point to a sane method of putting together a real-world large(ish) JavaScript application without using (or essentially rewriting) any of the established frameworks? I am talking about a single page app with multiple sections, each with multiple pages using nested reusable components. Bonus points for solutions for performance, server-side rendering, nested routing, state management, data flow.
Post reply on HN