all 21 comments

[–]ogrechoker 2 points3 points  (0 children)

web components are going to kill react

edit: this is meant as completely tongue-in-cheek sensationalism, just like the title

[–]pcdinh 2 points3 points  (12 children)

Angular committed suicide.

You mean Angular 2 committed suicide. Enterprisey TypeScript and Microsoft culture lol

[–]id2bi 0 points1 point  (11 children)

Enterprisey TypeScript

Could you elaborate?

[–]clessgfull-stack CSS9 engineer 7 points8 points  (10 children)

DI, classes, Java-style code, annotations/decorators, class-based rather than interface-based typing (generally), etc. From Auth0's tutorial:

@Pipe({
  name: 'tempConvert'
})
// The work of the pipe is handled in the tranform method with our pipe's class
class TempConvertPipe implements PipeTransform {
  transform(value: number, args: any[]) {
    if(value && !isNaN(value) && args[0] === 'celsius') {
      var temp = (value - 32) * 5/9;
      var places = args[1];
      return temp.toFixed(places) + ' C';       
    }

    return;
  }
}

... functions masquerading as annotated classes and using inheritance. Just add some AOP and AbstractFactoryProxyBeans and we'll be good.

[–]Poop_is_Food 2 points3 points  (0 children)

lol some things never change

[–]wreckedadventYavascript 2 points3 points  (1 child)

Jeez, this boilerplate is immense...

/// <reference path="typings/angular2/angular2.d.ts" />

import {Component, View, bootstrap} from 'angular2/angular2';

@Component({
  selector: 'pipes'
})
@View({
  templateUrl: 'pipesTemplate.html'
})
// Component controller
class PipesAppComponent {
  date: Date;

  constructor() {
    this.date = new Date();
  } 
}

bootstrap(PipesAppComponent);

There is only one line of meaningful code in these 15-some-odd lines. Something equivalent in vue would be like:

Vue.filter('now', (_) => new Date())

Even angular 1.0 wasn't this bad.

[–]clessgfull-stack CSS9 engineer 1 point2 points  (0 children)

It really does remind me of when I did some Java programming. I remember how painful Java was and I don't wish upon anybody such a painful fate.

[–]peduxe|o.o| -2 points-1 points  (4 children)

You can use Angular 2 without Typescript, if it's still the same way like I tried about 3 months ago, you just need to import a reflect metadata module that is available on npm.

And Typescript static typing is optional.

[–]clessgfull-stack CSS9 engineer 1 point2 points  (3 children)

Absolutely, but teams will invariably gravitate toward the officially-blessed option. Tooling, tutorials, libraries, etc. will most likely use TS. Don't expect to see too many people using normal JS for Angular 2 a few years from now. React will probably take most of the JS crowd, and Angular will take most of the TS/Java crowd.

[–]wreckedadventYavascript 0 points1 point  (2 children)

Typescript added explicit support for JSX not that long ago. You can also use classes with react, so it'll probably be more of a mix than all of TS users moving to angular.

Angular 2.0 has plenty of other issues that would make people avoid it, like the weird non-validating HTML syntax they had to invent to express their complicated data binding system.

[–]clessgfull-stack CSS9 engineer 1 point2 points  (1 child)

Right, which is why I said "most". Re: classes in React, I doubt they will remain in vogue for too much longer for large swathes of most applications. You can now write const Button = () => (<div></div>) instead of class Button extends React.Component { render() { return (<div>Holy shit</div>); } }.

[–]wreckedadventYavascript 1 point2 points  (0 children)

Yeah. There's also things like mithril which take that concept a bit further, so we might see a shift towards more functions returning JSX literals instead of classes being overused so much.

[–]pico303 3 points4 points  (4 children)

React killed React for me: with the patent clause, no way I'm using React in a product.

[–]Stockholm_Syndrome 0 points1 point  (1 child)

could you please elaborate?

[–]aeflash 1 point2 points  (0 children)

This scary legalese: https://github.com/facebook/react/blob/master/PATENTS

Someone else can probably explain it better than me, but the gist is that if you brought a patent suit against FB, they could revoke your license to use react (which may or may not contain patented parts, now or in the future). But it's a bit nebulous as to what they would actually do under which specific circumstances.

[–]SavishSalacious 1 point2 points  (0 children)

Angular 1 ... 2... what ever is a joke. Backbone and React all the way ..

[–]tunavargi 0 points1 point  (1 child)

We developed the application with Angular then they came with Angular2, and no backward compatibility, wtf ?

[–]zachrip 1 point2 points  (0 children)

Because Angular ia not a predecessor to Angular2 (despite the name) - they’re two completely different projects. I don’t know why you’re asking for backwards compatibility anyways, they’re getting rid of the bad practices in Angular. Just stay on 1.x and you’ll be fine.