Files
vercel__next.js/test/e2e/app-dir/client-reference-chunking/client-reference-chunking.test.ts
Niklas Mischkulnig eb14325ed4 Turbopack: remove deployment id suffix from client reference manifest chunks (#88741)
Closes PACK-6539

When `experimental.runtimeServerDeploymentId` is enabled, read the `process.env.NEXT_DEPLOYMENT_ID` and append to the chunks when evaluating the `client-reference-manifest.js`

Originally, I tried to do it after the manifest is loaded (in `loadComponents` or in the `RouteModule.prepare`) to "hydrate" the manifest, but that is too late because the manifest needs to be initialized immediately to make module-evaluation-time server actions work (which need the manifest immediately)
2026-01-20 16:11:24 +01:00

26 lines
898 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { getClientReferenceManifest } from 'next-test-utils'
describe('client-reference-chunking', () => {
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
})
it('should use the same chunks for client references across routes', async () => {
const browser = await next.browser('/')
await browser.elementByCss('a[href="/issue"]').click()
expect(await browser.elementByCss('body').text()).toContain(
'Welcome to the Issue Page'
)
let rootManifest = getClientReferenceManifest(next, '/page')
let issueManifest = getClientReferenceManifest(next, '/issue/page')
// These two routes have the same client component references, so these should be exactly the
// same (especially the `chunks` field)
expect(rootManifest.clientModules).toEqual(issueManifest.clientModules)
})
})