diff --git a/packages/router-plugin/tests/integration/pages/code-splitter-imports-exports.test.ts b/packages/router-plugin/tests/integration/pages/code-splitter-imports-exports.test.ts index 8172385567..e2ecd1127b 100644 --- a/packages/router-plugin/tests/integration/pages/code-splitter-imports-exports.test.ts +++ b/packages/router-plugin/tests/integration/pages/code-splitter-imports-exports.test.ts @@ -1342,7 +1342,9 @@ return [await render('component'), heavy.weight]`, extracted: true, }, { - name: 'a displayName after a surviving effect (kept in the route module)', + // (R139: the write is no effect, so it is no longer ordered against + // `see()`; the row asserted that it stayed in the route module) + name: 'a displayName after a surviving effect (the write is no effect)', code: `${head}import { see } from './see' see('before') export function Page() { @@ -1359,7 +1361,7 @@ return [await render('component'), Page.displayName, seen]`, 'PageDisplay', ['before'], ], - extracted: false, + extracted: true, }, { name: 'a displayName before a surviving effect (the effect keeps its order)', diff --git a/packages/start-plugin-core/tests/integration/start-build-pure-builders.test.ts b/packages/start-plugin-core/tests/integration/start-build-pure-builders.test.ts index 23b2812c68..d20eea9ca3 100644 --- a/packages/start-plugin-core/tests/integration/start-build-pure-builders.test.ts +++ b/packages/start-plugin-core/tests/integration/start-build-pure-builders.test.ts @@ -10,8 +10,9 @@ * (47 apps) were such chains. A builder exists once: one read by two split * options lives in one module both import, and a middleware a server fn and * split code read runs once per call. A link called on a `const` holding a - * builder stays an effect (a middleware's links write the options of the - * builder they are called on), as does a chain with an impure argument. + * builder is a write of that builder (a middleware's links write the + * options of the builder they are called on), which moves with it (R139). A + * chain with an impure argument stays an effect. * Both environments agree, so a server fn nested in a function may take a * builder chain in its options (the server compile hoists it). * @@ -112,7 +113,9 @@ export const Route = createFileRoute('/shared')({ errorComponent: () => , }) `, - // a link on a `const` builder writes that builder's options: an effect + // a link on a `const` builder writes that builder's options: a write of + // pure values, so the builder, its link and the server fn using it load + // with the chunk (R139; the row asserted that they stayed, an effect) 'src/routes/const-receiver.tsx': route( 'const-receiver', `const base = createMiddleware({ type: 'function' }) @@ -130,7 +133,14 @@ const run = createServerFn().middleware([linked]).handler(async () => 1)`, ), } -const pure = ['server-fn', 'exported', 'middleware', 'isomorphic', 'shared'] +const pure = [ + 'server-fn', + 'exported', + 'middleware', + 'isomorphic', + 'shared', + 'const-receiver', +] describe.each(startBundlers)('a %s client build', (bundler) => { test( @@ -183,10 +193,8 @@ describe.each(startBundlers)('a %s client build', (bundler) => { ]), ), ) - for (const path of ['const-receiver', 'impure']) { - expect(build.client.where(`MARK_${path}`), path).toBe('eager') - expect(warnings(path).length, path).toBeGreaterThan(0) - } + expect(build.client.where('MARK_impure')).toBe('eager') + expect(warnings('impure').length).toBeGreaterThan(0) expectDiagnostic(reported, { severity: 'warning', file: 'src/routes/impure.tsx',