diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-02-09 18:04:46 +0000 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-02-09 18:04:46 +0000 |
commit | 68963c8653d11c45eec40318f32ad08b8be8ef54 (patch) | |
tree | f83fb555a1c0fa50e17288dd761c0cc06be81150 | |
parent | 83b21c2401a1b0fd3f6a157503e3298e3b1d7945 (diff) | |
parent | 0a36693c92ce5ced61b68d2cb0d91694076d5d28 (diff) | |
download | gitlab-ce-68963c8653d11c45eec40318f32ad08b8be8ef54.tar.gz |
Merge branch 'upgrade-babel-v6' into 'master'
Upgrade from Babel 5 to Babel 6
See merge request !9072
-rw-r--r-- | app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 | 2 | ||||
-rw-r--r-- | changelogs/unreleased/upgrade-babel-v6.yml | 4 | ||||
-rw-r--r-- | config/dependency_decisions.yml | 6 | ||||
-rw-r--r-- | config/webpack.config.js | 6 | ||||
-rw-r--r-- | package.json | 7 | ||||
-rw-r--r-- | spec/javascripts/filtered_search/dropdown_user_spec.js.es6 | 4 |
6 files changed, 19 insertions, 10 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 index 859d6515531..e8c2df03a46 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6 @@ -4,7 +4,7 @@ class FilteredSearchDropdown { constructor(droplab, dropdown, input, filter) { this.droplab = droplab; - this.hookId = input.getAttribute('data-id'); + this.hookId = input && input.getAttribute('data-id'); this.input = input; this.filter = filter; this.dropdown = dropdown; diff --git a/changelogs/unreleased/upgrade-babel-v6.yml b/changelogs/unreleased/upgrade-babel-v6.yml new file mode 100644 index 00000000000..55f9b3e407c --- /dev/null +++ b/changelogs/unreleased/upgrade-babel-v6.yml @@ -0,0 +1,4 @@ +--- +title: upgrade babel 5.8.x to babel 6.22.x +merge_request: 9072 +author: diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index aabe859730a..54389eeb9ef 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -302,3 +302,9 @@ :why: https://github.com/dchest/tweetnacl-js/blob/master/LICENSE :versions: [] :when: 2017-01-14 20:10:57.812077000 Z +- - :approve + - wordwrap + - :who: Mike Greiling + :why: https://github.com/substack/node-wordwrap/blob/0.0.3/LICENSE + :versions: [] + :when: 2017-02-08 20:17:13.084968000 Z diff --git a/config/webpack.config.js b/config/webpack.config.js index 968c0076eaf..2d1a16a18dd 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -54,14 +54,12 @@ var config = { exclude: /(node_modules|vendor\/assets)/, loader: 'babel-loader', query: { - // 'use strict' was broken in sprockets-es6 due to sprockets concatination method. - // many es5 strict errors which were never caught ended up in our es6 assets as a result. - // this hack is necessary until they can be fixed. - blacklist: ['useStrict'] + presets: ['es2015', 'stage-2'] } }, { test: /\.(js|es6)$/, + exclude: /node_modules/, loader: 'imports-loader', query: 'this=>window' }, diff --git a/package.json b/package.json index a25e09e4cf2..7f1c8dd6fff 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,10 @@ "webpack-prod": "NODE_ENV=production npm run webpack" }, "dependencies": { - "babel": "^5.8.38", - "babel-core": "^5.8.38", - "babel-loader": "^5.4.2", + "babel-core": "^6.22.1", + "babel-loader": "^6.2.10", + "babel-preset-es2015": "^6.22.0", + "babel-preset-stage-2": "^6.22.0", "bootstrap-sass": "3.3.6", "compression-webpack-plugin": "^0.3.2", "d3": "3.5.11", diff --git a/spec/javascripts/filtered_search/dropdown_user_spec.js.es6 b/spec/javascripts/filtered_search/dropdown_user_spec.js.es6 index f4b0d60db34..fa9d03c8a9a 100644 --- a/spec/javascripts/filtered_search/dropdown_user_spec.js.es6 +++ b/spec/javascripts/filtered_search/dropdown_user_spec.js.es6 @@ -9,7 +9,7 @@ require('~/filtered_search/dropdown_user'); let dropdownUser; beforeEach(() => { - spyOn(gl.FilteredSearchDropdown.prototype, 'constructor').and.callFake(() => {}); + spyOn(gl.DropdownUser.prototype, 'bindEvents').and.callFake(() => {}); spyOn(gl.DropdownUser.prototype, 'getProjectId').and.callFake(() => {}); spyOn(gl.DropdownUtils, 'getSearchInput').and.callFake(() => {}); @@ -39,7 +39,7 @@ require('~/filtered_search/dropdown_user'); describe('config droplabAjaxFilter\'s endpoint', () => { beforeEach(() => { - spyOn(gl.FilteredSearchDropdown.prototype, 'constructor').and.callFake(() => {}); + spyOn(gl.DropdownUser.prototype, 'bindEvents').and.callFake(() => {}); spyOn(gl.DropdownUser.prototype, 'getProjectId').and.callFake(() => {}); }); |