Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Closure annotations - STALE! #1951

Closed
wants to merge 4 commits into from

Conversation

IgorMinar
Copy link
Contributor

ready for review.. only minor polish remains

this PR adds and corrects closure annotations and turns on compiler flags so that we get basic type checking during compilation of angular.js

@IgorMinar
Copy link
Contributor Author

btw use rake mm to compile angular.mmin.js without angular.js concatination before compilation

bind: function bindFn(element, type, fn){
var events = JQLiteExpandoStore(element, 'events'),
handle = JQLiteExpandoStore(element, 'handle');
removeData: /** @type {function():!JQLite} */(JQLiteRemoveData),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IgorMinar - why are all these functions wrapped in parentheses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I'm doing a cast here. all of these functions take one extra argument (element) which is curried before the function is exposed as public api. This meta-programming confuses the closure compiler, so I had to resort to this cast.

currently only for angular.js, more to come
This change resolves all warnings found by the closure compiler
when verbose mode is turned on and all the other flags remain at defaults.

Part of this commit contains code contributed by Ben McCann via PR angular#1710.
@lynaghk
Copy link

lynaghk commented Apr 4, 2013

For what it's worth, we're very interested to be able to fit Angular.js into our existing Closure-based toolchain as well.

@benmccann
Copy link
Contributor

would really love to see this make its way in!

@davisford
Copy link

@benmccann do you know what the status is for getting closure compiler to work with advanced optimizations? We're using angular-1.4.4 without advanced optimizations which seems to work ok, but would like advanced optimizations

@benmccann
Copy link
Contributor

@IgorMinar is there anything we can do to help get this in? perhaps it would be an easier change to submit if we broke it up into smaller changes? or do you still plan on merging this?

@IgorMinar
Copy link
Contributor Author

I hit a hiccup with our end-to-end tests failing due to unknown reasons after we created the build in this way and I didn't have time to look into it since. I plan on resurrecting this PR in the next few days.

@benmccann
Copy link
Contributor

The Closure compiler is now at a newer version than the one used in this CL:
https://github.com/angular/ng-closure-runner/blob/master/build.gradle

@IgorMinar
Copy link
Contributor Author

it's very unlikely that we'll merge this in at this point. when considering the change required vs benefits to people using angular it doesn't make sense.

I know that there is a few people that would welcome this change but it's a small minority and for those our externs solution works "well enough" (I know it's not ideal).

closing.

@IgorMinar IgorMinar closed this Apr 4, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants