Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)

* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
This commit is contained in:
kay delaney
2019-09-03 09:29:02 +01:00
committed by GitHub
parent 409874b35d
commit 7985aa1e57
34 changed files with 289 additions and 200 deletions

View File

@@ -1,6 +1,7 @@
import difference from 'lodash/difference';
import { fieldReducers, ReducerID, reduceField } from './fieldReducer';
import _ from 'lodash';
import { Field, FieldType } from '../types/index';
import { MutableDataFrame } from './dataFrameHelper';
import { ArrayVector } from './vector';
@@ -42,7 +43,7 @@ describe('Stats Calculators', () => {
expect(stats.length).toBe(2);
const found = stats.map(v => v.id);
const notFound = _.difference(names, found);
const notFound = difference(names, found);
expect(notFound.length).toBe(2);
expect(notFound[0]).toBe('not a stat');

View File

@@ -1,5 +1,5 @@
// @ts-ignore
import _ from 'lodash';
import each from 'lodash/each';
import groupBy from 'lodash/groupBy';
import { RawTimeRange } from '../types/time';
@@ -64,12 +64,12 @@ const rangeOptions = [
const absoluteFormat = 'YYYY-MM-DD HH:mm:ss';
const rangeIndex: any = {};
_.each(rangeOptions, (frame: any) => {
each(rangeOptions, (frame: any) => {
rangeIndex[frame.from + ' to ' + frame.to] = frame;
});
export function getRelativeTimesList(timepickerSettings: any, currentDisplay: any) {
const groups = _.groupBy(rangeOptions, (option: any) => {
const groups = groupBy(rangeOptions, (option: any) => {
option.active = option.display === currentDisplay;
return option.section;
});