| Server IP : 13.235.167.51 / Your IP : 216.73.217.116 Web Server : Apache System : Linux machinox-server 6.17.0-1013-aws #13~24.04.1-Ubuntu SMP Fri Apr 24 21:36:58 UTC 2026 aarch64 User : root ( 0) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/control.machinox.in/node_modules/next/dist/esm/server/dev/ |
Upload File : |
{"version":3,"sources":["../../../../src/server/dev/debug-channel.ts"],"sourcesContent":["import { createBufferedTransformStream } from '../stream-utils/node-web-streams-helper'\nimport {\n HMR_MESSAGE_SENT_TO_BROWSER,\n type HmrMessageSentToBrowser,\n} from './hot-reloader-types'\n\nexport interface ReactDebugChannelForBrowser {\n readonly readable: ReadableStream<Uint8Array>\n // Might also get a writable stream as return channel in the future.\n}\n\nconst reactDebugChannelsByHtmlRequestId = new Map<\n string,\n ReactDebugChannelForBrowser\n>()\n\nexport function connectReactDebugChannel(\n requestId: string,\n debugChannel: ReactDebugChannelForBrowser,\n sendToClient: (message: HmrMessageSentToBrowser) => void\n) {\n const reader = debugChannel.readable\n .pipeThrough(\n // We're sending the chunks in batches to reduce overhead in the browser.\n createBufferedTransformStream({ maxBufferByteLength: 128 * 1024 })\n )\n .getReader()\n\n const stop = () => {\n sendToClient({\n type: HMR_MESSAGE_SENT_TO_BROWSER.REACT_DEBUG_CHUNK,\n requestId,\n chunk: null,\n })\n }\n\n const onError = (err: unknown) => {\n console.error(new Error('React debug channel stream error', { cause: err }))\n stop()\n }\n\n const progress = (entry: ReadableStreamReadResult<Uint8Array>) => {\n if (entry.done) {\n stop()\n } else {\n sendToClient({\n type: HMR_MESSAGE_SENT_TO_BROWSER.REACT_DEBUG_CHUNK,\n requestId,\n chunk: entry.value,\n })\n\n reader.read().then(progress, onError)\n }\n }\n\n reader.read().then(progress, onError)\n}\n\nexport function connectReactDebugChannelForHtmlRequest(\n htmlRequestId: string,\n sendToClient: (message: HmrMessageSentToBrowser) => void\n) {\n const debugChannel = reactDebugChannelsByHtmlRequestId.get(htmlRequestId)\n\n if (!debugChannel) {\n return\n }\n\n reactDebugChannelsByHtmlRequestId.delete(htmlRequestId)\n\n connectReactDebugChannel(htmlRequestId, debugChannel, sendToClient)\n}\n\nexport function setReactDebugChannelForHtmlRequest(\n htmlRequestId: string,\n debugChannel: ReactDebugChannelForBrowser\n) {\n // TODO: Clean up after a timeout, in case the client never connects, e.g.\n // when CURL'ing the page, or loading the page with JavaScript disabled etc.\n reactDebugChannelsByHtmlRequestId.set(htmlRequestId, debugChannel)\n}\n\nexport function deleteReactDebugChannelForHtmlRequest(htmlRequestId: string) {\n reactDebugChannelsByHtmlRequestId.delete(htmlRequestId)\n}\n"],"names":["createBufferedTransformStream","HMR_MESSAGE_SENT_TO_BROWSER","reactDebugChannelsByHtmlRequestId","Map","connectReactDebugChannel","requestId","debugChannel","sendToClient","reader","readable","pipeThrough","maxBufferByteLength","getReader","stop","type","REACT_DEBUG_CHUNK","chunk","onError","err","console","error","Error","cause","progress","entry","done","value","read","then","connectReactDebugChannelForHtmlRequest","htmlRequestId","get","delete","setReactDebugChannelForHtmlRequest","set","deleteReactDebugChannelForHtmlRequest"],"mappings":"AAAA,SAASA,6BAA6B,QAAQ,0CAAyC;AACvF,SACEC,2BAA2B,QAEtB,uBAAsB;AAO7B,MAAMC,oCAAoC,IAAIC;AAK9C,OAAO,SAASC,yBACdC,SAAiB,EACjBC,YAAyC,EACzCC,YAAwD;IAExD,MAAMC,SAASF,aAAaG,QAAQ,CACjCC,WAAW,CACV,yEAAyE;IACzEV,8BAA8B;QAAEW,qBAAqB,MAAM;IAAK,IAEjEC,SAAS;IAEZ,MAAMC,OAAO;QACXN,aAAa;YACXO,MAAMb,4BAA4Bc,iBAAiB;YACnDV;YACAW,OAAO;QACT;IACF;IAEA,MAAMC,UAAU,CAACC;QACfC,QAAQC,KAAK,CAAC,qBAA6D,CAA7D,IAAIC,MAAM,oCAAoC;YAAEC,OAAO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