-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Closure Tools dependencies and add arguments to closure_js_binary() #910
Conversation
Update Closure Compiler to v20160208 Update Closure Library to v20160208 Update Closure Stylesheets to 1.1.0
Looks good for me, I would like @kamalmarhubi to have a look too |
Ooops I ping the wrong person, that @kjiwa that I wanted to have a look at this PR |
@@ -46,6 +48,21 @@ _COMPILATION_LEVELS = { | |||
"advanced": ["--compilation_level=ADVANCED"] | |||
} | |||
|
|||
_LANGUAGE_LEVELS = { |
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.
Nit: These aren't "levels". How about naming it _LANGUAGES _SUPPORTED_LANGUAGES?
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. I guess you meant _SUPPORTED_LANGUAGES
?
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.
I meant to put an "or" between the two suggestions. :-/
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.
I see :)
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.
Kamil: if you can merge it, would be awesome :)
On Wed, Feb 17, 2016 at 10:13 PM Michael Zhou notifications@github.com
wrote:
In tools/build_rules/closure/closure_js_binary.bzl
#910 (comment):@@ -46,6 +48,21 @@ _COMPILATION_LEVELS = {
"advanced": ["--compilation_level=ADVANCED"]
}+_LANGUAGE_LEVELS = {
I see :)
—
Reply to this email directly or view it on GitHub
https://github.com/bazelbuild/bazel/pull/910/files#r53232161.
Looks great. Thank you for the change. I just had a minor nitpick about the naming of your constant. If you don't mind updating that I'll be glad to LGTM your pull request. |
With these flags users can transpile their closure_js_binary() from ES6 to ES3. Change "--manage_closure_dependencies" to "--dependency_mode=LOOSE" because the former has been deprecated in Closure Compiler v20160208.
Thanks for the update. LGTM. @damienmg Do you want to merge the request or shall I? |
Update Closure Tools dependencies and add language arguments to closure_js_binary()
Wait no! |
gosh |
Sorry I had to revert the change and it will be imported back thank for your contribution! |
@damienmg No worries. For future contributions, do you prefer GitHub PRs or your Gerrit instance at https://bazel-review.googlesource.com? |
sha256 = "e4e0cb49ad21ec26dd47693bdbd48f67aefe2d94fe8d9239312d2bcc74986538", | ||
url = "http://dl.google.com/closure-compiler/compiler-20150729.zip", | ||
sha256 = "215ba5df026e5d92bda6634463a9c634d38a1aa4b6dab336da5c52e884cbde95", | ||
url = "https://dl.google.com/closure-compiler/compiler-latest.zip", |
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.
Is this safe? Wouldn't the build break if a new "latest" version is uploaded?
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.
Oh yeah, good catch. This should reference -20160208 which is the latest release I can find.
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.
I'll submit an update to this separately.
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.
Good catch. I actually thought about that but then I saw https://github.com/bazelbuild/bazel/blob/master/tools/build_rules/closure/closure_repositories.bzl#L103 :(
Since Closure Compiler releases come more often, we should not use "latest". I didn't find a versioned URL for Closure Templates though so we'd have to keep it as is for now.
@Dominator008: I prefer gerrit personally but we accept both PR and gerrit review request, it's just we don't merge with the merge button because we have to merge it on the trunk inside google |
@@ -46,6 +48,21 @@ _COMPILATION_LEVELS = { | |||
"advanced": ["--compilation_level=ADVANCED"] | |||
} | |||
|
|||
_SUPPORTED_LANGUAGES = { | |||
"es3": ["ES3"], |
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.
Why support name aliases? Why not require that users enter the canonical name documented by the Closure Compiler CLI?
--language_in VAL : Sets what language spec that input
sources conform. Options: ECMASCRIPT3,
ECMASCRIPT5, ECMASCRIPT5_STRICT,
ECMASCRIPT6 (default), ECMASCRIPT6_STR
ICT, ECMASCRIPT6_TYPED (experimental)
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.
The CLI accepts name aliases.
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.
It's undocumented behavior though. Are the Bazel devs OK with propagating undocumented (or possibly deprecated) behavior to new code?
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.
Would you mind updating the documentation / help message within Closure Compiler? :)
…ary() Update Closure Compiler to v20160208 Update Closure Library to v20160208 Update Closure Stylesheets to 1.1.0 Add "--language_in" and "--language_out" to closure_js_binary.bzl With these flags users can transpile their closure_js_binary() from ES6 to ES3. Change "--manage_closure_dependencies" to "--dependency_mode=LOOSE" because the former has been deprecated in Closure Compiler v20160208. -- Reviewed-on: #910 MOS_MIGRATED_REVID=114898222
Update Closure Compiler to v20160208
Update Closure Library to v20160208
Update Closure Stylesheets to 1.1.0
Add "--language_in" and "--language_out" to closure_js_binary.bzl
With these flags users can transpile their closure_js_binary() from
ES6 to ES3.
Change "--manage_closure_dependencies" to "--dependency_mode=LOOSE"
because the former has been deprecated in Closure Compiler v20160208.