From 724b4e1a9062191998f087d130571cf755a0ba08 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Thu, 3 Mar 2016 23:44:48 -0500 Subject: [PATCH] Add fetch polyfill for use in all supported browsers Additionally fix a bug in bower2buck.py where it would bail when a license is not specified in a Bower package info response. [1] http://caniuse.com/#feat=fetch [2] http://github.github.io/fetch/ Change-Id: Ibf754aab98bab6e34b7a9fb5d6c9801bb612f5d5 --- lib/BUCK | 1 + lib/LICENSE-fetch | 20 ++++++++++++++++++++ lib/js/BUCK | 8 ++++++++ polygerrit-ui/BUCK | 2 ++ tools/js/bower2buck.py | 2 +- 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lib/LICENSE-fetch diff --git a/lib/BUCK b/lib/BUCK index 97c26f3ded..8bf12af443 100644 --- a/lib/BUCK +++ b/lib/BUCK @@ -10,6 +10,7 @@ define_license(name = 'CC-BY3.0') define_license(name = 'clippy') define_license(name = 'codemirror') define_license(name = 'diffy') +define_license(name = 'fetch') define_license(name = 'h2') define_license(name = 'jgit') define_license(name = 'jsch') diff --git a/lib/LICENSE-fetch b/lib/LICENSE-fetch new file mode 100644 index 0000000000..0e319d55dd --- /dev/null +++ b/lib/LICENSE-fetch @@ -0,0 +1,20 @@ +Copyright (c) 2014-2016 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/js/BUCK b/lib/js/BUCK index 6ff5fffe06..56d09b67fd 100644 --- a/lib/js/BUCK +++ b/lib/js/BUCK @@ -75,6 +75,14 @@ npm_binary( # Use the same procedure as for adding dependencies, except just change the # version number of the existing bower_component rather than adding a new rule. +bower_component( + name = 'fetch', + package = 'fetch', + version = '0.11.0', + license = 'fetch', + sha1 = 'a55d4e291821958d9d400bb3184c12bb367dc670', +) + bower_component( name = 'font-roboto', package = 'polymerelements/font-roboto', diff --git a/polygerrit-ui/BUCK b/polygerrit-ui/BUCK index 4d5702ea17..0a562f9329 100644 --- a/polygerrit-ui/BUCK +++ b/polygerrit-ui/BUCK @@ -3,6 +3,7 @@ include_defs('//lib/js.defs') bower_components( name = 'polygerrit_components', deps = [ + '//lib/js:fetch', '//lib/js:iron-ajax', '//lib/js:iron-autogrow-textarea', '//lib/js:iron-dropdown', @@ -11,5 +12,6 @@ bower_components( '//lib/js:iron-selector', '//lib/js:page', '//lib/js:polymer', + '//lib/js:promise-polyfill', ], ) diff --git a/tools/js/bower2buck.py b/tools/js/bower2buck.py index 31c6dfe2ce..81072da787 100755 --- a/tools/js/bower2buck.py +++ b/tools/js/bower2buck.py @@ -77,7 +77,7 @@ class Rule(object): self.name = bower_json['name'] self.version = bower_json['version'] self.deps = bower_json.get('dependencies', {}) - self.license = bower_json['license'] + self.license = bower_json.get('license', 'NO LICENSE') self.sha1 = util.hash_bower_component( hashlib.sha1(), os.path.dirname(bower_json_path)).hexdigest()