mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat: run app in closure (#3790)
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import { WorkspaceFallback } from '@affine/component/workspace';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import { StrictMode, Suspense } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { bootstrapPluginSystem } from './bootstrap/register-plugins';
|
||||
|
||||
async function main() {
|
||||
const { setup } = await import('./bootstrap/setup');
|
||||
await setup();
|
||||
const rootStore = getCurrentStore();
|
||||
await setup(rootStore);
|
||||
bootstrapPluginSystem(rootStore).catch(err => {
|
||||
console.error('Failed to bootstrap plugin system', err);
|
||||
});
|
||||
const { App } = await import('./app');
|
||||
const root = document.getElementById('app');
|
||||
assertExists(root);
|
||||
|
||||
Reference in New Issue
Block a user