Files
AndreaSlopFotografie/web/src/main.tsx
T
SluijsensandClaude Opus 5.5 6d3a1566c2
Continuous Integration / lighthouse (pull_request) Canceled after 0s
Continuous Integration / deploy-test (pull_request) Canceled after 0s
Continuous Integration / deploy-production (pull_request) Canceled after 0s
Continuous Integration / check (pull_request) Canceled after 2m22s
Adds Sentry and Umami monitoring to the site
Sentry loads after the page and reports errors only, without personal data;
Umami counts visits per environment. Both only run on andreaslop.nl and
test.andreaslop.nl. The CSP allows just these two hosts, and builds carry the
commit SHA as release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:08:47 +02:00

52 lines
1.7 KiB
TypeScript

import { StrictMode } from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createRouter } from '@tanstack/react-router';
import { routeTree } from './routeTree.gen';
import { ChakraProvider } from '@chakra-ui/react';
import system from './theme.ts';
import ErrorPage from './components/StatusPage/ErrorPage';
import { startSentry } from './monitoring/sentry';
import '@fontsource/jost/300.css';
import '@fontsource/jost/400.css';
import '@fontsource/jost/500.css';
import '@fontsource/marcellus/400.css';
// Foutmeldingen naar Sentry, alleen op test en productie (M1)
startSentry();
// Create a new router instance
const router = createRouter({
routeTree,
// Nieuwe pagina begint bovenaan; terug/vooruit herstelt de positie (FR-08)
scrollRestoration: true,
// Fout in een pagina: foutpagina binnen de shell (FR-10)
defaultErrorComponent: ErrorPage,
});
// Register the router instance for type safety
declare module '@tanstack/react-router' {
interface Register {
router: typeof router;
}
}
// De statische head-tags uit index.html zijn alleen voor crawlers zonder
// JavaScript. Vanaf hier beheren de routes ze, dus voorkom dubbele tags.
document.querySelectorAll('head [data-fallback]').forEach((el) => el.remove());
// Render the app
const rootElement = document.getElementById('root')!;
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<StrictMode>
{/* De site is alleen licht; de _dark-waarden in het thema blijven
staan voor een eventuele donkere modus later */}
<ChakraProvider value={system}>
<RouterProvider router={router} />
</ChakraProvider>
</StrictMode>,
);
}