Live data from Hacker News

Angular 2 Release Candidate

github.com

101–110 of 139 posts

Re: Angular 2 Release Candidate

#101

Lots more work to do here, but we're pretty happy with how the core looks! For those worried about size (which has absolutely been a fair concern over the alpha/beta process) - here's a "hello world" built with Rollup and our offline template precompilation. Clocks in at 200kb min/47k gzipped, with a bit more room from optimization over the next couple of weeks... https://ng2-compiler-test2.firebaseapp.com/

That seems a lot for: Hello world hello child (yes, I know it's not the same under the covers - take it as a comment on the ecosystem, not on the implementation (although it can be a comment on dead code detection too))

I see a lot of complaints about toy app size/complexity. There's definitely a judgement call to makes about app complexity when someone starts a project with a framework. I inevitably find that development in the middle/end of the project is substantially easier when using a good setup like React/Redux/etc or Angular, and changes are easier to make, whereas vanilla development is (relatively) substantially easier at the beginning of a project.

Yeah, Hello World might be expensive in size, but when you've got a substantially complex and fast app for not much more size, you start to feel the real benefits.

Re: Angular 2 Release Candidate

#102
post #66

Earlier quoted context omitted.

> Other people feel the opposite, that putting new tags which are similar to inline onclicks and other events that we moved away from w jQuery is dirty. Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application. Javascript syntax allows far more control over the hierarchy. Your example is akin to saying putting a tank in an airplane is the same…

> Not even remotely the same thing. HTML has a hierarchical structure which isn't a particularly good structure for a web application. Is there a "good" structure for a web application that jumps to your mind?

Yes, isolated components with as few components being aware of the application state as possible. This is the fundamental structure if a redux app, which is effectively the point if Web Components.

Throwing on click tags or jquery selectors on a huge HTML document is not a good structure.

Re: Angular 2 Release Candidate

#103
post #11

Earlier quoted context omitted.

I read something a while ago that I think really sums the key difference, is that angular and other frameworks inject javascript into html and its awkward. React injects HTML into javascript, and it seems, that way around is a lot more powerful as you have all of javascript to manipulate html rather than having HTML/Templating/Extensions to manipulate Javascript. The two advantages are speed (it's supposed to be fast…

So Java Servlets was the right approach all this time?

The page/request-oriented model is bad. It forces your code organization to match an implementation detail.

A component model is great though. Wicket is the library that gets it. Whenever I write Angular (or Django, or anything) I wish I was writing Wicket.

Re: Angular 2 Release Candidate

#104
post #5

I realize a lot of companies flocked to Angular and it's used in a lot of places, but from the outside it seems to be fighting on two fronts. 1. Companies currently implementing it not wanting it to change or for there to be a quick and painless migration from 1.x to 2.x. So, less change, more hand-holding. The web changed a lot though, so its change is understandable. 2. Trendsetters and upcoming companies looking f…

React and Angular are two very different experiences. Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise framework feeling - hierarchical DI everywhere, everything out of the box (DI, routing, events, forms, etc.), classes and OO are the foundation, decorators, even "functional" parts adopts RX from .NET. Using Dart gets you even more stuff working "out of the box"…

I agree, i also prefer an optionated Framework like NG2 in this case and i love Typescript. After 10 years as a webdev react and it's ecosystem feels like a step back to me in terms of maintainability of the whole thing if you have a really complex project. For smaller stuff, React is usually fine though.

Re: Angular 2 Release Candidate

#105

Earlier quoted context omitted.

React lets you summarize your framework in a single sentence: make your UI a pure function of your model, but keep performance. OTOH, I still don't understand what the deal with Angular is.

Angular is an ORM for the DOM. With an ORM it's: "here's my model, figure out what to do to the database". With Angular it's "here's my model, figure out what to do to the DOM". Some people hate ORMs because there's too much magic, other's like them because they let one think about other parts of the app more.

How is Angular any different than React in the way that it allows you to bind models to the DOM? They're both component based, you have to specify the template and backing logic in both.

Re: Angular 2 Release Candidate

#106
post #61

Ask HN: Why would I spend time upgrading my Angular1 code to Angular2 when I can migrate to React Or Vue.js. I am honestly intrigued as to what Angular2 offers, that other JS frameworks wont?

They are competitors. People will make arguments to either side. In my point of view react is easier to use while angular is better for testing. My personal choice is angular. I'm really excited for v2. But both are super powerful.

Perhaps the question could be rephrased as: I am happy with how React handles my view layer. What more does angular bring that would make me want to switch, from React + whatever else I'm using as libraries?

I don't really think angular and React are direct competitors.

Re: Angular 2 Release Candidate

#107
I'm looking forward to trying this out. Having written Ember, Angular, and React apps now, I feel like they are all getting closer, but a lot of rough edges still exist.

Ember: interesting framework, but all too often, you would hear a team mate say "wait, why is that working, it shouldn't be?" Mixed with equal parts "logically, that SHOULD work, what am I missing?"

React: I love the component focus, and redux is pretty slick. However, the insistence on using JavaScript in lieu of helpful abstractions that clean up the code for easier maintainability, is frustrating. The whole point of JSX is syntactical sugar, but the team went with half measures. You also end up with a lot more plumbing code than the other two. Sure, I can reuse some of these components, but in truth, most of your components will be single use.

Angular 1: by far the easiest and most intuitive. Enough magic to make setup and a basic app easy, but not so much magic that you can't figure out why something is working. However, the more complex an app, the less Angular 1 serves. And you really need to use directives as a component, and follow a more react pattern, or you're going to have a bad time. Also, the dependency injection is a nice thought for simple directives, but when you're done, you'll very likely have so many dependencies being injected that unit testing becomes burdensome. And if it's burdensome, it won't be done as much as needed.

All that being said, if your app is primarily collecting data through forms, you can't beat angular. If it's highly dynamic, and you want a more native feel to your app, react is the clear winner. Ember is a neat, but I won't be using it again.

Angular 2 doesn't fix all of my complaints, but it's getting closer.

Re: Angular 2 Release Candidate

#108

Earlier quoted context omitted.

Angular is an ORM for the DOM. With an ORM it's: "here's my model, figure out what to do to the database". With Angular it's "here's my model, figure out what to do to the DOM". Some people hate ORMs because there's too much magic, other's like them because they let one think about other parts of the app more.

How is Angular any different than React in the way that it allows you to bind models to the DOM? They're both component based, you have to specify the template and backing logic in both.

Implicit vs explicit binding.

Re: Angular 2 Release Candidate

#109

Ask HN: Why would I spend time upgrading my Angular1 code to Angular2 when I can migrate to React Or Vue.js. I am honestly intrigued as to what Angular2 offers, that other JS frameworks wont?

Why would you do any of these?

If your Angular 1 code is working well, doing any of the above would be stupid.

As far as I'm concerned, new JS frameworks are options for new projects, not existing ones.

Re: Angular 2 Release Candidate

#110

Angular core team member here, happy to answer questions

I love Angular 1.

When I looked at the Angular 2 beta a couple of months ago, you needed to add es6 shim, angular 2 polyfills, systemjs and rxjs as well as Angular 2, just to get up and running and have a basic Hello World.

Contrast this to Angular 1, where the library on it's own with no dependencies will suffice.

Is this still the case? Are there plans to package Angular2 as a single minified GZipped library?

Thanks

Post reply on HN