feat: move ace-editor and mathjs to async modules (#10837)

Follow up on #10831, move brace and mathjs to async modules so that the initial page load for dashboards most pages can be faster.
This commit is contained in:
Jesse Yang
2020-09-15 14:12:06 -07:00
committed by GitHub
parent 5d529fd844
commit 0129c4253d
28 changed files with 764 additions and 268 deletions

View File

@@ -22,10 +22,12 @@ import Button from 'src/components/Button';
// @ts-ignore
import Dialog from 'react-bootstrap-dialog';
import { t, SupersetClient } from '@superset-ui/core';
import AsyncEsmComponent from 'src/components/AsyncEsmComponent';
import getClientErrorObject from '../utils/getClientErrorObject';
import DatasourceEditor from './DatasourceEditor';
import withToasts from '../messageToasts/enhancers/withToasts';
import getClientErrorObject from 'src/utils/getClientErrorObject';
import withToasts from 'src/messageToasts/enhancers/withToasts';
const DatasourceEditor = AsyncEsmComponent(() => import('./DatasourceEditor'));
interface DatasourceModalProps {
addSuccessToast: (msg: string) => void;
@@ -150,6 +152,8 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
<Modal.Body>
{show && (
<DatasourceEditor
showLoadingForImport
height={500}
datasource={currentDatasource}
onChange={onDatasourceChange}
/>