Live data from Hacker News

Opinionated Comparison of React, Angular2, and Aurelia

github.com

91–100 of 169 posts

Re: Opinionated Comparison of React, Angular2, and Aurelia

#91
post #64
post #40

> And the React ecosystem tends to either lack typings or provide poor/broken typings. React integrates really well with flow[1] (which is not surprising because they're both developed at Facebook) and in my experience flow's typesystem is more powerful (OCaml inspired) than TypeScript one (C# inspired): - non-nullable types by default is a big deal (they added support for non-nullable types in TypeScript 2, but enab…

> React integrates really well with flow[1] (which is not surprising because they're both developed at Facebook) It can integrate just as well with TypeScript. > flow's typesystem is more powerful (OCaml inspired) It lacks access control for class properties/methods, I wouldn't call that powerful. https://flow.org/en/docs/types/classes/

> It lacks access control for class properties/methods, I wouldn't call that powerful.

You mean `private` and such ? Well JavaScript don't support taht either yet, and flow is a type-system for JavaScript, it's not a new language on its own.

About the «powerful» word: Flow has had an algebraic data type (ADT) from the beginning, the kind of type system you'd find in functional programming languages, whereas TypeScript has and Object-Oriented type-system (à la Java or C#). ADT are usually considered «more powerful» since it offers more ways to write logical invariants in your code. The recent versions of TypeScript tries to retro-fit some features of ADTs into it, like non-nullable types or sum types, but it's a bit hacky IHMO[1].

[1]: https://www.typescriptlang.org/docs/handbook/advanced-types....

Re: Opinionated Comparison of React, Angular2, and Aurelia

#92

> 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 like both Vue and Polymer. I've also tried react and while I get it works, I don't really like it.

So far Polymer is my go to solution, but Vue is close second. I like the fact that everything (web components) is native to browser platform.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#93

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

Polymer traction is looking good, over 7k people on slack channel, 750 elements on webcomponents.org. And they got first day on google IO this year, youtube main site is being rewritten in it, ING, IBM, GE are using it, so it gets quite a bit of love from enterprise too.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#94
post #80
post #59

Earlier quoted context omitted.

Everything in react is done in the template language. This react below is not JavaScript... it's a reverse template language with a mix of not-quite-html and not-quite-JavaScript. jQuery style code is nicer than that! I hate the enterprise boilerplate in react projects. No wonder they're all failing! class Square extends React.Component { constructor() { super(); this.state = { value: null, }; } render() { return ( t…

If you don't like the "boilerplate" of a single class definition, use a functional component, which is just a function that returns JSX, that is also a component. It could literally not be more straightforward. Or could you not hear me over the sound of that axe you're grinding? :)

*stateless components

Re: Opinionated Comparison of React, Angular2, and Aurelia

#95
post #90
post #84

Earlier quoted context omitted.

Cordova is all about plugins. You can use a native datepicker plugin for example. If you need native functionality, use a plugin. (there's probably one already there, but maybe you need to write a tiny bit of native code). I guess that's the whole point of hybrid that people don't understand - it's a hybrid, and you get to choose the best of both, making the trade offs you need to make for the best result. Not ideal…

So, the idea of Ionic/Cordova is: You can release an app without writing native code. Your suggestions certainly work, but they bring up questions: - How do I write the native code you mentioned? - How do I plugin the native datepicker in Ionic? - How do I deal with different native plugins for iOS and Android? I bet there are solutions for all of these problems, but then again, I might just want to consider React Na…

The datepicker native input plugin exists, so it's just installing it. Then you get a JS api for it.

If it doesn't exist somewhere in the thousands of plugins available, you'll have to make it yourself. The other thing that happens, is perhaps a plugin is only available for Android. Maybe there's another one with a slightly different JS api for iOS... or none.

I've also done emscripten compiled C++ mixed in there. Which replaced various native apps. Since it was mostly OpenGL anyway... the few controls were easily implemented in JS/Html.

Anyway... just trying to share some options. Lots of native cordova plugins available (which I guess is it's main point). I really don't care what other people do... and somehow got drawn in to this discussion again!

Re: Opinionated Comparison of React, Angular2, and Aurelia

#96
post #80
post #59

Earlier quoted context omitted.

Everything in react is done in the template language. This react below is not JavaScript... it's a reverse template language with a mix of not-quite-html and not-quite-JavaScript. jQuery style code is nicer than that! I hate the enterprise boilerplate in react projects. No wonder they're all failing! class Square extends React.Component { constructor() { super(); this.state = { value: null, }; } render() { return ( t…

If you don't like the "boilerplate" of a single class definition, use a functional component, which is just a function that returns JSX, that is also a component. It could literally not be more straightforward. Or could you not hear me over the sound of that axe you're grinding? :)

[deleted]

Re: Opinionated Comparison of React, Angular2, and Aurelia

#97
post #87
post #53

Earlier quoted context omitted.

Isnt Redux about using components to dispatch actions, and all the logic happens in the reducers for the store? So, the Model part is not inside the react view components which are just used for display. If you have uncontrolled components(React terminology for forms with extra data not handled by props), then form validation might require some processing in the components.

Partially, you're right. Some logic happen in reducers, but not all, because they must be pure. For example, you can't call new Date() in a reducer, because it's not pure. Imagine you have a TodoList with Items that have: a priority and a createdDate. TodoList is always sorted by 'priority, created DESC'. There's also an email service that gives you a high-level overview of the TodoList like so: High Prio (3 items) M…

The common solution seems to be using redux-thunk to shoehorn all of this business logic into the action creators. I think that's an absolutely terrible idea. IMO redux-thunk muddies up the terms "dispatch" and "action creator" and essentially creates a huge noob trap where new programmers don't even know what an action creator is anymore and they use the wrong terminology for everything.

Having said that, I think the thunk pattern is a fantastic solution. The two things the business logic functions need to do their job are dispatch, and the state, and the way redux-thunk does it with dependency injection makes your business logic functions very easy to test.

If somebody can come up with a solution with the same principle but without the absolutely moronic overloading of terms that people somehow find acceptable about redux-thunk, then they'll be onto a winner.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#98
post #85
post #75

Earlier quoted context omitted.

It's not JavaScript, and it mixes in almost-html... but it's not a template language? Wrong. It's a template language, even if Facebook tells you otherwise.

It really isn't a template language as the term is commonly used. If you feel so strongly about the weird syntax you can write equivalent code in javascript syntax instead. return React.createElement( button, { className: "square", onClick: () => this.setState({value: 'X'}) }, this.state.value ); If you think your code is written in a template language, then the code I just wrote must also be written in a template la…

That looks like JavaScript. Yes, of course you can use that - but which react projects do it that way? It seems this is mostly pulled out when people go... ewwwwwwww, stinky...

Most use the html+javascript language which is compiled and then spits out JavaScript and html. This is pretty much identical to PHP - which is a preprocessor template language.

Anyway, facebook says it reminds me of a template language, so I'll believe them.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#99
Been using Vuejs for a couple of months now. Just love it's simplicity and flexibility. Tried Angular 2 earlier. It was ok. But they've lost it with their new release cycle. I guess people will hesitate to use it.

Needed a routing solution where we had to load list-> multiple details(multiple tabs from a list of items; loaded using ajax/websockets) not single detail view. Not sure either Angular or Vue's router could do it. So we ended up implementing a custom one.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#100

Earlier quoted context omitted.

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.

Couldn't you just extend the React.Component class with whatever you need, and then use that instead of the base react class? Or am I misunderstanding what react is?
Post reply on HN