r/angularjs • • Oct 07 '15

Angular 2 Preparation: Killing Controllers

http://www.codelord.net/2015/10/07/angular-2-preparation-killing-controllers/
46 Upvotes

19 comments sorted by

View all comments

0

u/[deleted] Oct 07 '15

[deleted]

8

u/[deleted] Oct 07 '15

4

u/jreborn Oct 07 '15

What he said has some merit. I see a lot of React's ideas in Angular 2 (e.g., application entirely composed of reusable components).

That being said, there is definitely a migration path, albeit an ugly one.

1

u/NotJustClarkKent Oct 07 '15

So you need to including both v1 AND v2 libraries per page? That doesn't seem right.

1

u/[deleted] Oct 07 '15

I think it's a fair trade off when you think about it.

Firstly, you should be delivering your dependencies independently of your app's source. If you use a build plugin like gulp-rev, you'll be able to tell the browser to cache everything indefinitely. This means that when you add the angular 2 dependency, it'll be the only file besides the new app source that the browser has to download -- and only once.

After that, your app's resources should load just as fast as they used to. Granted, the app will obviously use a fair bit more memory running both versions simultaneously. It also may be a bit slower during the transition period.

Regardless of these things, you'd be hard pressed to find a more seamless migration between version 1 and 2 of a library than this -- ESPECIALLY with how different they are.

That's my take on it, anyway.