mirror of https://github.com/grafana/grafana
Angular: Option to disable angular support and isolate angular dependencies (#45421)
* Angular: Initial setting that disables angular, load angular support in separate chunk * Load angular panels on demand * Load alerting in separate chunk only when angularSupportEnabled * progress, do not export core_module if angular disabled * Progress * Update public/app/features/plugins/built_in_plugins.ts Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Removing remaining usage of angular from outside angular app (not counting plugins) * Update config and docs * Fix sample.ini * Update public/app/features/alerting/AlertTab.tsx Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Fixing prettier issue Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>pull/45485/head
parent
8bb3de3037
commit
2b9e46d1f8
@ -0,0 +1,22 @@ |
||||
import { config, setAngularLoader } from '@grafana/runtime'; |
||||
|
||||
export async function loadAndInitAngularIfEnabled() { |
||||
if (config.angularSupportEnabled) { |
||||
const { AngularApp } = await import(/* webpackChunkName: "AngularApp" */ './index'); |
||||
const app = new AngularApp(); |
||||
app.init(); |
||||
app.bootstrap(); |
||||
} else { |
||||
setAngularLoader({ |
||||
load: (elem, scopeProps, template) => { |
||||
return { |
||||
destroy: () => {}, |
||||
digest: () => {}, |
||||
getScope: () => { |
||||
return {}; |
||||
}, |
||||
}; |
||||
}, |
||||
}); |
||||
} |
||||
} |
||||
@ -1,5 +0,0 @@ |
||||
import { IScope } from 'angular'; |
||||
|
||||
export interface Scope extends IScope { |
||||
[key: string]: any; |
||||
} |
||||
Loading…
Reference in new issue