diff --git a/Gruntfile.js b/Gruntfile.js index d5903f9a36d147..1687156e788f10 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,4 @@ -require('./src/optimize/babel/register'); +require('./src/babel-register'); module.exports = function (grunt) { // set the config once before calling load-grunt-config diff --git a/docs/index-shared2.asciidoc b/docs/index-shared2.asciidoc index 7375432906a0df..5c324bdf8d49d8 100644 --- a/docs/index-shared2.asciidoc +++ b/docs/index-shared2.asciidoc @@ -1,12 +1,2 @@ include::migration.asciidoc[] - -include::getting-started.asciidoc[] - -include::discover.asciidoc[] - -include::visualize.asciidoc[] - -include::dashboard.asciidoc[] - -include::timelion.asciidoc[] diff --git a/docs/index-shared3.asciidoc b/docs/index-shared3.asciidoc index 5b8e8ae130eb40..1543177752d0ea 100644 --- a/docs/index-shared3.asciidoc +++ b/docs/index-shared3.asciidoc @@ -1,11 +1,11 @@ -[[devtools-kibana]] -= Dev Tools -[partintro] --- -The *Dev Tools* page contains development tools that you can use to interact -with your data in Kibana. --- +include::getting-started.asciidoc[] -include::console.asciidoc[] +include::discover.asciidoc[] + +include::visualize.asciidoc[] + +include::dashboard.asciidoc[] + +include::timelion.asciidoc[] diff --git a/docs/index-shared4.asciidoc b/docs/index-shared4.asciidoc index d448bb691c99c0..5b8e8ae130eb40 100644 --- a/docs/index-shared4.asciidoc +++ b/docs/index-shared4.asciidoc @@ -1,2 +1,11 @@ -include::management.asciidoc[] +[[devtools-kibana]] += Dev Tools + +[partintro] +-- +The *Dev Tools* page contains development tools that you can use to interact +with your data in Kibana. +-- + +include::console.asciidoc[] diff --git a/docs/index-shared5.asciidoc b/docs/index-shared5.asciidoc index 9e1931a2148f7e..d448bb691c99c0 100644 --- a/docs/index-shared5.asciidoc +++ b/docs/index-shared5.asciidoc @@ -1,8 +1,2 @@ -include::plugins.asciidoc[] - -include::development.asciidoc[] - -include::limitations.asciidoc[] - -include::release-notes.asciidoc[] +include::management.asciidoc[] diff --git a/docs/index-shared6.asciidoc b/docs/index-shared6.asciidoc new file mode 100644 index 00000000000000..9e1931a2148f7e --- /dev/null +++ b/docs/index-shared6.asciidoc @@ -0,0 +1,8 @@ + +include::plugins.asciidoc[] + +include::development.asciidoc[] + +include::limitations.asciidoc[] + +include::release-notes.asciidoc[] diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 8fd05249f9f909..2f39bfc2928301 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -6,3 +6,4 @@ include::index-shared2.asciidoc[] include::index-shared3.asciidoc[] include::index-shared4.asciidoc[] include::index-shared5.asciidoc[] +include::index-shared6.asciidoc[] diff --git a/docs/plugins/known-plugins.asciidoc b/docs/plugins/known-plugins.asciidoc index 230356461f0506..8dafee004aaf14 100644 --- a/docs/plugins/known-plugins.asciidoc +++ b/docs/plugins/known-plugins.asciidoc @@ -30,6 +30,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea * https://github.com/mstoyano/kbn_c3js_vis[C3JS Visualizations] (mstoyano) * https://github.com/elo7/cohort[Cohort analysis] (elo7) * https://github.com/DeanF/health_metric_vis[Colored Metric Visualization] (deanf) +* https://github.com/JuanCarniglia/dendrogram_vis[Dendrogram] (JuanCarniglia) * https://github.com/dlumbrer/kbn_dotplot[Dotplot] (dlumbrer) * https://github.com/nreese/enhanced_tilemap[Enhanced Tilemap] (nreese) * https://github.com/ommsolutions/kibana_ext_metrics_vis[Extended Metric] (ommsolutions) @@ -48,6 +49,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea [float] === Other * https://github.com/nreese/kibana-time-plugin[Time picker as a dashboard panel] Widget to view and edit the time range from within dashboards. +* https://github.com/sw-jung/kibana_notification_center[Notification Center] - for better experience of notifier toasts. * https://github.com/Webiks/kibana-API.git[Kibana-API] (webiks) Exposes an API with Kibana functionality. Use it to create, edit and embed visualizations, and also to search inside an embedded dashboard. diff --git a/docs/release-notes.asciidoc b/docs/release-notes.asciidoc index bd3b2ce7b5c608..701d7443aafe1d 100644 --- a/docs/release-notes.asciidoc +++ b/docs/release-notes.asciidoc @@ -7,6 +7,10 @@ This section summarizes the changes in each release. * <> * <> +ifdef::include-xpack[] +* <> +endif::include-xpack[] + -- include::release-notes/6.0.0-alpha2.asciidoc[] diff --git a/package.json b/package.json index d826d89a431259..5556714e06234f 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "ansicolors": "0.3.2", "autoprefixer": "6.5.4", "autoprefixer-loader": "2.0.0", - "babel-cli": "6.18.0", "babel-core": "6.21.0", "babel-jest": "21.0.0", "babel-loader": "6.2.10", @@ -97,6 +96,7 @@ "babel-plugin-styled-components": "1.2.0", "babel-plugin-transform-async-generator-functions": "6.24.1", "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-define": "1.3.0", "babel-plugin-transform-object-rest-spread": "6.23.0", "babel-polyfill": "6.20.0", "babel-preset-env": "1.4.0", @@ -173,11 +173,12 @@ "react-color": "2.11.7", "react-dom": "15.6.1", "react-input-autosize": "1.1.0", + "react-input-range": "1.2.1", "react-markdown": "2.4.2", "react-redux": "4.4.5", "react-router": "2.0.0", "react-router-redux": "4.0.4", - "react-select": "1.0.0-rc.1", + "react-select": "1.0.0-rc.5", "react-sortable": "1.1.0", "react-test-renderer": "15.6.1", "react-toggle": "3.0.1", @@ -216,7 +217,7 @@ "chance": "1.0.6", "cheerio": "0.22.0", "chokidar": "1.6.0", - "chromedriver": "2.29.0", + "chromedriver": "2.32.3", "classnames": "2.2.5", "enzyme": "2.9.1", "enzyme-to-json": "1.4.5", diff --git a/scripts/README.md b/scripts/README.md index 450ee6679c38ff..6ce2fdace69620 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -10,7 +10,7 @@ node scripts/{{script name}} --help This directory is excluded from the build and tools within it should help users discover their capabilities. Each script in this directory must: -- include the `../src/optimize/babel/register` module to bootstrap babel +- require `src/babel-register` to bootstrap babel - call out to source code that is in the `src` directory - react to the `--help` flag - run everywhere OR check and fail fast when a required OS or toolchain is not available \ No newline at end of file diff --git a/scripts/docs.js b/scripts/docs.js index e4f9b0a6eaadac..7d7d262c6c8a74 100644 --- a/scripts/docs.js +++ b/scripts/docs.js @@ -1,2 +1,2 @@ -require('../src/optimize/babel/register'); +require('../src/babel-register'); require('../src/docs/cli'); diff --git a/scripts/es_archiver.js b/scripts/es_archiver.js index dd17a90e254724..7b8674fbb33b61 100755 --- a/scripts/es_archiver.js +++ b/scripts/es_archiver.js @@ -1,2 +1,2 @@ -require('../src/optimize/babel/register'); +require('../src/babel-register'); require('../src/es_archiver/cli'); diff --git a/scripts/functional_test_runner.js b/scripts/functional_test_runner.js index e6b555b449f1dd..003b50d58f7820 100644 --- a/scripts/functional_test_runner.js +++ b/scripts/functional_test_runner.js @@ -1,2 +1,2 @@ -require('../src/optimize/babel/register'); +require('../src/babel-register'); require('../src/functional_test_runner/cli'); diff --git a/scripts/jest.js b/scripts/jest.js index c59c88edb51ef9..751591ad528d38 100755 --- a/scripts/jest.js +++ b/scripts/jest.js @@ -10,6 +10,5 @@ // // See all cli options in https://facebook.github.io/jest/docs/cli.html -require('../src/optimize/babel/register'); +require('../src/babel-register'); require('../src/jest/cli'); - diff --git a/scripts/mocha.js b/scripts/mocha.js index 38a977af3e7867..6dce353b705afb 100644 --- a/scripts/mocha.js +++ b/scripts/mocha.js @@ -1,2 +1,2 @@ -require('../src/optimize/babel/register'); +require('../src/babel-register'); require('../test/scripts/run_mocha'); diff --git a/src/babel-preset/common.js b/src/babel-preset/common.js new file mode 100644 index 00000000000000..94009077d83f2c --- /dev/null +++ b/src/babel-preset/common.js @@ -0,0 +1,21 @@ +module.exports = { + presets: [ + require.resolve('babel-preset-react'), + ], + plugins: [ + require.resolve('babel-plugin-styled-components'), + require.resolve('babel-plugin-add-module-exports'), + + // stage 3 + require.resolve('babel-plugin-transform-async-generator-functions'), + require.resolve('babel-plugin-transform-object-rest-spread'), + + // the class properties proposal was merged with the private fields proposal + // into the "class fields" proposal. Babel doesn't support this combined + // proposal yet, which includes private field, so this transform is + // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 + // + // See https://github.com/babel/proposals/issues/12 for progress + require.resolve('babel-plugin-transform-class-properties'), + ], +}; diff --git a/src/babel-preset/node.js b/src/babel-preset/node.js new file mode 100644 index 00000000000000..ad56ffd4797809 --- /dev/null +++ b/src/babel-preset/node.js @@ -0,0 +1,31 @@ +module.exports = { + presets: [ + [ + require.resolve('babel-preset-env'), + { + targets: { + // only applies the necessary transformations based on the + // current node.js processes version. For example: running + // `nvm install 8 && node ./src/cli` will run kibana in node + // version 8 and babel will stop transpiling async/await + // because they are supported in the "current" version of node + node: 'current', + }, + + // replaces `import "babel-polyfill"` with a list of require statements + // for just the polyfills that the target versions don't already supply + // on their own + useBuiltIns: true, + }, + ], + require('./common'), + ], + plugins: [ + [ + require.resolve('babel-plugin-transform-define'), + { + 'global.__BUILT_WITH_BABEL__': 'true' + } + ] + ] +}; diff --git a/src/babel-preset/webpack.js b/src/babel-preset/webpack.js new file mode 100644 index 00000000000000..071ffc1ba1ed34 --- /dev/null +++ b/src/babel-preset/webpack.js @@ -0,0 +1,18 @@ +module.exports = { + presets: [ + [ + require.resolve('babel-preset-env'), + { + targets: { + browsers: [ + 'last 2 versions', + '> 5%', + 'Safari 7', // for PhantomJS support + ], + }, + useBuiltIns: true, + }, + ], + require('./common'), + ] +}; diff --git a/src/babel-register/index.js b/src/babel-register/index.js new file mode 100644 index 00000000000000..d10546d1f98a99 --- /dev/null +++ b/src/babel-register/index.js @@ -0,0 +1,5 @@ +// register and polyfill need to happen in this +// order and in separate files. Checkout each file +// for a much more detailed explaination +require('./register'); +require('./polyfill'); diff --git a/src/babel-register/polyfill.js b/src/babel-register/polyfill.js new file mode 100644 index 00000000000000..fedca3745ba87c --- /dev/null +++ b/src/babel-register/polyfill.js @@ -0,0 +1,10 @@ +// `babel-preset-env` looks for and rewrites the following import +// statement into a list of import statements based on the polyfills +// necessary for our target environment (the current version of node) +// but since it does that during compilation, `import 'babel-polyfill'` +// must be in a file that is loaded with `require()` AFTER `babel-register` +// is configured. +// +// This is why we have this single statement in it's own file and require +// it from ./index.js +import 'babel-polyfill'; diff --git a/src/babel-register/register.js b/src/babel-register/register.js new file mode 100644 index 00000000000000..37bf31b713cb28 --- /dev/null +++ b/src/babel-register/register.js @@ -0,0 +1,34 @@ +const { resolve } = require('path'); + +// this must happen before `require('babel-register')` and can't be changed +// once the module has been loaded +if (!process.env.BABEL_CACHE_PATH) { + process.env.BABEL_CACHE_PATH = resolve(__dirname, '../../optimize/.babelcache.json'); +} + +// paths that babel-register should ignore +const ignore = [ + /[\\\/](node_modules|bower_components)[\\\/]/, +]; + +if (global.__BUILT_WITH_BABEL__) { + // when building the Kibana source we replace the statement + // `global.__BUILT_WITH_BABEL__` with the value `true` so that + // when babel-register is required for the first time by users + // it will exclude kibana's `src` directory. + // + // We still need babel-register for plugins though, we've been + // building their server code at require-time since version 4.2 + // TODO: the plugin install process could transpile plugin server code... + ignore.push(resolve(__dirname, '../../src')); +} + +// modifies all future calls to require() to automatically +// compile the required source with babel +require('babel-register')({ + ignore, + babelrc: false, + presets: [ + require.resolve('../babel-preset/node') + ], +}); diff --git a/src/cli/index.js b/src/cli/index.js index 0ce69ac7b06758..d5b8a863770511 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,2 +1,2 @@ -require('../optimize/babel/register'); +require('../babel-register'); require('./cli'); diff --git a/src/cli_plugin/index.js b/src/cli_plugin/index.js index 0ce69ac7b06758..d5b8a863770511 100644 --- a/src/cli_plugin/index.js +++ b/src/cli_plugin/index.js @@ -1,2 +1,2 @@ -require('../optimize/babel/register'); +require('../babel-register'); require('./cli'); diff --git a/src/core_plugins/console/public/index.html b/src/core_plugins/console/public/index.html index 6ea1009642ad6c..cb751ebae14ab3 100644 --- a/src/core_plugins/console/public/index.html +++ b/src/core_plugins/console/public/index.html @@ -5,7 +5,6 @@