Live data from Hacker News

Opinionated Comparison of React, Angular2, and Aurelia

github.com

111–120 of 169 posts

Re: Opinionated Comparison of React, Angular2, and Aurelia

#111
post #75
post #71

Earlier quoted context omitted.

JSX is not a template language, it is just syntax sugar: see it as a different way to write javascript: https://facebook.github.io/react/docs/jsx-in-depth.html you can't say the same about templates.

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.

Template languages create strings. JSX creates hyperscript.

JSX by its nature statically checks for tag balance, etc. The non-JavaScript part of its syntax has actual semantics. In a template language the non-Turing-complete part of the syntax is just strings.

JSX is a perfectly good notation for describing how data maps to its presentation in a DOM tree.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#112
post #95
post #90

Earlier quoted context omitted.

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

Thanks for the suggestions. While trying Ionic, I didn't install Cordova plugins to fine-tune input control. I will give it another shot.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#113
post #89

It just shows how fast the web moves (or how old I am) that someone can write "Then the Web happened...pages were giant jumbled messes of template and jQuery." There were plenty of new paradigms and new headaches before the JQuery era!

The history of a subject does not exist prior to someone's interest in it. It must be an internet meme, because it happens way too often. Someone the other day posted an article in which the author said Github "invented" the term Fork. Mmmmkay...

Re: Opinionated Comparison of React, Angular2, and Aurelia

#114
post #75
post #71

Earlier quoted context omitted.

JSX is not a template language, it is just syntax sugar: see it as a different way to write javascript: https://facebook.github.io/react/docs/jsx-in-depth.html you can't say the same about templates.

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.

if you want to build your UI with React you have to think about JSX as an easier way to write javascript. you can see it as a template language but it won't help you to code :)

Re: Opinionated Comparison of React, Angular2, and Aurelia

#115
post #85

Earlier quoted context omitted.

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's not a good thing. I want to write this, and have it actually be HTML : I like HTML.

Though I personally can tolerate JSX, maybe you like SGML templating [1] which uses native markup mechanisms such as entity references for fully HTML-aware and injection-free templating.

[1]: http://sgmljs.net/docs/templating.html

Disclaimer: my project, and SGML is most certainly not a "lightweight template engine" by any measure

Re: Opinionated Comparison of React, Angular2, and Aurelia

#117

React is, of course, a work of a genius. But may I suggest another option in the same spirit, which is Riot.js? It is more elegant, compact and better syntactically polished, while retaining React's convenience and performance. (I had approached React right when the infamous Babel5->Babel6 transition happened, and was seriously burned by it.)

I am using riot.js too and am pretty happy so far. Actually, I never tried react, but as riot is smaller, I like the tag syntax much better and I do not feel like I miss anything, I do not know why I should try it (anybody here prefers react over riot? why?).

Before riot, I tried Backbone, Ember and Angular. While Backbone did a fine job it didn't help to structure the app and everything had to be done manually.

Ember was too opinionated for me. Yes, they have some nice concepts and bring a lot of functionality right out of the box, but when you still have problems doing basic stuff after the third project, you know it's time to move on. The only thing I sometimes miss is ember-data.

Angular looked better to me, but they lost me with the Angular2 migration. I hate it when libs break backward-compatibility and in my eyes, there were enough good alternatives so that I did not have to risk facing the same story again with some future angular version.

The beauty in riot.js is that you can easily build small html components and stack them together afterward and reuse them later. It really feels like a lib which you can plug into something else. So I am able to develop an app using riot.js with framework7 and formatjs at the moment.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#119
post #93

Earlier quoted context omitted.

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.

I remember looking at Polymer before I discovered Angular Material, and I really wanted to give it a go. I guess I played it safe by sticking with the thing I already knew, and I liked the Material docs. But I'd still like to try Polymer.

My biggest hangup with trying new platforms is finding a good UI framework to go with it, I like handing off styling to people who know what their doing.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#120
post #104
post #56

Earlier quoted context omitted.

Agreed. I've used Angular 2, React+Redux, and now Vuejs on different projects (and on personal projects, stuff like om, elm, etc). Vuejs feels like they cheated somehow. For people in Redux-land: they took the reactivity of MobX and gave it Redux' level of debuggability. One important way, I think, is that Vuex formalizes the 'actions-dispatching-actions' use case of Redux middlewares (which redux says 'is not a part…

For our team React + Redux + Redux Saga + TypeScript has been a great way to develop our complex SPAs. We do use MobX selectively (dynamic forms), but the big benefits of the combination is the ability for our team to work productively without stomping on each other. Big factors are the explicit layout for domain models in the store, clear points for mutation, testable orchestrations via sagas, JSON schema validation…

I'm actually using a similar stack to you today -- redux + sagas, flow, json-schema.

However, in my experience, Vuex also has explicit stores and clear points for mutation -- Vuex stores are really clear and composable. It's also about 10 lines to get redux-sagas to working with Vuex.

If it weren't for react-native, I'd be pushing to use Vue + Vuex whenever possible. So I'm watching Weex with bated breath :) -- it's very cool that it's recently become an Apache Foundation project!

Post reply on HN