mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05: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,5 +1,5 @@
|
||||
// Libraries
|
||||
import _ from 'lodash';
|
||||
import { flatten, omit, uniq } from 'lodash';
|
||||
import { Unsubscribable } from 'rxjs';
|
||||
// Services & Utils
|
||||
import {
|
||||
@@ -72,7 +72,7 @@ export async function getExploreUrl(args: GetExploreUrlArguments): Promise<strin
|
||||
/** In Explore, we don't have legend formatter and we don't want to keep
|
||||
* legend formatting as we can't change it
|
||||
*/
|
||||
let exploreTargets: DataQuery[] = panelTargets.map((t) => _.omit(t, 'legendFormat'));
|
||||
let exploreTargets: DataQuery[] = panelTargets.map((t) => omit(t, 'legendFormat'));
|
||||
let url: string | undefined;
|
||||
|
||||
// Mixed datasources need to choose only one datasource
|
||||
@@ -441,7 +441,7 @@ export const getRefIds = (value: any): string[] => {
|
||||
refIds.push(getRefIds(value[key]));
|
||||
}
|
||||
|
||||
return _.uniq(_.flatten(refIds));
|
||||
return uniq(flatten(refIds));
|
||||
};
|
||||
|
||||
export const refreshIntervalToSortOrder = (refreshInterval?: string) =>
|
||||
|
||||
Reference in New Issue
Block a user