Skip to content

Commit

Permalink
Remove legacy optimizer (#73154)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 13, 2020
1 parent d21d100 commit 4c810be
Show file tree
Hide file tree
Showing 303 changed files with 23,623 additions and 30,328 deletions.
7 changes: 2 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ target

# plugin overrides
/src/core/lib/kbn_internal_native_observable
/src/legacy/core_plugins/console/public/tests/webpackShims
/src/legacy/core_plugins/console/public/webpackShims
/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken
/src/legacy/ui/public/flot-charts
/src/legacy/ui/public/utils/decode_geo_hash.js
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/public/_generated_/**
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/src/plugins/timelion/public/webpackShims/jquery.flot.*
/src/plugins/vis_type_timelion/public/flot/jquery.flot.*
/src/plugins/timelion/public/flot/jquery.flot.*
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/plugins/apm/e2e/**/snapshots.js
/x-pack/plugins/apm/e2e/tmp/*
Expand Down
6 changes: 2 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ module.exports = {
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['ui/**/*', 'uiExports/**/*'],
from: ['ui/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
{
Expand Down Expand Up @@ -457,14 +457,13 @@ module.exports = {
{
files: [
'**/public/**/*.js',
'**/webpackShims/**/*.js',
'packages/kbn-ui-framework/doc_site/src/**/*.js',
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
],
settings: {
// instructs import/no-extraneous-dependencies to treat certain modules
// as core modules, even if they aren't listed in package.json
'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'],
'import/core-modules': ['plugins', 'legacy/ui'],

'import/resolver': {
'@kbn/eslint-import-resolver-kibana': {
Expand Down Expand Up @@ -605,7 +604,6 @@ module.exports = {
{
files: [
'.eslintrc.js',
'**/webpackShims/**/*.js',
'packages/kbn-plugin-generator/**/*.js',
'packages/kbn-eslint-import-resolver-kibana/**/*.js',
'packages/kbn-eslint-plugin-eslint/**/*',
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ out an open PR:

- [CONTRIBUTING.md](CONTRIBUTING.md) will help you get Kibana up and running.
- If you would like to contribute code, please follow our [STYLEGUIDE.md](STYLEGUIDE.md).
- Learn more about our UI code with [UI_SYSTEMS.md](src/legacy/ui/public/UI_SYSTEMS.md).
- For all other questions, check out the [FAQ.md](FAQ.md) and
[wiki](https://github.com/elastic/kibana/wiki).

Expand Down
2 changes: 1 addition & 1 deletion STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ Do not use setters, they cause more problems than they can solve.
When writing a new component, create a sibling SASS file of the same name and import directly into the **top** of the JS/TS component file. Doing so ensures the styles are never separated or lost on import and allows for better modularization (smaller individual plugin asset footprint).
All SASS (.scss) files will automatically build with the [EUI](https://elastic.github.io/eui/#/guidelines/sass) & Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/legacy/ui/public/styles/_globals_v7light.scss).
All SASS (.scss) files will automatically build with the [EUI](https://elastic.github.io/eui/#/guidelines/sass) & Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/core/public/core_app/styles/_globals_v7light.scss).
While the styles for this component will only be loaded if the component exists on the page,
the styles **will** be global and so it is recommended to use a three letter prefix on your
Expand Down
6 changes: 0 additions & 6 deletions docs/setup/install/deb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ locations for a Debian-based system:
| /var/log/kibana
| path.logs

| optimize
| Transpiled source code. Certain administrative actions (e.g. plugin install)
result in the source code being retranspiled on the fly.
| /var/lib/kibana/optimize
d|

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/share/kibana/plugins
Expand Down
6 changes: 0 additions & 6 deletions docs/setup/install/rpm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ locations for an RPM-based system:
| /var/log/kibana
| path.logs

| optimize
| Transpiled source code. Certain administrative actions (e.g. plugin install)
result in the source code being retranspiled on the fly.
| /var/lib/kibana/optimize
d|

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| /usr/share/kibana/plugins
Expand Down
6 changes: 0 additions & 6 deletions docs/setup/install/targz.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ important data later on.
| $KIBANA_HOME\data
d|

| optimize
| Transpiled source code. Certain administrative actions (e.g. plugin install)
result in the source code being retranspiled on the fly.
| $KIBANA_HOME\data\optimize
d|

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| $KIBANA_HOME\plugins
Expand Down
6 changes: 0 additions & 6 deletions docs/setup/install/windows.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ important data later on.
| $KIBANA_HOME\data
d|

| optimize
| Transpiled source code. Certain administrative actions (e.g. plugin install)
result in the source code being retranspiled on the fly.
| $KIBANA_HOME\data\optimize
d|

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
| $KIBANA_HOME\plugins
Expand Down
24 changes: 0 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
},
"dependencies": {
"@babel/core": "^7.11.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/register": "^7.10.5",
"@elastic/apm-rum": "^5.4.0",
"@elastic/charts": "19.8.1",
Expand Down Expand Up @@ -154,20 +153,16 @@
"angular-route": "^1.8.0",
"angular-sanitize": "^1.8.0",
"angular-sortable-view": "^0.0.17",
"autoprefixer": "^9.7.4",
"babel-loader": "^8.0.6",
"bluebird": "3.5.5",
"boom": "^7.2.0",
"brace": "0.11.1",
"cache-loader": "^4.1.0",
"chalk": "^2.4.2",
"check-disk-space": "^2.1.0",
"chokidar": "3.2.1",
"color": "1.0.3",
"commander": "3.0.2",
"compare-versions": "3.5.1",
"core-js": "^3.6.4",
"css-loader": "^3.4.2",
"d3": "3.5.17",
"d3-cloud": "1.2.5",
"deep-freeze-strict": "^1.1.1",
Expand All @@ -179,7 +174,6 @@
"execa": "^4.0.2",
"expiry-js": "0.1.7",
"fast-deep-equal": "^3.1.1",
"file-loader": "4.2.0",
"font-awesome": "4.7.0",
"fp-ts": "^2.3.1",
"getos": "^3.1.0",
Expand Down Expand Up @@ -211,11 +205,9 @@
"leaflet-vega": "^0.8.6",
"leaflet.heat": "0.2.0",
"less": "npm:@elastic/less@2.7.3-kibana",
"less-loader": "5.0.0",
"lodash": "^4.17.15",
"lru-cache": "4.1.5",
"markdown-it": "^10.0.0",
"mini-css-extract-plugin": "0.8.0",
"minimatch": "^3.0.4",
"moment": "^2.24.0",
"moment-timezone": "^0.5.27",
Expand All @@ -227,12 +219,9 @@
"opn": "^5.5.0",
"oppsy": "^2.0.0",
"pegjs": "0.10.0",
"postcss-loader": "^3.0.0",
"prop-types": "15.6.0",
"proxy-from-env": "1.0.0",
"pug": "^2.0.4",
"query-string": "5.1.1",
"raw-loader": "3.1.0",
"re2": "^1.15.4",
"react": "^16.12.0",
"react-color": "^2.13.8",
Expand All @@ -258,33 +247,24 @@
"resize-observer-polyfill": "^1.5.0",
"rison-node": "1.0.2",
"rxjs": "^6.5.5",
"script-loader": "0.7.2",
"seedrandom": "^3.0.5",
"semver": "^5.5.0",
"style-it": "^2.1.3",
"style-loader": "^1.1.3",
"symbol-observable": "^1.2.0",
"tar": "4.4.13",
"terser-webpack-plugin": "^2.3.4",
"thread-loader": "^2.1.3",
"tinygradient": "0.4.3",
"tinymath": "1.2.1",
"topojson-client": "3.0.0",
"tslib": "^2.0.0",
"type-detect": "^4.0.8",
"ui-select": "0.19.8",
"url-loader": "2.2.0",
"uuid": "3.3.2",
"val-loader": "^1.1.1",
"vega": "^5.13.0",
"vega-lite": "^4.13.1",
"vega-schema-url-parser": "^1.1.0",
"vega-tooltip": "^0.12.0",
"vision": "^5.3.3",
"webpack": "^4.41.5",
"webpack-merge": "4.2.2",
"whatwg-fetch": "^3.0.0",
"wrapper-webpack-plugin": "^2.1.0",
"yauzl": "2.10.0"
},
"devDependencies": {
Expand Down Expand Up @@ -450,8 +430,6 @@
"has-ansi": "^3.0.0",
"iedriver": "^3.14.2",
"intl-messageformat-parser": "^1.4.0",
"is-path-inside": "^2.1.0",
"istanbul-instrumenter-loader": "3.0.1",
"jest": "^25.5.4",
"jest-canvas-mock": "^2.2.0",
"jest-circus": "^25.5.4",
Expand All @@ -472,14 +450,12 @@
"murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
"nock": "12.0.3",
"node-sass": "^4.13.1",
"normalize-path": "^3.0.0",
"nyc": "^15.0.1",
"pixelmatch": "^5.1.0",
"pkg-up": "^2.0.0",
"pngjs": "^3.4.0",
"postcss": "^7.0.32",
"postcss-url": "^8.0.0",
"prettier": "^2.0.5",
"proxyquire": "1.8.0",
"react-popper-tooltip": "^2.10.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^2.3.0"
"eslint-plugin-react-hooks": "^4.0.4"
}
}
4 changes: 3 additions & 1 deletion packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"babel-plugin-filter-imports": "^3.0.0",
"babel-plugin-styled-components": "^1.10.7",
"babel-plugin-transform-define": "^1.3.1",
"babel-plugin-transform-imports": "^2.0.0"
"babel-plugin-transform-imports": "^2.0.0",
"react-is": "^16.8.0",
"styled-components": "^5.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const {
getProjectRoot,
getWebpackConfig,
isFile,
isProbablyWebpackShim,
getIsPathRequest,
resolveWebpackAlias,
} = require('./lib');
Expand Down Expand Up @@ -73,15 +72,6 @@ exports.resolve = function resolveKibanaPath(importRequest, file, config) {
return tryNodeResolver(importRequest, file, config);
}

// these modules are simulated by webpack, so there is no
// path to resolve to and no reason to do any more work
if (importRequest.startsWith('uiExports/')) {
return {
found: true,
path: null,
};
}

const { webpackConfig, aliasEntries } = initContext(file, config);
let isPathRequest = getIsPathRequest(importRequest);

Expand Down Expand Up @@ -110,16 +100,9 @@ exports.resolve = function resolveKibanaPath(importRequest, file, config) {
}
}

// only use the node resolver if the importRequest is a path, or is
// a module request but not one that's probably a webpackShim. This
// prevents false positives as webpackShims are likely to be resolved
// to the node_modules directory by the node resolver, but we want
// them to resolve to the actual shim
if (isPathRequest || !isProbablyWebpackShim(importRequest, file)) {
const nodeResult = tryNodeResolver(importRequest, file, config);
if (nodeResult && nodeResult.found) {
return nodeResult;
}
const nodeResult = tryNodeResolver(importRequest, file, config);
if (nodeResult && nodeResult.found) {
return nodeResult;
}

return webpackResolver.resolve(importRequest, file, {
Expand Down
66 changes: 0 additions & 66 deletions packages/kbn-eslint-import-resolver-kibana/lib/get_plugins.js

This file was deleted.

Loading

0 comments on commit 4c810be

Please sign in to comment.