diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/clientOnlyJSX.test.ts b/packages/start-plugin-core/tests/clientOnlyJSX/clientOnlyJSX.test.ts index 39feb3b138..93844e1a28 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/clientOnlyJSX.test.ts +++ b/packages/start-plugin-core/tests/clientOnlyJSX/clientOnlyJSX.test.ts @@ -1,61 +1,55 @@ import { describe, expect, test } from 'vitest' -import { - compileCode, - evaluateModule, - importSources, -} from '../regression-helpers' -import { getModuleErrors } from '@tanstack/compiler-test-utils/validate-module' +import { renderServer, renderSource } from '../regression-helpers' +import type { ModuleStub, Render } from '../regression-helpers' // On the server, `` (of a TanStack router package) renders its -// fallback: its children are gone from the SSR output, so the server never -// evaluates them (the evaluated JSX runtime calls components and props -// eagerly; on the server, the libraries the children use throw when -// called). Whether the SSR output keeps their imports is left open (neutral -// names, user ruling 2026-10-17). The client keeps them. Other components +// fallback: the server output drops its children, so the server never +// evaluates them (on the server, the libraries the children use throw when +// called, here even while the children's elements are created). Rendered +// with the real React and the real `ClientOnly` of `@tanstack/react-router` +// (which renders its fallback whenever it renders on a server), the server +// output renders what the uncompiled source renders there. Whether the SSR +// output keeps the children's imports is left open (neutral names, user +// ruling 2026-10-17). The client keeps the children: it renders them once +// the page hydrated (integration/clientOnlyJSX.test.ts). Other components // named ClientOnly are left alone. // N4 (replaces the former snapshot fixtures of this directory). describe(' children', () => { - const libraries = { - 'heavy-chart-library': { Chart: () => '' }, + /** The libraries the fixtures import (plain text components). */ + const libraries: Record> = { + 'heavy-chart-library': { Chart: () => 'chart' }, './utils': { formatData: () => 'data' }, - 'video-player-lib': { VideoPlayer: () => '