|
1 | | -import React from 'react'; |
| 1 | +import React, { Suspense } from 'react'; |
2 | 2 | import ReactDOM from 'react-dom'; |
3 | | -import { Provider } from 'react-redux'; |
4 | 3 | import 'fira'; |
5 | 4 | import '@deephaven/components/scss/BaseStyleSheet.scss'; |
6 | | -import { MonacoUtils } from '@deephaven/console'; |
7 | | -import { store } from '@deephaven/redux'; |
8 | | -import MonacoWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'; |
9 | | -import DownloadServiceWorkerUtils from '../DownloadServiceWorkerUtils'; |
| 5 | +import { LoadingOverlay } from '@deephaven/components'; |
| 6 | +import { ApiBootstrap } from '@deephaven/jsapi-bootstrap'; |
10 | 7 | import logInit from '../log/LogInit'; |
11 | | -import { unregister } from '../serviceWorker'; |
12 | | -import StyleGuideInit from './StyleGuideInit'; |
13 | 8 |
|
14 | 9 | logInit(); |
15 | 10 |
|
| 11 | +const StyleGuideRoot = React.lazy(() => import('./StyleGuideRoot')); |
| 12 | + |
16 | 13 | ReactDOM.render( |
17 | | - <Provider store={store}> |
18 | | - <StyleGuideInit /> |
19 | | - </Provider>, |
| 14 | + <ApiBootstrap |
| 15 | + apiUrl={`${import.meta.env.VITE_CORE_API_URL}/${ |
| 16 | + import.meta.env.VITE_CORE_API_NAME |
| 17 | + }`} |
| 18 | + setGlobally |
| 19 | + > |
| 20 | + <Suspense fallback={<LoadingOverlay />}> |
| 21 | + <StyleGuideRoot /> |
| 22 | + </Suspense> |
| 23 | + </ApiBootstrap>, |
20 | 24 | document.getElementById('root') |
21 | 25 | ); |
22 | | -unregister(); |
23 | | -DownloadServiceWorkerUtils.registerOnLoaded(); |
24 | | -MonacoUtils.init({ getWorker: () => new MonacoWorker() }); |
25 | | - |
26 | | -// disable annoying dnd-react warnings |
27 | | -// eslint-disable-next-line @typescript-eslint/ban-ts-comment |
28 | | -// @ts-ignore |
29 | | -window['__react-beautiful-dnd-disable-dev-warnings'] = true; |
0 commit comments