-
Notifications
You must be signed in to change notification settings - Fork 26
Output Closure annotations when --closure #286
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
53f6327
to
b2b6067
Compare
Really nice work. CC @vsmenon and @leafpetersen for additional thoughts. Main thing I'm wondering is what to do about precompiled SDK JS files. I don't think we want those to use I guess we have a related problem with hand coded libraries. They turned out to be a lot bigger than I was expecting. Since we haven't used the Anyway, maybe we can discuss this further here or have a design meeting offline. Cheers, - John |
4f0bcf2
to
906fff0
Compare
Hey John, I've added a bit of tests + dropped the I don't have an answer for hard coded libraries, except that... what prevents us from writing them in Dart? (maybe some annotation could trigger a dart:js pass-through mode, which would allow to express near-complete JS semantics?). |
CC @vsmenon @leafpetersen for thoughts? The dart2js style is to have them in a private The context here: if we have multiple output modes (ES6, Closure, TypeScript, maybe something else in the future? also different JS module systems) it might be easier to maintain our runtime helpers if they're in a Dart library vs a .js file. |
@@ -0,0 +1,127 @@ | |||
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2015 in the various new files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, done.
this LGTM 👍 ... @leafpetersen would you be interested in reviewing the type annotation code? |
aside: this is really great looking code! I really like how it reads and is factored |
67734f7
to
3760837
Compare
Thanks a lot John! |
import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | ||
|
||
/// Mixin that can generate [ClosureAnnotation]s for Dart elements and types. | ||
abstract class ClosureCodegen { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: ClosureCodegen -> ClosureAnnotator ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
e58a5f9
to
7e3c472
Compare
7e3c472
to
7d3c0b0
Compare
LGTM. |
Output Closure annotations when --closure (very experimental feature)
No description provided.