import { createRoot } from "react-dom/client"; import { recordBootFailure } from "../adapters/diagnostics/bounded-diagnostics.ts"; import { BootErrorShell } from "../presentation/boundaries/boot-error-shell.tsx"; import "pretendard/dist/web/variable/pretendardvariable.css"; import "@fontsource/ibm-plex-mono/400.css"; import "@fontsource/ibm-plex-mono/500.css"; import "../features/tech-log/presentation/styles/globals.css"; import "../features/tech-log/presentation/styles/studio.css"; import "../features/tech-log/presentation/styles/studio-editor.css"; import { createRuntimeComposition } from "./create-runtime-composition.ts"; import { initializeColorScheme } from "./initialize-color-scheme.ts"; import { ReleaseManifestError } from "./load-release-manifest.ts"; import { BootConfigError } from "./load-runtime-config.ts"; import { RuntimeApplication } from "./runtime-application.tsx"; const rootElement = document.getElementById("root"); if (!rootElement) { throw new Error("Missing #root mount element"); } const root = createRoot(rootElement); async function boot(): Promise { try { const composition = await createRuntimeComposition(); document.documentElement.dataset.buildId = composition.release.buildId; document.documentElement.dataset.releaseId = composition.release.releaseId; initializeColorScheme(composition.application.preferences); root.render(); import.meta.hot?.dispose(() => { void composition.dispose(); }); } catch (error: unknown) { const safe = error instanceof BootConfigError || error instanceof ReleaseManifestError ? error.safe : { supportReference: "boot:unknown" }; recordBootFailure(error, safe); root.render(); } } void boot();