mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Performance: Standardize lodash imports to use destructured members (#33040)
* Performance: Standardize lodash imports to use destructured members
Changes lodash imports of the form `import x from 'lodash/x'` to
`import { x } from 'lodash'` to reduce bundle size.
* Remove unnecessary _ import from Graph component
* Enforce lodash import style
* Fix remaining lodash imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import { defaults, each, sortBy } from 'lodash';
|
||||
|
||||
import config from 'app/core/config';
|
||||
import { DashboardModel } from '../../state/DashboardModel';
|
||||
@@ -170,7 +170,7 @@ export class DashboardExporter {
|
||||
|
||||
return Promise.all(promises)
|
||||
.then(() => {
|
||||
_.each(datasources, (value: any) => {
|
||||
each(datasources, (value: any) => {
|
||||
inputs.push(value);
|
||||
});
|
||||
|
||||
@@ -199,9 +199,9 @@ export class DashboardExporter {
|
||||
// make inputs and requires a top thing
|
||||
const newObj: { [key: string]: {} } = {};
|
||||
newObj['__inputs'] = inputs;
|
||||
newObj['__requires'] = _.sortBy(requires, ['id']);
|
||||
newObj['__requires'] = sortBy(requires, ['id']);
|
||||
|
||||
_.defaults(newObj, saveModel);
|
||||
defaults(newObj, saveModel);
|
||||
return newObj;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user