forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing exports for static generation bailout (vercel#48910)
### What? add missing exports from next-app-loader ### Why? avoid crashing Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b002102
commit fafecb8
Showing
5 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
27 changes: 19 additions & 8 deletions
27
packages/next-swc/crates/next-core/js/src/entry/app/layout-entry.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
export { default as AppRouter } from 'next/dist/client/components/app-router.js' | ||
export { default as LayoutRouter } from 'next/dist/client/components/layout-router.js' | ||
export { default as RenderFromTemplateContext } from 'next/dist/client/components/render-from-template-context.js' | ||
export { default as GlobalError } from 'next/dist/client/components/error-boundary.js' | ||
export { staticGenerationAsyncStorage } from 'next/dist/client/components/static-generation-async-storage.js' | ||
export { requestAsyncStorage } from 'next/dist/client/components/request-async-storage.js' | ||
import * as serverHooks from 'next/dist/client/components/hooks-server-context.js' | ||
export { default as AppRouter } from 'next/dist/client/components/app-router' | ||
export { default as LayoutRouter } from 'next/dist/client/components/layout-router' | ||
export { default as RenderFromTemplateContext } from 'next/dist/client/components/render-from-template-context' | ||
export { default as GlobalError } from 'next/dist/client/components/error-boundary' | ||
|
||
export { staticGenerationAsyncStorage } from 'next/dist/client/components/static-generation-async-storage' | ||
|
||
export { requestAsyncStorage } from 'next/dist/client/components/request-async-storage' | ||
export { actionAsyncStorage } from 'next/dist/client/components/action-async-storage' | ||
|
||
export { staticGenerationBailout } from 'next/dist/client/components/static-generation-bailout' | ||
export { default as StaticGenerationSearchParamsBailoutProvider } from 'next/dist/client/components/static-generation-searchparams-bailout-provider' | ||
export { createSearchParamsBailoutProxy } from 'next/dist/client/components/searchparams-bailout-proxy' | ||
|
||
import * as serverHooks from 'next/dist/client/components/hooks-server-context' | ||
export { serverHooks } | ||
export { renderToReadableStream } from 'next/dist/compiled/react-server-dom-webpack/server.edge' | ||
export { | ||
renderToReadableStream, | ||
decodeReply, | ||
} from 'next/dist/compiled/react-server-dom-webpack/server.edge' | ||
export { preloadStyle } from 'next/dist/server/app-render/rsc/preloads' |
7 changes: 7 additions & 0 deletions
7
...t-swc/crates/next-dev-tests/tests/integration/next/app/force-dynamic/input/app/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function RootLayout({ children }: { children: any }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
...ext-swc/crates/next-dev-tests/tests/integration/next/app/force-dynamic/input/app/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Test from './test' | ||
|
||
export const dynamic = 'force-dynamic' | ||
|
||
export default function Page({ searchParams }) { | ||
return ( | ||
<div> | ||
<h1>{JSON.stringify(searchParams)}</h1> | ||
<Test /> | ||
</div> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
...ext-swc/crates/next-dev-tests/tests/integration/next/app/force-dynamic/input/app/test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use client' | ||
|
||
import { useEffect } from 'react' | ||
|
||
export default function Test() { | ||
useEffect(() => { | ||
import('@turbo/pack-test-harness').then(() => { | ||
it('should run', () => {}) | ||
}) | ||
return () => {} | ||
}, []) | ||
} |
5 changes: 5 additions & 0 deletions
5
...t-swc/crates/next-dev-tests/tests/integration/next/app/force-dynamic/input/next.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
experimental: { | ||
appDir: true, | ||
}, | ||
} |