Live data from Hacker News

Angular 2 Final Released

angular.io

171–180 of 452 posts

Re: Angular 2 Final Released

#171

Earlier quoted context omitted.

I recently started a new front-end-heavy project and ended up just using Angular 1 instead of React. The decider for me was the amount of tooling that React needs you to have in place just to get up and running. React expects you to do your development on some flavor of Unix, and really doesn't have a sane plan for Windows, so you lose VS.NET and its huge productivity gains. And it needs tools upon tools upon tools t…

I can not share your experience at all. We are using React with Typescript for our projects at work and we have all common systems present (Linux, Windows, Mac). Our projects compile from Typescript to ES6 and then ES6 to ES5 through babel. All of that takes place in webpack, and it was pretty easy to setup. We also all use Visual Studio Code and it's a joy to work with. If you use something like hjs-webpack it gives…

Visual Studio has task runner explorer now as well, it's easy to setup command line tools to run automatically, either on project open or on build.

I despair these days at the ridiculous number of command line tools you need to run, but once you've completely wasted 2 or 3 days of your life on these pointless things, cut and pasting command lines from setup instructions that give no indication what any of the flags actually mean, you can forget about them.

There were days when you just had to run an installer and then you were good to go. Or just get the latest version of the tools (and by tools I mean actual tools with a GUI and everything, gasp!) That's obviously really untrendy now.

But yeah, you can set it all up in VS to deal with the insanity for you. Good thing too, as the ASP.Net team have been drinking heavily from the command line insanity kool-aid.

Re: Angular 2 Final Released

#172
post #164

Earlier quoted context omitted.

You can totally use typescript with React, in fact it's a game changer. It's actually way more beneficial than with angular, as you have properly typed components all the way down. No crappy string templates that are not checked by typescript.

True story. But how did you get rid of the implicit anys when using JSX? I used this compiler flag that forbids them and suddnendly nothing worked anymore. It seemed that almost everything returned any per default.

That compiler flag is wonderful, and so is the newer 'strictNullChecks'

I use these typings: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast...

Then create my components like this:

interface Props {

}

interface State {

}

class MyComponent extends React.Component {

}

and everything is typed correctly (beside setState which is impossible to type exactly as of today)

Re: Angular 2 Final Released

#173
post #165

Earlier quoted context omitted.

Has everyone who switched from Redux to MobX been informed that Redux won and they should switch back?

I didn't understand this. Isn't MobX the "classical" way of databinding everybody frowned upon for years? And now that React finally eased that pain with Flux and then Redux, they bring it back?

I don't think that many people switched to MobX to be honest. It's very similar to knockout observable and while it works, I don't think I would use that approach again. I suspect people like the familiar OO syntax of MobX. I can't think of advantages it has over plain old streams (most.js, flyd.js)

Re: Angular 2 Final Released

#174
post #143

Earlier quoted context omitted.

Javascript is definitely a terrible language, but it is the only language for the web unless you consider languages that transpile to javascript. Are you suggesting not using a javascript framework, using a transpiled language instead of javascript, not writing any front end code at all, or doing something ridiculous like turbolinks?

Why would you consider JS to be a terrible language? It's not a requirement to use a framework to code in JS.

"Why would you consider JS to be a terrible language? "

JS is kind of a 'bad language' because:

1) It's missing some pretty important things. Try to determine if a value is a number. Seriously. Look into that mess. Or anything else. Doing simple type-checking is crazy, and we basically are resigned to 'best practices' - which is crazy.

2) Prototype chaining is a neat idea and has some merits - but in reality it makes things super-duper complicated. Ask 10 JS devs how it works and get 21 answers. That is bad.

3) Almost nothing is built in. You need to use a lot of 3rd party libs to do common things.

4) There is no such thing as 'JS' - ever browser, every version - you get completely different implementations. Maybe we can't blame 'JS' - but pragmatically, this means JS is a problem.

A minor issue is issues with packaging, encapsulation and scale, which is also a function of loose typing. When JS programs get complex, they get unruly, and you wish you might be able to do things in an OO language at that point.

JS is really light, and that has advantages - and I think it's the best language for a lot of async things - and UI's are inherently async - so that's good.

