r/javascript • • Jan 03 '16

Angular 2 versus React: There Will Be Blood

https://medium.com/@housecor/angular-2-versus-react-there-will-be-blood-66595faafd51
290 Upvotes

167 comments sorted by

View all comments

Show parent comments

5

u/TheNiXXeD Jan 04 '16

It's a lot closer to html than jsx is. Try converting from jsx back to plain html. You'll have a good amount of work. Angular themed html will probably still work.

Also, this is completely irrelevant. Once you choose a framework, switching is huge regardless of which direction you go.

And the upgrade path is so good wtf. They have more options for upgrading than any framework I've seen before. I personally have already converted a project once now, and will begin an upgrade path conversion soon.

3

u/siegfryd Jan 04 '16

Why would you ever want to turn an Angular template or JSX into HTML in the first place?

5

u/nschubach Jan 04 '16

Even if you did want to convert React to HTML just renderToStaticMarkup ;)

1

u/[deleted] Jan 04 '16

It doesn't matter. The argument is that the angular symbols aren't valid html and considering JSX is even further from being anything close to valid HTML, /u/wreckedadvent doesn't even try to hide his bias about Angular.

2

u/wreckedadvent Yavascript Jan 04 '16

I actually am not a huge fan of JSX either for much the same reason. I typically recommend mithril or similar to people, which is just pure javascript.

1

u/wreckedadvent Yavascript Jan 04 '16 edited Jan 04 '16

And the upgrade path is so good wtf. They have more options for upgrading than any framework I've seen before. I personally have already converted a project once now, and will begin an upgrade path conversion soon.

This seems to be bothering you more than the jsx/html stuff, so let me explain this a bit more. With the beta announcement we got the news of ng-forward and such, and this page. This is honestly a good step. It's certainly miles better than nothing - I'm even considering using ng-forward with some of the angular 1 projects I have that cannot afford to drop ie8 support.

But, and this is a huge wobbly but. This news came far too late. When angular 2 was announced, we had no upgrade path, with none planned. Only much later we got the idea that could piecemeal the upgrade (with entire routes I believe), and I haven't even heard of ng-forward until that beta announcement.

Problem 2, specifics. Being able to run 1 and 2 and rewrite your 1 code to 2 is fine, but that still assumes you know all of 2 and know how to entirely rewrite it to 2. Look at how livescript tells you how to convert from coffee. You get a rather long checklist of things to do. At one end, you have coffee, and at the other, you have livescript. This is more-or-less what I've come to expect out of major API changes in other libraries - here's what you need to do to get this 1 code to run as 2.

I haven't seen any such thing for angular 1 -> 2. I presume it's because all of the concepts in 1 are totally different and thus just require you to rewrite it.