Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slim down core bundle #75912

Merged
merged 5 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { i18n } from '@kbn/i18n';
import { groupBy, sortBy } from 'lodash';
import React, { Fragment, useRef } from 'react';
import { useObservable } from 'react-use';
import useObservable from 'react-use/lib/useObservable';
import * as Rx from 'rxjs';
import { ChromeNavLink, ChromeRecentlyAccessedHistoryItem } from '../..';
import { AppCategory } from '../../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { i18n } from '@kbn/i18n';
import classnames from 'classnames';
import React, { createRef, useState } from 'react';
import { useObservable } from 'react-use';
import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import { LoadingIndicator } from '../';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { EuiHeaderBreadcrumbs } from '@elastic/eui';
import classNames from 'classnames';
import React from 'react';
import { useObservable } from 'react-use';
import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import { ChromeBreadcrumb } from '../../chrome_service';

Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { EuiHeaderLogo } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { useObservable } from 'react-use';
import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import Url from 'url';
import { ChromeNavLink } from '../..';
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_nav_controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { EuiHeaderSectionItem } from '@elastic/eui';
import React from 'react';
import { useObservable } from 'react-use';
import useObservable from 'react-use/lib/useObservable';
import { Observable } from 'rxjs';
import { ChromeNavControl } from '../../nav_controls';
import { HeaderExtension } from './header_extension';
Expand Down
15 changes: 12 additions & 3 deletions src/core/public/overlays/banners/user_banner_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

import React, { Fragment } from 'react';
import ReactDOM from 'react-dom';
import ReactMarkdown from 'react-markdown';
import { filter } from 'rxjs/operators';
import { Subscription } from 'rxjs';

import { FormattedMessage } from '@kbn/i18n/react';
import { EuiCallOut, EuiButton } from '@elastic/eui';
import { EuiCallOut, EuiButton, EuiLoadingSpinner } from '@elastic/eui';

import { I18nStart } from '../../i18n';
import { IUiSettingsClient } from '../../ui_settings';
Expand All @@ -36,6 +35,8 @@ interface StartDeps {
uiSettings: IUiSettingsClient;
}

const ReactMarkdownLazy = React.lazy(() => import('react-markdown'));

/**
* Sets up the custom banner that can be specified in advanced settings.
* @internal
Expand Down Expand Up @@ -75,7 +76,15 @@ export class UserBannerService {
}
iconType="help"
>
<ReactMarkdown renderers={{ root: Fragment }}>{content.trim()}</ReactMarkdown>
<React.Suspense
fallback={
<div>
<EuiLoadingSpinner />
</div>
}
>
<ReactMarkdownLazy renderers={{ root: Fragment }} source={content.trim()} />
</React.Suspense>

<EuiButton type="primary" size="s" onClick={() => banners.remove(id!)}>
<FormattedMessage
Expand Down