Skip to content
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

Merged
merged 2 commits into from
Feb 17, 2016
Merged

Update Closure Tools dependencies and add arguments to closure_js_binary() #910

merged 2 commits into from
Feb 17, 2016

Conversation

Dominator008
Copy link
Contributor

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.

Update Closure Compiler to v20160208
Update Closure Library to v20160208
Update Closure Stylesheets to 1.1.0
@damienmg
Copy link
Contributor

Looks good for me, I would like @kamalmarhubi to have a look too

@damienmg
Copy link
Contributor

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 = {
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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. :-/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see :)

Copy link
Contributor

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.

@kjiwa
Copy link
Contributor

kjiwa commented Feb 17, 2016

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.
@kjiwa
Copy link
Contributor

kjiwa commented Feb 17, 2016

Thanks for the update. LGTM.

@damienmg Do you want to merge the request or shall I?

kjiwa added a commit that referenced this pull request Feb 17, 2016
Update Closure Tools dependencies and add language arguments to closure_js_binary()
@kjiwa kjiwa merged commit 3f70577 into bazelbuild:master Feb 17, 2016
@Dominator008 Dominator008 deleted the closure branch February 17, 2016 21:23
@damienmg
Copy link
Contributor

Wait no!

@damienmg
Copy link
Contributor

gosh

bazel-io pushed a commit that referenced this pull request Feb 17, 2016
This reverts commit 3f70577, reversing
changes made to cbbbf2e.

Accidental merge, merged pull request have to go through googlesource first
@damienmg
Copy link
Contributor

Sorry I had to revert the change and it will be imported back thank for your contribution!

@Dominator008
Copy link
Contributor Author

@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",
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@damienmg
Copy link
Contributor

@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"],
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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? :)

bazel-io pushed a commit that referenced this pull request Feb 17, 2016
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants