-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [npm] upgrade babel The upgrade to babel 6 requires an upgrade to all of the associated modules, which meant that a few other things changed at the same time. The most notable is the way that we handle our babel-options, which is now done with an npm module and includes using the babel-loader's "presets" query string param. This meant changes to the babel_options.js module and extending it to help setting up the "babel-register" module, which was previously copy-pasted in several places. * [mtodules] upgrade to support babel6 module semantics * [eslint] fix lint errors * [babel] ignoer massive fixture files * [cli/errors] use Object.setPrototypeOf since subclassing Error is broken * [babel] Upgrading core babel libraries [babel] Use WIP babel-6-fix branch of babel-preset-kibana * Fix broken test * [babel] Reverse unnecessary module.exports changes * Fix notifier * Use babel presets and plugins directly * [babel/options] resolve preset/plugins paths for better plugin compatibility * [babel/options] use babel-preset-env for correct node settings * [babel] cache babel compilation in webpack like we thought we were
- Loading branch information
1 parent
f2da2a3
commit 8b4c052
Showing
40 changed files
with
242 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ config/* | |
coverage | ||
selenium | ||
.babelcache.json | ||
.webpack.babelcache | ||
*.swp | ||
*.swo | ||
*.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
// load the babel options seperately so that they can modify the process.env | ||
// before calling babel/register | ||
const babelOptions = require('../optimize/babel_options').node; | ||
require('babel/register')(babelOptions); | ||
require('../optimize/babel/register'); | ||
require('./cli'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
// load the babel options seperately so that they can modify the process.env | ||
// before calling babel/register | ||
const babelOptions = require('../optimize/babel_options').node; | ||
require('babel/register')(babelOptions); | ||
require('../optimize/babel/register'); | ||
require('./cli'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
export class UnsupportedProtocolError extends Error {} | ||
export function UnsupportedProtocolError() { | ||
Error.call(this, 'Unsupported protocol'); | ||
} | ||
|
||
UnsupportedProtocolError.prototype = Object.create(Error.prototype); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 14 additions & 6 deletions
20
src/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import visTypes from 'ui/registry/vis_types'; | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/histogram')); | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/line')); | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/pie')); | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/area')); | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/tile_map')); | ||
visTypes.register(require('plugins/kbn_vislib_vis_types/heatmap')); | ||
|
||
import histogramVisTypeProvider from 'plugins/kbn_vislib_vis_types/histogram'; | ||
import lineVisTypeProvider from 'plugins/kbn_vislib_vis_types/line'; | ||
import pieVisTypeProvider from 'plugins/kbn_vislib_vis_types/pie'; | ||
import areaVisTypeProvider from 'plugins/kbn_vislib_vis_types/area'; | ||
import tileMapVisTypeProvider from 'plugins/kbn_vislib_vis_types/tile_map'; | ||
import heatmapVisTypeProvider from 'plugins/kbn_vislib_vis_types/heatmap'; | ||
|
||
visTypes.register(histogramVisTypeProvider); | ||
visTypes.register(lineVisTypeProvider); | ||
visTypes.register(pieVisTypeProvider); | ||
visTypes.register(areaVisTypeProvider); | ||
visTypes.register(tileMapVisTypeProvider); | ||
visTypes.register(heatmapVisTypeProvider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
root: true | ||
env: | ||
es6: true | ||
node: true | ||
rules: | ||
no-undef: error | ||
quotes: [error, single] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// this file is not transpiled in dev | ||
|
||
const env = process.env; | ||
const fromRoot = require('path').resolve.bind(null, __dirname, '../../../'); | ||
|
||
if (!env.BABEL_CACHE_PATH) { | ||
env.BABEL_CACHE_PATH = fromRoot('optimize/.babelcache.json'); | ||
} | ||
|
||
exports.webpackCacheDir = env.WEBPACK_BABEL_CACHE_DIR || fromRoot('optimize/.webpack.babelcache'); | ||
|
||
exports.nodePresets = [ | ||
[ | ||
require.resolve('babel-preset-env'), | ||
{ | ||
targets: { | ||
node: 'current' | ||
} | ||
} | ||
], | ||
require.resolve('babel-preset-stage-1'), | ||
]; | ||
|
||
exports.webpackPresets = [ | ||
[ | ||
require.resolve('babel-preset-env'), | ||
{ | ||
targets: { | ||
browsers: [ | ||
'last 2 versions', | ||
'> 5%', | ||
'Safari 7' // for PhantomJS support | ||
] | ||
} | ||
} | ||
], | ||
require.resolve('babel-preset-stage-1'), | ||
require.resolve('babel-preset-react'), | ||
] | ||
|
||
exports.plugins = [ | ||
require.resolve('babel-plugin-add-module-exports'), | ||
]; | ||
|
||
exports.devIgnore = [ | ||
/[\\\/](node_modules|bower_components)[\\\/]/ | ||
] | ||
|
||
exports.buildIgnore = [ | ||
fromRoot('src'), | ||
...exports.devIgnore | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { | ||
nodePresets, | ||
webpackPresets, | ||
plugins, | ||
buildIgnore | ||
} = require('./helpers'); | ||
|
||
exports.webpack = { | ||
presets: webpackPresets, | ||
plugins: plugins | ||
}; | ||
exports.node = { | ||
presets: nodePresets, | ||
plugins, | ||
ignore: buildIgnore | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// this file is not transpiled in dev | ||
|
||
const { | ||
nodePresets, | ||
webpackPresets, | ||
webpackCacheDir, | ||
plugins, | ||
devIgnore | ||
} = require('./helpers'); | ||
|
||
exports.webpack = { | ||
cacheDirectory: webpackCacheDir, | ||
presets: webpackPresets, | ||
plugins: plugins | ||
}; | ||
exports.node = { | ||
presets: nodePresets, | ||
plugins, | ||
ignore: devIgnore | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// this file is not transpiled in dev | ||
|
||
require('babel-polyfill'); | ||
require('babel-register')(require('./options').node); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.