Chore: Fixes PhantomJs by adding polyfills for fetch and AbortController (#21655)

* Chore: Fixes PhantomJs rendering

* Docs: Updated docs

* Update contribute/style-guides/e2e.md

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

* Docs: Updates docs according to PR comments

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Hugo Häggmark
2020-01-22 08:15:31 +01:00
committed by GitHub
co-authored by Dominik Prokop
parent c228cde2b6
commit 5dddc91ba5
4 changed files with 29 additions and 13 deletions
+13 -12
View File
@@ -1,4 +1,6 @@
import '@babel/polyfill';
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; // fetch polyfill needed for PhantomJs rendering
import 'file-saver';
import 'lodash';
import 'jquery';
@@ -20,11 +22,21 @@ import config from 'app/core/config';
import ttiPolyfill from 'tti-polyfill';
// @ts-ignore ignoring this for now, otherwise we would have to extend _ interface with move
import _ from 'lodash';
import { AppEvents, setMarkdownOptions, setLocale } from '@grafana/data';
import { AppEvents, setLocale, setMarkdownOptions } from '@grafana/data';
import appEvents from 'app/core/app_events';
import { addClassIfNoOverlayScrollbar } from 'app/core/utils/scrollbar';
import { checkBrowserCompatibility } from 'app/core/utils/browser';
import { importPluginModule } from 'app/features/plugins/plugin_loader';
import { angularModules, coreModule } from 'app/core/core_module';
import { registerAngularDirectives } from 'app/core/core';
import { setupAngularRoutes } from 'app/routes/routes';
import { registerEchoBackend, setEchoSrv } from '@grafana/runtime';
import { Echo } from './core/services/echo/Echo';
import { reportPerformance } from './core/services/echo/EchoSrv';
import { PerformanceBackend } from './core/services/echo/backends/PerformanceBackend';
import 'app/routes/GrafanaCtrl';
import 'app/features/all';
// add move to lodash for backward compatabiltiy
// @ts-ignore
@@ -33,17 +45,6 @@ _.move = (array: [], fromIndex: number, toIndex: number) => {
return array;
};
import { coreModule, angularModules } from 'app/core/core_module';
import { registerAngularDirectives } from 'app/core/core';
import { setupAngularRoutes } from 'app/routes/routes';
import { setEchoSrv, registerEchoBackend } from '@grafana/runtime';
import { Echo } from './core/services/echo/Echo';
import { reportPerformance } from './core/services/echo/EchoSrv';
import { PerformanceBackend } from './core/services/echo/backends/PerformanceBackend';
import 'app/routes/GrafanaCtrl';
import 'app/features/all';
// import symlinked extensions
const extensionsIndex = (require as any).context('.', true, /extensions\/index.ts/);
extensionsIndex.keys().forEach((key: any) => {