Chore: Change so we cache loading plugins by its version (#41367)
* making it possible to cache plugins based on the version. * feat(plugincache): introduce function to invalidate entries * removed todo's * added tests for the cache buster. * fixed tests. * fixed failing tests. Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
co-authored by
Jack Westbrook
parent
baab021fec
commit
e5421dd53e
@@ -80,6 +80,16 @@ export interface SentryConfig {
|
||||
sampleRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the plugins that should be preloaded prior to start Grafana.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type PreloadPlugin = {
|
||||
path: string;
|
||||
version: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes all the different Grafana configuration values available for an instance.
|
||||
*
|
||||
@@ -123,7 +133,7 @@ export interface GrafanaConfig {
|
||||
liveEnabled: boolean;
|
||||
theme: GrafanaTheme;
|
||||
theme2: GrafanaTheme2;
|
||||
pluginsToPreload: string[];
|
||||
pluginsToPreload: PreloadPlugin[];
|
||||
featureToggles: FeatureToggles;
|
||||
licenseInfo: LicenseInfo;
|
||||
http2Enabled: boolean;
|
||||
|
||||
@@ -36,6 +36,6 @@ export * from './live';
|
||||
export * from './variables';
|
||||
export * from './geometry';
|
||||
export { isUnsignedPluginSignature } from './pluginSignature';
|
||||
export { GrafanaConfig, BuildInfo, FeatureToggles, LicenseInfo } from './config';
|
||||
export { GrafanaConfig, BuildInfo, FeatureToggles, LicenseInfo, PreloadPlugin } from './config';
|
||||
export * from './alerts';
|
||||
export * from './slider';
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
LicenseInfo,
|
||||
MapLayerOptions,
|
||||
PanelPluginMeta,
|
||||
PreloadPlugin,
|
||||
systemDateFormats,
|
||||
SystemDateFormatSettings,
|
||||
} from '@grafana/data';
|
||||
@@ -59,7 +60,7 @@ export class GrafanaBootConfig implements GrafanaConfig {
|
||||
liveEnabled = true;
|
||||
theme: GrafanaTheme;
|
||||
theme2: GrafanaTheme2;
|
||||
pluginsToPreload: string[] = [];
|
||||
pluginsToPreload: PreloadPlugin[] = [];
|
||||
featureToggles: FeatureToggles = {
|
||||
accesscontrol: false,
|
||||
trimDefaults: false,
|
||||
|
||||
Reference in New Issue
Block a user