What are some large AngularJS projects that have been launched? I could only find Google DoubleClick and YouTube's PS3 interface. http://builtwith.angularjs.org/
I have a feeling AngularJS is the type of framework the will be used often for inside-the-firewall type of corporate apps than public facing consumer web stuff. But this is just my hunch right now and is influenced by my past building these style apps with Adobe Flex.
Have you built anything with AngularJS? I've built apps in both Flex and AngularJS, and to me AngularJS is a very different beast, and a much better beast. Unlike Flex, AngularJS: does not provide a UI component library, has a first-class runtime environment (that is growing, not shrinking), integrates into existing websites (rather than sitting inside them as black boxes), brings an MV* way of thinking with it (Flex had MV* options, but only 3rd party add-ons), and finally (this is purely a personal one), is a joy to code with (I love AS3, but I found Flex to be clunky)
I'd be willing to bet that AngularJS will be hugely successful, and will gain a significant share of the Single-Page-App market.
Yeup, i've worked with both and a lot, and with Flex back in the day (I co-authored a big publisher book on the topic).
I'm not saying Angular/Flex is the same beast. I'm saying that one of market segments that is going to find it most useful is the same people who were looking at Flex to solve problems back in 2006/07. Naturally, technology has progressed quite a bit since Flex came out. For a JS library, Angular hits a pretty good sweet spot for those same large dev teams looking to build native browser-based apps.
Yes, I'd agree that both solve the "large dev teams looking to build native browser-based apps". But I think the difference is that Flex was reasonably good at it, but was very effectively sold into the enterprise by Adobe. Hence it did well in the enterprise, but not great outside.
By contrast, AngularJs is not being sold into the enterprise by anyone (yet?), and is, IMO, better at solving those problems.
Hence my prediction: unlike Flex, AngularJS will gain market share in single-page-apps outside the firewall, as well as inside the firewall.
I'm not sure what you're comparing this to but 9,000 lines of well-written code in a powerful MVC framework is a very significant size.
Because there is so little boiler-plate code that is being written, the utility-density of such a codebase can be extraordinarily high. 9,000 lines of PHP could amount to very little utility but when well-architected, there is a crazy amount that can be done with even 2,000 lines of a framework such as Angular or Rails.
[EDIT]
The point I'm making is that a good developer working in harmony with a framework can do in 4 very readable lines what a less experienced developer might easily expand to 60 lines. As such dismissing a 15k codebase as "small" is somewhat naive. A 15k Angular app can do a vast amount.
My experience with Rails (and my limited experience with Angular suggests it's similar) is that working harmoniously with the framework gives you massive amounts of utility with very, very few lines of code. I've personally refactored 100 line controllers from junior developers down to 12 lines. It might feel macho to compare codebase sizes but there's no strong coupling to utility (arguably perhaps the reverse).
You can certainly write 60k apps in Rails, Angular or Django but dismissing a 15k app as "small" doesn't do justice to the utility that even such a "small" codebase can deliver.
...sorry this comment was so long I didn't have time to write a short one ;)
Example: I'm working on a "large" CakePHP application (similar to Rails) with 24,000 lines of our own code, 57,000 lines of code from community plugins, and 240,000 lines of core framework code.
That does include all of their unit tests code though. I wouldn't personally define unit tests as "core" framework code since I can deploy a Rails app without them (they never show up in a stack trace). It's going to come down to your own semantics since Rails wouldn't exist as it is today without them either.
Ahhh, you know what? I just realized I was confused: the diff for rails 4 was about +110,000 / -100,000, that's what I'm remembering that number from. My bad!
If you are saying the size of your application could be reduced by rewriting it to using a framework (an existing one or one of your own creation), I think this is the point we are all trying to make here.
Assuming one uses all the features of a framework, the total complexity of my 24K line framework application (counting only code I've written) could be compared to that of a 321K line non-framework application (counting all the code in my project).
Thankfully I only have to write/maintain 8% of the codebase, as the remaining 92% is kept up-to-date by typing `composer update` on a weekly basis.
In this case, simply refactoring to remove duplication would probably work. For example there are at least 3 different ways to send email.
There is a lot of code in there that is really "framework" but it's completely baked into everything else so not really separable. There's probably at least 2 different and distinct attempts at creating a framework, and you can tell the age of the code by which it uses.
The main reason it hasn't been significantly refactored is that it is astonishingly reliable considering how bad the code is.
The small team I am on just re-wrote a number of different apps written by 3rd parties that were 20/30k and got them down to ~3k -- mainly by throwing out all their library junk and just doing things right in AngularJS.
Currently our AngularJS application is 20k lines (between controllers, directives, services, and templates) and it certainly feels like a large application -- not when working on it, but when using it. AngularJS makes it very easy to build quite "large" (in the complexity/richness sense) applications with much less code than most other approaches, in my experiences.
Of course, if we are treating size as absolute, and basing it on lines of code, then 9k is pretty small. I mean linux has like 15m lines! It will take a while to catch up.
Our largest Angular app currently has a 2500 line controllers.js file. There are about 20 controllers in this file. I've thought about splitting it up into multiple files, and I think I'm going to do that.
However, right now it works quite well since I'm using "editor folds" to separate each controller.
Would be interesting to hear if you discovered any downsides to Angular. I've been working with it a lot lately, but it seems to be a really good solution and the only issues with it is it can be hard to set up to be compatible with googlebot and the slightly tough learning curve
We didn't look at all at SEO since it's our customer dashboard, we don't really care about it.
Here's the few downsides of Angular IMO :
- I'm particularly unhappy with the router, it does a good job but as soon as you start to have nested routes and complex layout, it you want to avoid copy-pasting the same bits of code everywhere it becomes a nightmare. We mitigated most of these issues by using a lot of directives but it doesn't solve the problem entirely. We looked at ui-router at some point but weren't totally satisfied by the way it worked. Maybe we should take another look.
- errors are sometimes very obscure, it can be hard to debug, even if at some point you start to recognize some errors and know where to look first
- docs could be better
There are some other glitches here and there but most of the time Angular is a real pleasure to use, it's by far the best front-end framework I've worked with.
SEO is the most annoying. You end up writing server side templates to mimic the client side templates just for the spiders benefits. Not a unique angular problem.
Great article but 9K lines of code isn't that large, it is probably medium size.
For example, http://Clara.io, our 3D design as a service offering, is already 52K LOC in just our core and that excludes the 30K LOC of external libraries.
Thanks a lot for mentioning this - I was about to have to dive into setting up a build for an Angular app I'm working on (which I need to learn eventually, just not right now) so that project really helps.
Can anyone comment from experience on the testability of Angular.js, that is mentioned in the article? Was it a reason to chose Angular.js over some other framework (if so, which framework)?
We specifically looked at CanJS, Backbone and EmberJS. None of which have testability as a core feature. CanJS and Backbone barely mention how to do it, EmberJS has one tiny page on integration testing. Which practically means there isn't a established right way to do testing. And you as a developer need to figure it all out.
I personally think ember has the best testability story for both unit and integration testing. The screencast below shows how to get started with ember / QUnit and karma
Angular's dependency on the DOM for rendering will always make testing it very difficult. This will continue their move towards feature based testing. Feature tests have their use, but they do not scale and provide the least useful insight into why something is failing. They are also notoriously slow, so once you have a large test suite, it can easily take 20 minutes or more for feedback. I have worked with feature based test suites that take 2 hours to run. It wasn't fun.
Looks like you missed the following line in the article
> Angular.js is built from the ground up with testing in mind. In our opinion this makes Angular different from all other frameworks out there. It is the reason we chose it.
"Replacing Rails" seems silly. You can enable the asset pipeline in development if you really want. But most people would rather deal with slower page loads in development rather than debugging minified/uglified javascript in the console.
It's not an either / or option. Yeoman handles serving unminified files during dev just fine and compiles / concatenates them for production. You can do everything the rails asset pipeline does and more with grunt. Yeoman comes with a default configuration to do just that. http://yeoman.io/
For dev / early testing I've just been using yeoman + grunt-connect-proxy with grunt spitting the final build files into the rails public directory to make it easy to push up to heroku. In final production you'd probably want to send your static assets to a cdn but that is easy enough.
Not to downplay the Ermahgerd Translator! http://ermahgerd.jmillerdesign.com/#!/translate