pkozlowski_os
pkozlowski_os on Hacker News
Right. After you've spent 10+ man/years developing an app based on React / other lib with similar restriction. "stop using React" is fine advise for small projects that can be rewritten in few months by few people. For very large projects the cost of stop using / rewrite could be huge.
If you test currently available dead-code elimination tools for JS you will discover that there are tricks that those tools can't play, most important one being eliminating unused methods on object / classes.
AFAIK Webpack2 is using Rollup under the hood. While rollup is great and can build smaller outputs (biggest win seems to be elimination of the module system overhead) it can't perform miracles.
In short: size still matters, even with dead-code elimination tools (at least as they are today).
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.
@estsauver while I agree that it takes some time to get into contributing into a big project like Angular 2, it is simply not true that it is "Google only" project. I'm a regular contributor (#6 in terms of no of commits:
https://github.com/angular/angular/graphs/contributors) and I don't work for Google.
Angular team is bunch of great people, real pleasure to work with. I can tell you - the initial effort to start contributing pays off _very_ fast.
How many apps in the World require a specialised framework that GMail might require? 10? 100? 1000? Sure, everyone can invent their own framework to be very "specialised" and "tailored" to a given app needs but is it going to give a competitive advantage for a given app? Probably sometimes. Probably not most of the time.
Constructing your own framework has cost. Sure, you will acquire a lot of knowledge doing it, but is it going to help the bottom line? Maybe.
Once again, are you seriously advocating that _everyone_ should do "vanilla JS" without any frameworks?
Well, I believe it is a "good thing" when you believe in what you do and got arguments to back up what you believe in.
Right. I was more after examples of apps in the wild done by "average" (whatever it means) group of developers in an "average" dev shop. A group of rock-star developers will do "right thing" most of the time, regardless of the technology. The question is: can we scale this experience for majority of web applications that most developers keep on coding?
I'm yet to see a non-trivial (100+ screens, 10+ devs over 10+ months) production-level app written in "vanilla JS" without any framework (popular open-source or home-grown "monster"). You need _something_ to structure your code and take care of repetitive / boring details.
Neither Angular 2 nor 1 uses O.o for change detection. So there are no implications for ng, realy.
Right. I guess it really depends how people define "dirty checking". What I was trying to say is that at the end of the day you do diffing on some data structure: model in Angular and virtual Dom in React.
Loop vs. one pass is an important distinction, agreed. But when we bring Angular we should be noted that Angular 2 doesn't do those checks in a loop but does comparisons in one pass only.
Well, it kind of does when comparing virtual DOMs before and after changes.
Bla, bla, bal... How about showing us some great products instead?
Let's be precise - at the moment there are exactly 68 open pull requests, _one_ of them being about documentation:
https://github.com/angular/angular.js/pullsThere is a huge difference in the open source world between ranting and actually doing something about your pain-points.
And more examples like this, unfortunately... Compare buttons for another striking example...
Just 4 things for a start:
1) Size and dependencies. Let's say you want to use buttons directive. If you decide to go with angular-ui/bootstrap you will need this https://github.com/angular-ui/bootstrap/blob/master/src/butt... only - 62 LOC. If you decide to go with Strap you will need jQuery + 100 LOC of Bootstrap's JavaScript + 163 LOC of Strap's wrapper (!!!). Please note that the the wrapper itself is _longer_ than the original version. Native version is 1/3 of the size (!).
2) Customization - try to change a template for say, a typeahead. With the strap solution it is hard-coded in Bootstrap's JavaScript, no way to customize. With angular-ui/bootstrap template is here: https://github.com/angular-ui/bootstrap/blob/master/template... and is fully customizable
3) Integration with the AngularJS ecosystem - since anngular-ui/bootstrap directives are native ones they seamlessly work with all the AngularJS goodies like $q promises. This means that you can provide a promise as a source for, say, typeahead or data for modal.
4) wrapping existing jQuery plugins is not always obvious as lifecycles are really different. As the results you need to do hacks - just search Strap's code for setTimeout and $timeout to see what I mean.
At the end of the day just choose a project that works for you but we've started angular-ui effort since we believe that native AngularJS directives offer much lighter and cleaner solution.
You are right, this project has _zero_ dependency on any other external JavaScript code. Those are native AngularJS directives.
@seivan, could you elaborate on what you mean by "all the boilerplate crud"? It is hard to see what you are getting at here...
Just wanted to comment that all the directives from
http://angular-ui.github.com/bootstrap/ are native AngularJS directives. They don't require _any_ 3rd party JavaScript dependency (jQuery, bootstrap's JS etc.). Just take Angular, 5kB library (minified, gzipped) and you are ready to go!
On top of this all those directives are fully customizable as (almost) no DOM manipulation happens in directives, markup is extracted to separate templates: https://github.com/angular-ui/bootstrap/tree/master/template
Yeh, the word about
http://ngmodules.org/ should be spread, hopefully it can be a repository of links to AngularJS directives.
Well, as part of angular-ui we are building native AngularJS directives for Twitter's bootstrap:
http://angular-ui.github.com/bootstrap/Angular-strap is great but it has dependency on jQuery, bootstrap's JavaScript etc. Our goal is to come up with native, lightweight directives with minimal dependencies.
We will be moving slower but hopefully it will be useful for people that don't need / want jQuery.