/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
server
/
app-render
/
/opt/canhelp/node_modules/next/dist/esm/server/app-render
mkdir
upload
Name
Size
Mode
Actions
metadata-insertion/
-
0755
rm
module-loading/
-
0755
rm
rsc/
-
0755
rm
action-async-storage-instance.js
192
0644
edit
dl
rm
action-async-storage-instance.js.map
503
0644
edit
dl
rm
action-async-storage.external.js
302
0644
edit
dl
rm
action-async-storage.external.js.map
765
0644
edit
dl
rm
action-handler.js
47638
0644
edit
dl
rm
action-handler.js.map
68659
0644
edit
dl
rm
action-utils.js
3705
0644
edit
dl
rm
action-utils.js.map
5560
0644
edit
dl
rm
after-task-async-storage-instance.js
199
0644
edit
dl
rm
after-task-async-storage-instance.js.map
523
0644
edit
dl
rm
after-task-async-storage.external.js
311
0644
edit
dl
rm
after-task-async-storage.external.js.map
1064
0644
edit
dl
rm
app-render-prerender-utils.js
6762
0644
edit
dl
rm
app-render-prerender-utils.js.map
10813
0644
edit
dl
rm
app-render-render-utils.js
1119
0644
edit
dl
rm
app-render-render-utils.js.map
1618
0644
edit
dl
rm
app-render.js
157902
0644
edit
dl
rm
app-render.js.map
239776
0644
edit
dl
rm
async-local-storage.js
1496
0644
edit
dl
rm
async-local-storage.js.map
2735
0644
edit
dl
rm
cache-signal.js
5730
0644
edit
dl
rm
cache-signal.js.map
8119
0644
edit
dl
rm
collect-segment-data.js
13005
0644
edit
dl
rm
collect-segment-data.js.map
22398
0644
edit
dl
rm
create-component-styles-and-scripts.js
1138
0644
edit
dl
rm
create-component-styles-and-scripts.js.map
2482
0644
edit
dl
rm
create-component-tree.js
39485
0644
edit
dl
rm
create-component-tree.js.map
59317
0644
edit
dl
rm
create-error-handler.js
8900
0644
edit
dl
rm
create-error-handler.js.map
13934
0644
edit
dl
rm
create-flight-router-state-from-loader-tree.js
3249
0644
edit
dl
rm
create-flight-router-state-from-loader-tree.js.map
5682
0644
edit
dl
rm
csrf-protection.js
2801
0644
edit
dl
rm
csrf-protection.js.map
3924
0644
edit
dl
rm
dynamic-access-async-storage-instance.js
207
0644
edit
dl
rm
dynamic-access-async-storage-instance.js.map
537
0644
edit
dl
rm
dynamic-access-async-storage.external.js
339
0644
edit
dl
rm
dynamic-access-async-storage.external.js.map
823
0644
edit
dl
rm
dynamic-rendering.js
30863
0644
edit
dl
rm
dynamic-rendering.js.map
45598
0644
edit
dl
rm
encryption-utils-server.js
4277
0644
edit
dl
rm
encryption-utils-server.js.map
7131
0644
edit
dl
rm
encryption-utils.js
6595
0644
edit
dl
rm
encryption-utils.js.map
11128
0644
edit
dl
rm
encryption.js
11249
0644
edit
dl
rm
encryption.js.map
16768
0644
edit
dl
rm
entry-base.js
3181
0644
edit
dl
rm
entry-base.js.map
6055
0644
edit
dl
rm
flight-render-result.js
509
0644
edit
dl
rm
flight-render-result.js.map
987
0644
edit
dl
rm
get-asset-query-string.js
779
0644
edit
dl
rm
get-asset-query-string.js.map
1573
0644
edit
dl
rm
get-css-inlined-link-tags.js
1403
0644
edit
dl
rm
get-css-inlined-link-tags.js.map
2570
0644
edit
dl
rm
get-layer-assets.js
2787
0644
edit
dl
rm
get-layer-assets.js.map
5550
0644
edit
dl
rm
get-preloadable-fonts.js
1294
0644
edit
dl
rm
get-preloadable-fonts.js.map
2384
0644
edit
dl
rm
get-script-nonce-from-header.js
1775
0644
edit
dl
rm
get-script-nonce-from-header.js.map
2784
0644
edit
dl
rm
get-segment-param.js
1358
0644
edit
dl
rm
get-segment-param.js.map
2352
0644
edit
dl
rm
get-short-dynamic-param-type.js
664
0644
edit
dl
rm
get-short-dynamic-param-type.js.map
1167
0644
edit
dl
rm
has-loading-component-in-tree.js
312
0644
edit
dl
rm
has-loading-component-in-tree.js.map
796
0644
edit
dl
rm
interop-default.js
181
0644
edit
dl
rm
interop-default.js.map
394
0644
edit
dl
rm
make-get-server-inserted-html.js
4076
0644
edit
dl
rm
make-get-server-inserted-html.js.map
6615
0644
edit
dl
rm
parse-and-validate-flight-router-state.js
1571
0644
edit
dl
rm
parse-and-validate-flight-router-state.js.map
2435
0644
edit
dl
rm
parse-loader-tree.js
798
0644
edit
dl
rm
parse-loader-tree.js.map
1427
0644
edit
dl
rm
postponed-state.js
5431
0644
edit
dl
rm
postponed-state.js.map
9091
0644
edit
dl
rm
prospective-render-utils.js
2277
0644
edit
dl
rm
prospective-render-utils.js.map
3421
0644
edit
dl
rm
react-large-shell-error.js
370
0644
edit
dl
rm
react-large-shell-error.js.map
773
0644
edit
dl
rm
react-server.node.js
316
0644
edit
dl
rm
react-server.node.js.map
637
0644
edit
dl
rm
render-css-resource.js
2407
0644
edit
dl
rm
render-css-resource.js.map
3963
0644
edit
dl
rm
required-scripts.js
2442
0644
edit
dl
rm
required-scripts.js.map
4294
0644
edit
dl
rm
segment-explorer-path.js
2756
0644
edit
dl
rm
segment-explorer-path.js.map
5208
0644
edit
dl
rm
server-inserted-html.js
1030
0644
edit
dl
rm
server-inserted-html.js.map
1778
0644
edit
dl
rm
strip-flight-headers.js
365
0644
edit
dl
rm
strip-flight-headers.js.map
738
0644
edit
dl
rm
types.js
2020
0644
edit
dl
rm
types.js.map
13145
0644
edit
dl
rm
use-flight-response.js
6758
0644
edit
dl
rm
use-flight-response.js.map
11158
0644
edit
dl
rm
walk-tree-with-flight-router-state.js
10808
0644
edit
dl
rm
walk-tree-with-flight-router-state.js.map
17382
0644
edit
dl
rm
work-async-storage-instance.js
188
0644
edit
dl
rm
work-async-storage-instance.js.map
491
0644
edit
dl
rm
work-async-storage.external.js
292
0644
edit
dl
rm
work-async-storage.external.js.map
4274
0644
edit
dl
rm
work-unit-async-storage-instance.js
197
0644
edit
dl
rm
work-unit-async-storage-instance.js.map
517
0644
edit
dl
rm
work-unit-async-storage.external.js
6423
0644
edit
dl
rm
work-unit-async-storage.external.js.map
20959
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/server/app-render/use-flight-response.js
(6758B)
import { htmlEscapeJsonString } from '../htmlescape'; import { workUnitAsyncStorage } from './work-unit-async-storage.external'; import { InvariantError } from '../../shared/lib/invariant-error'; const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'; const INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0; const INLINE_FLIGHT_PAYLOAD_DATA = 1; const INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2; const INLINE_FLIGHT_PAYLOAD_BINARY = 3; const flightResponses = new WeakMap(); const encoder = new TextEncoder(); const findSourceMapURL = process.env.NODE_ENV !== 'production' ? require('../lib/source-maps').findSourceMapURLDEV : undefined; /** * Render Flight stream. * This is only used for renderToHTML, the Flight response does not need additional wrappers. */ export function useFlightStream(flightStream, clientReferenceManifest, nonce) { const response = flightResponses.get(flightStream); if (response) { return response; } // react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly const { createFromReadableStream } = // eslint-disable-next-line import/no-extraneous-dependencies require('react-server-dom-webpack/client'); const newResponse = createFromReadableStream(flightStream, { findSourceMapURL, serverConsumerManifest: { moduleLoading: clientReferenceManifest.moduleLoading, moduleMap: isEdgeRuntime ? clientReferenceManifest.edgeSSRModuleMapping : clientReferenceManifest.ssrModuleMapping, serverModuleMap: null }, nonce }); // Edge pages are never prerendered so they necessarily cannot have a workUnitStore type // that requires the nextTick behavior. This is why it is safe to access a node only API here if (process.env.NEXT_RUNTIME !== 'edge') { const workUnitStore = workUnitAsyncStorage.getStore(); if (!workUnitStore) { throw Object.defineProperty(new InvariantError('Expected workUnitAsyncStorage to have a store.'), "__NEXT_ERROR_CODE", { value: "E696", enumerable: false, configurable: true }); } switch(workUnitStore.type){ case 'prerender-client': const responseOnNextTick = new Promise((resolve)=>{ process.nextTick(()=>resolve(newResponse)); }); flightResponses.set(flightStream, responseOnNextTick); return responseOnNextTick; case 'prerender': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } flightResponses.set(flightStream, newResponse); return newResponse; } /** * Creates a ReadableStream provides inline script tag chunks for writing hydration * data to the client outside the React render itself. * * @param flightStream The RSC render stream * @param nonce optionally a nonce used during this particular render * @param formState optionally the formState used with this particular render * @returns a ReadableStream without the complete property. This signifies a lazy ReadableStream */ export function createInlinedDataReadableStream(flightStream, nonce, formState) { const startScriptTag = nonce ? `<script nonce=${JSON.stringify(nonce)}>` : '<script>'; const flightReader = flightStream.getReader(); const decoder = new TextDecoder('utf-8', { fatal: true }); const readable = new ReadableStream({ type: 'bytes', start (controller) { try { writeInitialInstructions(controller, startScriptTag, formState); } catch (error) { // during encoding or enqueueing forward the error downstream controller.error(error); } }, async pull (controller) { try { const { done, value } = await flightReader.read(); if (value) { try { const decodedString = decoder.decode(value, { stream: !done }); // The chunk cannot be decoded as valid UTF-8 string as it might // have arbitrary binary data. writeFlightDataInstruction(controller, startScriptTag, decodedString); } catch { // The chunk cannot be decoded as valid UTF-8 string. writeFlightDataInstruction(controller, startScriptTag, value); } } if (done) { controller.close(); } } catch (error) { // There was a problem in the upstream reader or during decoding or enqueuing // forward the error downstream controller.error(error); } } }); return readable; } function writeInitialInstructions(controller, scriptStart, formState) { if (formState != null) { controller.enqueue(encoder.encode(`${scriptStart}(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(JSON.stringify([ INLINE_FLIGHT_PAYLOAD_BOOTSTRAP ]))});self.__next_f.push(${htmlEscapeJsonString(JSON.stringify([ INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState ]))})</script>`)); } else { controller.enqueue(encoder.encode(`${scriptStart}(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(JSON.stringify([ INLINE_FLIGHT_PAYLOAD_BOOTSTRAP ]))})</script>`)); } } function writeFlightDataInstruction(controller, scriptStart, chunk) { let htmlInlinedData; if (typeof chunk === 'string') { htmlInlinedData = htmlEscapeJsonString(JSON.stringify([ INLINE_FLIGHT_PAYLOAD_DATA, chunk ])); } else { // The chunk cannot be embedded as a UTF-8 string in the script tag. // Instead let's inline it in base64. // Credits to Devon Govett (devongovett) for the technique. // https://github.com/devongovett/rsc-html-stream const base64 = btoa(String.fromCodePoint(...chunk)); htmlInlinedData = htmlEscapeJsonString(JSON.stringify([ INLINE_FLIGHT_PAYLOAD_BINARY, base64 ])); } controller.enqueue(encoder.encode(`${scriptStart}self.__next_f.push(${htmlInlinedData})</script>`)); } //# sourceMappingURL=use-flight-response.js.map
Save
cmd:
run