( req: BaseNextRequest, res: BaseNextResponse, ctx: AppRenderContext, metadata: AppPageRenderResultMetadata, tree: LoaderTree, fallbackRouteParams: OpaqueFallbackRouteParams | null )
| 5717 | } |
| 5718 | |
| 5719 | async function prerenderToStream( |
| 5720 | req: BaseNextRequest, |
| 5721 | res: BaseNextResponse, |
| 5722 | ctx: AppRenderContext, |
| 5723 | metadata: AppPageRenderResultMetadata, |
| 5724 | tree: LoaderTree, |
| 5725 | fallbackRouteParams: OpaqueFallbackRouteParams | null |
| 5726 | ): Promise<PrerenderToStreamResult> { |
| 5727 | // When prerendering formState is always null. We still include it |
| 5728 | // because some shared APIs expect a formState value and this is slightly |
| 5729 | // more explicit than making it an optional function argument |
| 5730 | const formState = null |
| 5731 | |
| 5732 | const { |
| 5733 | assetPrefix, |
| 5734 | getDynamicParamFromSegment, |
| 5735 | implicitTags, |
| 5736 | nonce, |
| 5737 | pagePath, |
| 5738 | renderOpts, |
| 5739 | workStore, |
| 5740 | } = ctx |
| 5741 | |
| 5742 | const { |
| 5743 | basePath, |
| 5744 | buildManifest, |
| 5745 | ComponentMod, |
| 5746 | crossOrigin, |
| 5747 | experimental, |
| 5748 | isDebugDynamicAccesses, |
| 5749 | isBuildTimePrerendering = false, |
| 5750 | onInstrumentationRequestError, |
| 5751 | page, |
| 5752 | reactMaxHeadersLength, |
| 5753 | subresourceIntegrityManifest, |
| 5754 | cacheComponents, |
| 5755 | } = renderOpts |
| 5756 | |
| 5757 | const { cachedNavigations } = renderOpts.experimental |
| 5758 | |
| 5759 | const allowEmptyStaticShell = |
| 5760 | (renderOpts.allowEmptyStaticShell ?? false) || |
| 5761 | (await isPageAllowedToBlock(tree)) |
| 5762 | |
| 5763 | const rootParams = getRootParams(tree, getDynamicParamFromSegment) |
| 5764 | |
| 5765 | const { ServerInsertedHTMLProvider, renderServerInsertedHTML } = |
| 5766 | createServerInsertedHTML() |
| 5767 | const getServerInsertedMetadata = createServerInsertedMetadata(nonce) |
| 5768 | |
| 5769 | const tracingMetadata = getTracedMetadata( |
| 5770 | getTracer().getTracePropagationData(), |
| 5771 | experimental.clientTraceMetadata |
| 5772 | ) |
| 5773 | |
| 5774 | const polyfills: JSX.IntrinsicElements['script'][] = |
| 5775 | buildManifest.polyfillFiles |
| 5776 | .filter( |
nothing calls this directly
no test coverage detected