Builds the markers, data block and stand-in host for the CMS host injection
The pages carry the CMS markers (data block, list regions, JSON-LD price, inline price); PackagesProvider reads the host's data block after hydration and asks the API only when there is none; the site address comes from the block. A stand-in for the host (config/hostInjector.ts, --cms-data in the preview server) and browser tests check the behaviour with different data. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import { StrictMode, startTransition } from 'react';
|
||||
import { hydrateRoot } from 'react-dom/client';
|
||||
import { StartClient } from '@tanstack/react-start/client';
|
||||
import { readCmsData } from './lib/cmsData';
|
||||
import { startSentry } from './monitoring/sentry';
|
||||
import { setSiteUrl } from './seo';
|
||||
|
||||
// Foutmeldingen naar Sentry, alleen op test en productie (M1). Dit bestand
|
||||
// draait alleen in de browser, dus niet tijdens het prerenderen, en loopt voor
|
||||
// op het hydrateren zodat ook vroege fouten gemeld worden.
|
||||
startSentry();
|
||||
|
||||
// The CMS host writes the address of the site it serves into the data block;
|
||||
// the script files cannot carry it. Without a block the built-in one stays.
|
||||
const page = readCmsData(document);
|
||||
if (page?.siteUrl) setSiteUrl(page.siteUrl);
|
||||
|
||||
startTransition(() => {
|
||||
hydrateRoot(
|
||||
document,
|
||||
|
||||
Reference in New Issue
Block a user