Live data from Hacker News

Opinionated Comparison of React, Angular2, and Aurelia

github.com

41–50 of 169 posts

Re: Opinionated Comparison of React, Angular2, and Aurelia

#41
post #9

I would love to hear how people solve the snackbar problem in React. I don't even see how you would solve it with redux since that's just the state.

What is the snackbar problem?

See the section in the article with the heading "Dependency Injection". It talks about a specific scenario where there is one component that needs to show the state of the entire system (an activity light turned on, for example), where any component can trigger this, but the last component to become inactive turns the light off.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#42
The ending is what makes this article:

>Overall, I'm not 100% sure I made the right choice, but I only have to live with it for two years.

People are great at short term thinking, and tend to be terrible at long term thinking. Just some anecdata: I had a look at some source code for a 10+ year old web app before JS libraries were popular. I could understand perfectly how a click on a link resulted in a URL hash change and how the hash change resulted in updates on the page. Nowadays it would be written off as coding your own framework since web developers can't be trusted to code without a framework anymore. But it worked with the least amount of indirection possible and it was simple to understand 10 years later. Web apps today just get rewritten every two years.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#43

This kind of comparison is meaningless. Compare React to Veu.js, as these are both view renderers, not full MV* frameworks. And compare Angular2 to Ember (with Fastboot), both of which are opinionated MV* frameworks. Not sure why this is on the front page

> not full MV* frameworks

Vue.js has an official router, and an official "redux" like data store.

https://router.vuejs.org/en/

https://vuex.vuejs.org/en/intro.html

It is absolutely a full MV* framework. Vue.js also supports server-side rendering, in fact I use Vue.js as my template engine when using node.js .

https://vuejs.org/v2/guide/ssr.html

Angular2 router is in a separate package, does it make is short of a full MV* solution? no.

What I like with Vue.js is that complexity is opt-in. In the sense that it doesn't force you to use a cli (it has a cli), it doesn't force you to use webpack or an asset pipeline (it has support for webpack). It doesn't force you to use a third party language, but you can... You start small then scale with your needs, instead of having to deal with complexity upfront. That used to kind of be the case with AngularJS 1 too, that's why it got widely adopted.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#44
post #31

Comparing plain React with Angular and Aurelia is completely useless. You cannot write a big serious application with Form Validation, Data Fetching, Testing, etc, just with React itself. A fair comparison would be to write a whole "real world" project and then see what parts you have to use and learn to be able to write a full React application.

Author didn't compare "plain React". Author compared React with React Router (and possibly Redux/whatever for state). Did you only read the part about the documentation?

[deleted]

Re: Opinionated Comparison of React, Angular2, and Aurelia

#45

> There are a few more frameworks I would have loved to try, including Polymer and Vue.js. There just wasn't enough time to do a deep dive with all of them. I hope he gives Vuejs a try. As a javascript beginner, who tried Angular, Angular2, A bit of React and VueJS, I just loved the flexibility and approach of VueJS. I was instantly productive thanks to the amazing documentation and vue-cli that just worked out of th…

I wish the author had tried Polymer because it's the most underrated one. I just love the way Polymer components declare/consume dependencies (as tags in the component file) and connect all sub-components in the template markup via attributes - It makes data binding relationships between components and their children very clear.

Polymer is basically an inverted version of React (and it achieves a similar outcome). In React, template markup is nested inside the code. In Polymer, code is nested inside the template markup.

I really like React but I wouldn't use it for a personal project knowing that Polymer exists. I hope Polymer will gain more traction because I would love to be able to use it professionally.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#46

> Angular's routing seems to involve "one big routing config". That's wrong. You can split the routing configuration just like in react-router or Aurelia. It also supports lazy loading of child routes and components. So you don't have one giant application to serve at bootup time. It is also documented really well: https://angular.io/docs/ts/latest/guide/ngmodule.html#!#lazy...

I was re-structuring the routing in an Angular 2 app yesterday and I came to the same conclusion as the author. I think the documentation in the routing section doesn't go into enough detail about how to configure the modules for the desired encapsulation. The documentation you've posted is what is required - but it's in module not routing. It's hard to find.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#47
post #19

> Save the global components off as global variables and just use them ... When my ActivityIndicator component mounts, it saves itself off to a global. Any code can import busy and run busy.start() and busy.stop(). What is the story that FP folks need to tell here, so that people don't do things like this?

Nothing. We know it's messy, but React doesn't really provide a better way of doing this.

Context is barely mentioned in the docs, "not recommended" by the devs. Redux is incredibly verbose and overcomplicated. Passing "global" things down in props is just madness (if everything needs it).

Personally I use context, or a singleton (which is just a hidden global really). It's naughty, but usually required for one or two things per application.

FP folks aren't sages hiding in caves who we all wait to come down from the mountains once a year with their crusty wisdom...

Re: Opinionated Comparison of React, Angular2, and Aurelia

#48

The ending is what makes this article: >Overall, I'm not 100% sure I made the right choice, but I only have to live with it for two years. People are great at short term thinking, and tend to be terrible at long term thinking. Just some anecdata: I had a look at some source code for a 10+ year old web app before JS libraries were popular. I could understand perfectly how a click on a link resulted in a URL hash chang…

> Web apps today just get rewritten every two years.

Your startup either dies or lives long enough to become a hodgepodge of ten different frameworks.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#49
This article is spot on. I've been building Angular 2 and React (Native) apps over the last 3 months and I have broadly similar conclusions. Once React clicked, it really is very easy to reason about.

With regard to the DI problem, I created a combination of static classes for things like the User object and function collections with observables for app state. I didn't use Redux. You can get similar behaviour with Observable zip/scan/reduce and it's much more lightweight.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#50

> There are a few more frameworks I would have loved to try, including Polymer and Vue.js. There just wasn't enough time to do a deep dive with all of them. I hope he gives Vuejs a try. As a javascript beginner, who tried Angular, Angular2, A bit of React and VueJS, I just loved the flexibility and approach of VueJS. I was instantly productive thanks to the amazing documentation and vue-cli that just worked out of th…

I wish the author had tried Polymer because it's the most underrated one. I just love the way Polymer components declare/consume dependencies (as tags in the component file) and connect all sub-components in the template markup via attributes - It makes data binding relationships between components and their children very clear. Polymer is basically an inverted version of React (and it achieves a similar outcome). In…

In React there are no templates, just component trees.
Post reply on HN