mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Resolves #64412 This adds a client transition to the app route `ModuleAssetContext` and the corresponding transforms so that client components can be safely imported and referenced (as their proxies) in app routes. Test Plan: Added an integration test Closes PACK-2964
20 lines
555 B
TypeScript
20 lines
555 B
TypeScript
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
import path from 'path'
|
|
|
|
describe('referencing a client component in an app route', () => {
|
|
const { next } = nextTestSetup({
|
|
files: new FileRef(path.join(__dirname)),
|
|
dependencies: {
|
|
react: 'latest',
|
|
'react-dom': 'latest',
|
|
},
|
|
})
|
|
|
|
it('responds without error', async () => {
|
|
expect(JSON.parse(await next.render('/runtime'))).toEqual({
|
|
// Turbopack's proxy components are functions
|
|
clientComponent: process.env.TURBOPACK ? 'function' : 'object',
|
|
})
|
|
})
|
|
})
|