import { assertExists } from '@blocksuite/global/utils'; import { loadedPluginNameAtom, rootStore } from '@toeverything/infra/atom'; import { use } from 'foxact/use'; import { useAtomValue } from 'jotai'; import { Provider } from 'jotai/react'; import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { _pluginNestedImportsMap } from '../bootstrap/plugins/setup'; import { pluginRegisterPromise } from '../bootstrap/register-plugins'; async function main() { const { setup } = await import('../bootstrap/setup'); await setup(); const root = document.getElementById('app'); assertExists(root); const App = () => { use(pluginRegisterPromise); const plugins = useAtomValue(loadedPluginNameAtom); _pluginNestedImportsMap.forEach(value => { const exports = value.get('index.js'); assertExists(exports); assertExists(exports?.get('entry')); }); return (
Successfully loaded plugins:
{plugins.map(plugin => { return
{plugin}
; })}
); }; createRoot(root).render( ); } await main();