Live data from Hacker News

Angular 2 Beta released

angularjs.blogspot.com

261–270 of 273 posts

Re: Angular 2 Beta released

#261

Congratulations to the Angular 2 team on shipping before Christmas. The estimate was originally somewhere around early 2016, so this is a huge deal for them to get this out before the year was up. Unfortunately, Angular 2 launched into beta too late. In the amount of time that Angular 2 has taken to get to beta, ReactJS has slaughtered the front-end market share (in a good way) and completely taken developers by stor…

> ReactJS has slaughtered the front-end market share (in a good way)

No, it hasn't

> simplistic component based approach.

"Simplistic"

> Unlike React, Google does not really treat Angular as a first-class citizen because they have such split focus and conflicting React like library for web components called Polymer. They provide some resources, but nowhere near the amount of resources that Facebook throws behind React and React Native.

Facebook does one thing. Google does many things.

Re: Angular 2 Beta released

#262
post #249
post #216

Earlier quoted context omitted.

JSX/createElement is not just syntax sugar though. It avoids the whole step of parsing the template. Because JSX is JS code, you can pass native JS values to it including callbacks. Whereas anything you could pass to mustache-style templates will be stringified. So for example in case of parsed templates, to pass a callback to onClick you'd need to define a convention on how you're going to locate the callback by a g…

> to pass a callback to onClick Putting behaviour in HTML is a bad idea. Leave it in JS, and have one place to go when the behaviour changes.

> Putting behaviour in HTML is a bad idea

This is not what I'm doing. JSX is JS. I'm not putting any logic "in HTML". If I were able to express what I'm doing in mustache-style syntax, it would be:

    Blah blah Click me Blah
Where `callback` is a reference to a JS function (rather than a string holding it's name).

What's your ideal way of registering an onclick callback?

Re: Angular 2 Beta released

#263
post #229
post #107

Earlier quoted context omitted.

..I feel the same way. I prefer creating dom with code syntax. You can replace JSX by hand-coding with React classes - take a look at the compiled jsx and mimic that. I find it as easy to work with, and less cognitive dissonance [ a personal preference ] I actually am looking seriously at Mithril in preference to React for my next chunk of work. I might swing the other way if React native became stellar [ and viably…

It seems a bit of a Hobson's choice to me. Q: which do you prefer - this: ReactDOM.render( Hello World ) or this? ReactDOM.render(React.createElement("div", null, React.createElement("p", null, "Hello World") )); A: handlebars.

yeah, it is a bit unwieldy.. hence

A: mithril.js

Re: Angular 2 Beta released

#264
post #262
post #249

Earlier quoted context omitted.

> to pass a callback to onClick Putting behaviour in HTML is a bad idea. Leave it in JS, and have one place to go when the behaviour changes.

> Putting behaviour in HTML is a bad idea This is not what I'm doing. JSX is JS. I'm not putting any logic "in HTML". If I were able to express what I'm doing in mustache-style syntax, it would be: Blah blah Click me Blah Where `callback` is a reference to a JS function (rather than a string holding it's name). What's your ideal way of registering an onclick callback?

The moustache you're demonstrating there has the same problem. Add event listeners in JavaScript, not in moustache / jsx / whatever.

Re: Angular 2 Beta released

#265
post #78

The incremental upgrade path is disappointing. Step 1: Include the Angular 2 and ng-upgrade libraries with your existing application Is anyone with a serious application actually considering this? It would have been nice to include only the pieces of Angular 2 that you actually use. Instead, we have to ship both libraries, our application code and an additional plugin down the wire? I don't see this upgrade path as a…

There is also ngForward, which is Angular 1 with Angular 2 syntax.

Re: Angular 2 Beta released

#266

Earlier quoted context omitted.

> ReactJS has slaughtered the front-end market share (in a good way) and completely taken develo Do you have a citation for that? I still see tons of user land projects using angular 1.

I just checked Datanyze which crawls the Alexa 1m and more to see which services & libraries websites are using. They've detected 234,003 sites using Angular and 2,069 using React.

Similartech shows 13,390 websites using React and 248,280 websites using Angular

Re: Angular 2 Beta released

#267

Earlier quoted context omitted.

I just checked Datanyze which crawls the Alexa 1m and more to see which services & libraries websites are using. They've detected 234,003 sites using Angular and 2,069 using React.

I'd love to see those numbers for Ember, Polymer, Backbone and Aurelia.

according to similartech 927 websites using Ember and 139,844 websites using Backbone

Re: Angular 2 Beta released

#268
post #260

Earlier quoted context omitted.

This would be amazing, I hope I catch it. What's your blog's url just in case?

I don't have one yet, this will be the inaugural post! But I am on twitter @tomduncalf, so if you want you can follow me and I will tweet you when it's out. This is good, it puts pressure on me to actually write it ;)

Done, pressure is on!

Re: Angular 2 Beta released

#269

Angular size really impressive: angular2.min.js - 568K Version 1.4.* angular.min.js - 148K File size really increased (Angular1 * 4 == Angular2), if compared with first version. Something went wrong.

As pointed out in the blog post shaving off bytes is one of the priorities before 1.0 release. We've got many tricks to play here, so expect those numbers to be much lower in the final release.

What about the other dependencies?

Angular 1 is a fully fledged framework, you can use it on it's own, but 2 seems to depend on rxjs, and it's also bigger.

To me that seems like a step backwards.

Re: Angular 2 Beta released

#270

Earlier quoted context omitted.

Care to share your setup? I.e. minimal todo-like application with both direct development and with compilation for production site.

Give me a few hours, I'll strip some stuff out.

Don't spent to much time on it, because it will be deprecated in few years. :-)
Post reply on HN