Skip to content

Commit

Permalink
Revert "[dynamicIO] warn for disallowed dynamic in dev" (#71566)
Browse files Browse the repository at this point in the history
We're going to land this after 15.

Reverts #71526
  • Loading branch information
ztanner authored Oct 21, 2024
1 parent 0aba53d commit c85914c
Show file tree
Hide file tree
Showing 37 changed files with 1,027 additions and 1,432 deletions.
26 changes: 20 additions & 6 deletions packages/next/src/client/components/client-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,27 @@ export function ClientPageRoot({
)
}

const { createSearchParamsFromClient } =
require('../../server/request/search-params') as typeof import('../../server/request/search-params')
clientSearchParams = createSearchParamsFromClient(searchParams, store)
if (store.isStaticGeneration) {
// We are in a prerender context
const { createPrerenderSearchParamsFromClient } =
require('../../server/request/search-params') as typeof import('../../server/request/search-params')
clientSearchParams = createPrerenderSearchParamsFromClient(store)

const { createParamsFromClient } =
require('../../server/request/params') as typeof import('../../server/request/params')
clientParams = createParamsFromClient(params, store)
const { createPrerenderParamsFromClient } =
require('../../server/request/params') as typeof import('../../server/request/params')

clientParams = createPrerenderParamsFromClient(params, store)
} else {
const { createRenderSearchParamsFromClient } =
require('../../server/request/search-params') as typeof import('../../server/request/search-params')
clientSearchParams = createRenderSearchParamsFromClient(
searchParams,
store
)
const { createRenderParamsFromClient } =
require('../../server/request/params') as typeof import('../../server/request/params')
clientParams = createRenderParamsFromClient(params, store)
}

return <Component params={clientParams} searchParams={clientSearchParams} />
} else {
Expand Down
10 changes: 8 additions & 2 deletions packages/next/src/client/components/client-segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ export function ClientSegmentRoot({
)
}

const { createParamsFromClient } =
const { createPrerenderParamsFromClient } =
require('../../server/request/params') as typeof import('../../server/request/params')
clientParams = createParamsFromClient(params, store)

if (store.isStaticGeneration) {
clientParams = createPrerenderParamsFromClient(params, store)
} else {
const { createRenderParamsFromClient } =
require('../../server/request/params') as typeof import('../../server/request/params')
clientParams = createRenderParamsFromClient(params, store)
}
return <Component {...slots} params={clientParams} />
} else {
const { createRenderParamsFromClient } =
Expand Down
Loading

0 comments on commit c85914c

Please sign in to comment.