|
779 | 779 | }; |
780 | 780 | } |
781 | 781 | function createPreambleState() { |
782 | | - return { |
783 | | - htmlChunks: null, |
784 | | - headChunks: null, |
785 | | - bodyChunks: null, |
786 | | - contribution: NoContribution |
787 | | - }; |
| 782 | + return { htmlChunks: null, headChunks: null, bodyChunks: null }; |
788 | 783 | } |
789 | 784 | function createFormatContext(insertionMode, selectedValue, tagScope) { |
790 | 785 | return { |
|
2752 | 2747 | var preamble = preambleState || renderState.preamble; |
2753 | 2748 | if (preamble.headChunks) |
2754 | 2749 | throw Error("The `<head>` tag may only be rendered once."); |
| 2750 | + null !== preambleState && target$jscomp$0.push("\x3c!--head--\x3e"); |
2755 | 2751 | preamble.headChunks = []; |
2756 | 2752 | var JSCompiler_inline_result$jscomp$9 = pushStartSingletonElement( |
2757 | 2753 | preamble.headChunks, |
|
2770 | 2766 | var preamble$jscomp$0 = preambleState || renderState.preamble; |
2771 | 2767 | if (preamble$jscomp$0.bodyChunks) |
2772 | 2768 | throw Error("The `<body>` tag may only be rendered once."); |
| 2769 | + null !== preambleState && target$jscomp$0.push("\x3c!--body--\x3e"); |
2773 | 2770 | preamble$jscomp$0.bodyChunks = []; |
2774 | 2771 | var JSCompiler_inline_result$jscomp$10 = pushStartSingletonElement( |
2775 | 2772 | preamble$jscomp$0.bodyChunks, |
|
2788 | 2785 | var preamble$jscomp$1 = preambleState || renderState.preamble; |
2789 | 2786 | if (preamble$jscomp$1.htmlChunks) |
2790 | 2787 | throw Error("The `<html>` tag may only be rendered once."); |
| 2788 | + null !== preambleState && target$jscomp$0.push("\x3c!--html--\x3e"); |
2791 | 2789 | preamble$jscomp$1.htmlChunks = [doctypeChunk]; |
2792 | 2790 | var JSCompiler_inline_result$jscomp$11 = pushStartSingletonElement( |
2793 | 2791 | preamble$jscomp$1.htmlChunks, |
|
2871 | 2869 | renderState = renderState.preamble; |
2872 | 2870 | null === renderState.htmlChunks && |
2873 | 2871 | preambleState.htmlChunks && |
2874 | | - ((renderState.htmlChunks = preambleState.htmlChunks), |
2875 | | - (preambleState.contribution |= 1)); |
| 2872 | + (renderState.htmlChunks = preambleState.htmlChunks); |
2876 | 2873 | null === renderState.headChunks && |
2877 | 2874 | preambleState.headChunks && |
2878 | | - ((renderState.headChunks = preambleState.headChunks), |
2879 | | - (preambleState.contribution |= 4)); |
| 2875 | + (renderState.headChunks = preambleState.headChunks); |
2880 | 2876 | null === renderState.bodyChunks && |
2881 | 2877 | preambleState.bodyChunks && |
2882 | | - ((renderState.bodyChunks = preambleState.bodyChunks), |
2883 | | - (preambleState.contribution |= 2)); |
| 2878 | + (renderState.bodyChunks = preambleState.bodyChunks); |
2884 | 2879 | } |
2885 | 2880 | function writeBootstrap(destination, renderState) { |
2886 | 2881 | renderState = renderState.bootstrapChunks; |
|
2901 | 2896 | destination.push(renderState); |
2902 | 2897 | return destination.push(startPendingSuspenseBoundary2); |
2903 | 2898 | } |
2904 | | - function writePreambleContribution(destination, preambleState) { |
2905 | | - preambleState = preambleState.contribution; |
2906 | | - preambleState !== NoContribution && |
2907 | | - (destination.push(boundaryPreambleContributionChunkStart), |
2908 | | - destination.push("" + preambleState), |
2909 | | - destination.push(boundaryPreambleContributionChunkEnd)); |
2910 | | - } |
2911 | 2899 | function writeStartSegment(destination, renderState, formatContext, id) { |
2912 | 2900 | switch (formatContext.insertionMode) { |
2913 | 2901 | case ROOT_HTML_MODE: |
|
5517 | 5505 | renderNode(request, task, props.children, -1); |
5518 | 5506 | task.keyPath = _prevKeyPath3; |
5519 | 5507 | } |
5520 | | - if (!request.renderState.generateStaticMarkup) { |
5521 | | - var target$jscomp$0 = segment$jscomp$0.chunks, |
5522 | | - preambleState = task.blockedPreamble; |
5523 | | - if (preambleState) { |
5524 | | - var contribution = preambleState.contribution; |
5525 | | - contribution !== NoContribution && |
5526 | | - target$jscomp$0.push( |
5527 | | - boundaryPreambleContributionChunkStart, |
5528 | | - "" + contribution, |
5529 | | - boundaryPreambleContributionChunkEnd |
5530 | | - ); |
5531 | | - } |
5532 | | - target$jscomp$0.push("\x3c!--/&--\x3e"); |
5533 | | - } |
| 5508 | + request.renderState.generateStaticMarkup || |
| 5509 | + segment$jscomp$0.chunks.push("\x3c!--/&--\x3e"); |
5534 | 5510 | segment$jscomp$0.lastPushedText = !1; |
5535 | 5511 | } |
5536 | 5512 | return; |
|
7518 | 7494 | if (!request.renderState.generateStaticMarkup) { |
7519 | 7495 | var errorDigest = boundary.errorDigest, |
7520 | 7496 | errorMessage = boundary.errorMessage, |
7521 | | - errorStack = boundary.errorStack, |
7522 | | - errorComponentStack = boundary.errorComponentStack; |
| 7497 | + errorStack = boundary.errorStack; |
| 7498 | + boundary = boundary.errorComponentStack; |
7523 | 7499 | destination.push(startClientRenderedSuspenseBoundary); |
7524 | 7500 | destination.push(clientRenderedSuspenseBoundaryError1); |
7525 | 7501 | errorDigest && |
|
7543 | 7519 | destination.push( |
7544 | 7520 | clientRenderedSuspenseBoundaryErrorAttrInterstitial |
7545 | 7521 | )); |
7546 | | - errorComponentStack && |
| 7522 | + boundary && |
7547 | 7523 | (destination.push(clientRenderedSuspenseBoundaryError1D), |
7548 | | - (errorComponentStack = escapeTextForBrowser(errorComponentStack)), |
7549 | | - destination.push(errorComponentStack), |
| 7524 | + (errorStack = escapeTextForBrowser(boundary)), |
| 7525 | + destination.push(errorStack), |
7550 | 7526 | destination.push( |
7551 | 7527 | clientRenderedSuspenseBoundaryErrorAttrInterstitial |
7552 | 7528 | )); |
7553 | 7529 | destination.push(clientRenderedSuspenseBoundaryError2); |
7554 | 7530 | } |
7555 | 7531 | flushSubtree(request, destination, segment, hoistableState); |
7556 | | - request.renderState.generateStaticMarkup |
7557 | | - ? (destination = !0) |
7558 | | - : ((request = boundary.fallbackPreamble) && |
7559 | | - writePreambleContribution(destination, request), |
7560 | | - (destination = destination.push(endSuspenseBoundary))); |
7561 | | - return destination; |
| 7532 | + request = request.renderState.generateStaticMarkup |
| 7533 | + ? !0 |
| 7534 | + : destination.push(endSuspenseBoundary); |
| 7535 | + return request; |
7562 | 7536 | } |
7563 | 7537 | if (boundary.status !== COMPLETED) |
7564 | 7538 | return ( |
|
7572 | 7546 | boundary.rootSegmentID |
7573 | 7547 | ), |
7574 | 7548 | hoistableState && |
7575 | | - ((boundary = boundary.fallbackState), |
7576 | | - boundary.styles.forEach(hoistStyleQueueDependency, hoistableState), |
7577 | | - boundary.stylesheets.forEach( |
| 7549 | + ((errorStack = boundary.fallbackState), |
| 7550 | + errorStack.styles.forEach( |
| 7551 | + hoistStyleQueueDependency, |
| 7552 | + hoistableState |
| 7553 | + ), |
| 7554 | + errorStack.stylesheets.forEach( |
7578 | 7555 | hoistStylesheetDependency, |
7579 | 7556 | hoistableState |
7580 | 7557 | )), |
|
7605 | 7582 | "A previously unvisited boundary must have exactly one root segment. This is a bug in React." |
7606 | 7583 | ); |
7607 | 7584 | flushSegment(request, destination, segment[0], hoistableState); |
7608 | | - request.renderState.generateStaticMarkup |
7609 | | - ? (destination = !0) |
7610 | | - : ((request = boundary.contentPreamble) && |
7611 | | - writePreambleContribution(destination, request), |
7612 | | - (destination = destination.push(endSuspenseBoundary))); |
7613 | | - return destination; |
| 7585 | + request = request.renderState.generateStaticMarkup |
| 7586 | + ? !0 |
| 7587 | + : destination.push(endSuspenseBoundary); |
| 7588 | + return request; |
7614 | 7589 | } |
7615 | 7590 | function flushSegmentContainer( |
7616 | 7591 | request, |
|
9297 | 9272 | Object.freeze(PRELOAD_NO_CREDS); |
9298 | 9273 | var scriptRegex = /(<\/|<)(s)(cript)/gi; |
9299 | 9274 | var didWarnForNewBooleanPropsWithEmptyValue = {}; |
9300 | | - var NoContribution = 0, |
9301 | | - ROOT_HTML_MODE = 0, |
| 9275 | + var ROOT_HTML_MODE = 0, |
9302 | 9276 | HTML_HTML_MODE = 1, |
9303 | 9277 | HTML_MODE = 2, |
9304 | 9278 | HTML_HEAD_MODE = 3, |
|
9354 | 9328 | clientRenderedSuspenseBoundaryError1C = ' data-stck="', |
9355 | 9329 | clientRenderedSuspenseBoundaryError1D = ' data-cstck="', |
9356 | 9330 | clientRenderedSuspenseBoundaryError2 = "></template>", |
9357 | | - boundaryPreambleContributionChunkStart = "\x3c!--", |
9358 | | - boundaryPreambleContributionChunkEnd = "--\x3e", |
9359 | 9331 | startSegmentHTML = '<div hidden id="', |
9360 | 9332 | startSegmentHTML2 = '">', |
9361 | 9333 | endSegmentHTML = "</div>", |
|
9702 | 9674 | 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' |
9703 | 9675 | ); |
9704 | 9676 | }; |
9705 | | - exports.version = "19.2.0-experimental-c44e4a25-20250409"; |
| 9677 | + exports.version = "19.2.0-experimental-1d6c8168-20250411"; |
9706 | 9678 | })(); |
0 commit comments