(request: Request)
| 4916 | // transitioning to the next request stage and this transition can happen in multiple places in this |
| 4917 | // implementation. |
| 4918 | function completeShell(request: Request) { |
| 4919 | if (request.trackedPostpones === null) { |
| 4920 | // We only emit early preloads on shell completion for renders. For prerenders |
| 4921 | // we wait for the entire Request to finish because we are not responding to a |
| 4922 | // live request and can wait for as much data as possible. |
| 4923 | |
| 4924 | // we should only be calling completeShell when the shell is complete so we |
| 4925 | // just use a literal here |
| 4926 | const shellComplete = true; |
| 4927 | safelyEmitEarlyPreloads(request, shellComplete); |
| 4928 | } |
| 4929 | if (request.trackedPostpones === null) { |
| 4930 | // When the shell is complete it will be possible to flush. We attempt to prepre |
| 4931 | // the Preamble here in case it is ready for flushing. |
| 4932 | // We exclude prerenders because these cannot flush until after completeAll has been called |
| 4933 | preparePreamble(request); |
| 4934 | } |
| 4935 | |
| 4936 | // We have completed the shell so the shell can't error anymore. |
| 4937 | request.onShellError = noop; |
| 4938 | const onShellReady = request.onShellReady; |
| 4939 | onShellReady(); |
| 4940 | } |
| 4941 | |
| 4942 | // I extracted this function out because we want to ensure we consistently emit preloads before |
| 4943 | // transitioning to the next request stage and this transition can happen in multiple places in this |
no test coverage detected