In 5-8 years JS might be 'stabilized' in terms of libs or de-facto standards and it will grow.

To anyone who's programmed in other, more established languages, I think it's clear JS has some weirdness that doesn't need to be there.

But I like it.

Re: Angular 2 Final Released

#175
post #8

Is there a definitive angular versus react versus ember (or others) pros/cons/community status page out there somewhere?

Remember though, Angular is an (opinionated) framework, react is a lightweight library.

I wish people would just stop pointing this out. While technically true when people refer to React they're referring to the canonical stack that people use (i.e. + Redux).

Re: Angular 2 Final Released

#176
post #109

I use Angular 2 in production since November 19, 2015 (alpha.46). Currently I've built 3 web apps (40, 60 and 20 components each), 3 mobile apps (with Ionic 2) and my employer have plans for more apps. Breaking changes during alpha stage were expected, so I didn't have issues with it. Most positive things I want to highlight: 1. Components are encapsulated and truly reusable (and without dependencies hell). 2. You do…

I really really really wish they'd called it something like Bosium just to make searching for issues a lot easier. I keep coming across angular 1 solutions.

I think we should all agree and call it ng2?

Re: Angular 2 Final Released

#177
post #153
post #138

Earlier quoted context omitted.

Polymer and Angular 2.0 seems to have a lot concepts in common and I don't fully understand why they are going to compete, given they come from the same source. But for me it seems that Polymer nowhere picked up as Angular. When it comes to performance it is great in Chrome. In other browsers not so. I hope v2 will be much better once they can get rid of the compatibility layer for other ever-green browsers.

Have you actually benchmarked polymer in a non-chrome browser? It is much faster than Angular - somewhere around React performance. Polymer is picked up by big companies already whereas "no one"(big) is using angular 2.x for now. People here seem to project a weird bubble around Angular/React. > In other browsers not so. I hope v2 will be much better once they can get rid of the compatibility layer for other ever-gre…

I'm not comparing against Angular (which in v1 is known not to be super fast) just between browsers. I was mainly looking at https://vaadin.github.io/gwt-polymer-elements/demo/#gwt/Java... . It uses a lot of widgets on one page. Take a look how on loads in Chrome, Firefox, Edge (refresh to minimize network effects). I didn't go really deep in it, but first look was that lots of time was used in registering custom elements. Sure, here it is wrapped in GWT (which would be my case), but it doesn't seem to add much, rather the fact it loads all widgets from Polymer.

Re: Angular 2 Final Released

#178

Earlier quoted context omitted.

Regarding the "Flux" frameworks, that's not a problem anymore - basically Redux (which improves on some of Flux's faults) has won. Its developer was hired by Facebook, so I guess it's kind of officially sanctioned now.

Has everyone who switched from Redux to MobX been informed that Redux won and they should switch back?

Who has switched? Do you have any example?

Re: Angular 2 Final Released

#179

As someone who uses Angular 1 currently but would pick React for their next project, I'd love to see a list of reasons why I should use Angular 2 over React. If nothing else, Angular just stranded all their developers, while React has a huge head start on mindshare/plugins/tutorials/etc.

Maybe because Angular material components are much better than material-ui?

Re: Angular 2 Final Released

#180
post #38
post #34

Earlier quoted context omitted.

We've been using Angular 2 for about 6 months now. Having things deprecate several times like the routing engine was annoying but that's the cost of being on the cutting edge. The side benefit is that we learned a lot about the inner workings of Angular. I agree with your annoyance with the UI libaries. It's been a PITA just to find a working datepicker. We eventually rolled our own starting with the source of an aba…

There is a working datepicker here: https://ng-bootstrap.github.io/#/components/datepicker Source code here: https://github.com/ng-bootstrap/ng-bootstrap/tree/master/src... Be aware, it is not perfect atm, especially around validation, but it is pretty much the only datepicker out there for ng2 in the open source world (not even Angular Material 2 has one).

It just got even better with alpha.5 (released just seconds ago :-)) - now you can have datepickers in popups: https://ng-bootstrap.github.io/#/components/datepicker
Post reply on HN