Introduces a canonical shell host context and normalized bootstrap flow for the dashboard, extracting the host initialization logic into a dedicated `shell-host.ts` module with a `ShellHostContext` provider; updates `App.tsx` and `Header` to use the new context, stabilizes related tests, and documen Fusion-Task-Id: FN-3407
28 lines
907 B
TypeScript
28 lines
907 B
TypeScript
import { StrictMode } from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { RootErrorBoundary } from "./components/ErrorBoundary";
|
|
import { App } from "./App";
|
|
import { installAuthFetch } from "./auth";
|
|
import { installVersionCheck } from "./versionCheck";
|
|
import { installSwUpdate } from "./swUpdate";
|
|
import { bootstrapShellHostContext } from "./shell-host";
|
|
import "./styles.css";
|
|
|
|
// Install the bearer-token fetch wrapper before React mounts so every API
|
|
// call (including ones fired synchronously during the first render) picks up
|
|
// the token that was either captured from `?token=` in the launch URL or
|
|
// stored from a previous session.
|
|
installAuthFetch();
|
|
installVersionCheck();
|
|
bootstrapShellHostContext();
|
|
|
|
createRoot(document.getElementById("root")!).render(
|
|
<StrictMode>
|
|
<RootErrorBoundary>
|
|
<App />
|
|
</RootErrorBoundary>
|
|
</StrictMode>,
|
|
);
|
|
|
|
installSwUpdate();
|