feat: compose executable frontend runtime
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { createAnonymousSessionAdapter } from "../adapters/auth/external-session-adapter.js";
|
||||
import { BootErrorShell } from "../presentation/boundaries/boot-error-shell.jsx";
|
||||
import { AppRouter } from "../presentation/routes/app-router.jsx";
|
||||
import { BootConfigError, loadRuntimeConfig } from "./load-runtime-config.js";
|
||||
import { createRuntimeComposition } from "./create-runtime-composition.js";
|
||||
import { BootConfigError } from "./load-runtime-config.js";
|
||||
import { ReleaseManifestError } from "./load-release-manifest.js";
|
||||
import "../presentation/styles/theme.css";
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
@@ -17,18 +18,18 @@ const root = createRoot(rootElement);
|
||||
|
||||
async function boot() {
|
||||
try {
|
||||
const runtime = await loadRuntimeConfig();
|
||||
const composition = await createRuntimeComposition();
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<AppRouter
|
||||
authSession={createAnonymousSessionAdapter()}
|
||||
basename={runtime.build.routerBasePath}
|
||||
authSession={composition.ports.authSession}
|
||||
basename={composition.config.build.routerBasePath}
|
||||
/>
|
||||
</StrictMode>,
|
||||
);
|
||||
} catch (error) {
|
||||
const safe =
|
||||
error instanceof BootConfigError
|
||||
error instanceof BootConfigError || error instanceof ReleaseManifestError
|
||||
? error.safe
|
||||
: { supportReference: "boot:unknown" };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user