react-server-dom-turbopack
Advanced tools
Comparing version 19.0.0-rc-b57d2823-20240822 to 19.0.0-rc-b7e21579-20241031
@@ -17,6 +17,6 @@ /** | ||
var moduleExports = bundlerConfig[metadata[0]]; | ||
if ((bundlerConfig = moduleExports[metadata[2]])) | ||
if ((bundlerConfig = moduleExports && moduleExports[metadata[2]])) | ||
moduleExports = bundlerConfig.name; | ||
else { | ||
bundlerConfig = moduleExports["*"]; | ||
bundlerConfig = moduleExports && moduleExports["*"]; | ||
if (!bundlerConfig) | ||
@@ -26,3 +26,3 @@ throw Error( | ||
metadata[0] + | ||
'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.' | ||
'" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
@@ -37,2 +37,20 @@ moduleExports = metadata[2]; | ||
} | ||
function resolveServerReference(bundlerConfig, id) { | ||
var name = "", | ||
resolvedModuleData = bundlerConfig[id]; | ||
if (resolvedModuleData) name = resolvedModuleData.name; | ||
else { | ||
var idx = id.lastIndexOf("#"); | ||
-1 !== idx && | ||
((name = id.slice(idx + 1)), | ||
(resolvedModuleData = bundlerConfig[id.slice(0, idx)])); | ||
if (!resolvedModuleData) | ||
throw Error( | ||
'Could not find the module "' + | ||
id + | ||
'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
} | ||
return [resolvedModuleData.id, resolvedModuleData.chunks, name]; | ||
} | ||
var chunkCache = new Map(); | ||
@@ -78,2 +96,16 @@ function requireAsyncModule(id) { | ||
} | ||
function requireModule(metadata) { | ||
var moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
return "*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
} | ||
var ReactDOMSharedInternals = | ||
@@ -454,8 +486,13 @@ ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, | ||
writtenObjects = new WeakMap(), | ||
modelRoot = root; | ||
root = serializeModel(root, 0); | ||
modelRoot = root, | ||
json = serializeModel(root, 0); | ||
null === formData | ||
? resolve(root) | ||
: (formData.set(formFieldPrefix + "0", root), | ||
? resolve(json) | ||
: (formData.set(formFieldPrefix + "0", json), | ||
0 === pendingParts && resolve(formData)); | ||
return function () { | ||
0 < pendingParts && | ||
((pendingParts = 0), | ||
null === formData ? resolve(json) : resolve(formData)); | ||
}; | ||
} | ||
@@ -640,18 +677,5 @@ function registerServerReference(proxy, reference) { | ||
try { | ||
var metadata = chunk.value, | ||
moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
var JSCompiler_inline_result = | ||
"*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
var value = requireModule(chunk.value); | ||
chunk.status = "fulfilled"; | ||
chunk.value = JSCompiler_inline_result; | ||
chunk.value = value; | ||
} catch (error) { | ||
@@ -696,11 +720,15 @@ (chunk.status = "rejected"), (chunk.reason = error); | ||
} | ||
parentObject[key] = map(response, value); | ||
"" === key && null === handler.value && (handler.value = parentObject[key]); | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"3" === key && | ||
i = map(response, value, parentObject, key); | ||
parentObject[key] = i; | ||
"" === key && null === handler.value && (handler.value = i); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE && | ||
null === handler.value.props && | ||
(handler.value.props = parentObject[key]); | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((value = handler.value), key)) { | ||
case "3": | ||
value.props = i; | ||
} | ||
handler.deps--; | ||
@@ -740,4 +768,66 @@ 0 === handler.deps && | ||
} | ||
function createServerReferenceProxy(response, metaData) { | ||
return createBoundServerReference(metaData, response._callServer); | ||
function loadServerReference(response, metaData, parentObject, key) { | ||
if (!response._serverReferenceConfig) | ||
return createBoundServerReference(metaData, response._callServer); | ||
var serverReference = resolveServerReference( | ||
response._serverReferenceConfig, | ||
metaData.id | ||
); | ||
if ((response = preloadModule(serverReference))) | ||
metaData.bound && (response = Promise.all([response, metaData.bound])); | ||
else if (metaData.bound) response = Promise.resolve(metaData.bound); | ||
else return requireModule(serverReference); | ||
if (initializingHandler) { | ||
var handler = initializingHandler; | ||
handler.deps++; | ||
} else | ||
handler = initializingHandler = { | ||
parent: null, | ||
chunk: null, | ||
value: null, | ||
deps: 1, | ||
errored: !1 | ||
}; | ||
response.then( | ||
function () { | ||
var resolvedValue = requireModule(serverReference); | ||
if (metaData.bound) { | ||
var boundArgs = metaData.bound.value.slice(0); | ||
boundArgs.unshift(null); | ||
resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs); | ||
} | ||
parentObject[key] = resolvedValue; | ||
"" === key && null === handler.value && (handler.value = resolvedValue); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((boundArgs = handler.value), key)) { | ||
case "3": | ||
boundArgs.props = resolvedValue; | ||
} | ||
handler.deps--; | ||
0 === handler.deps && | ||
((resolvedValue = handler.chunk), | ||
null !== resolvedValue && | ||
"blocked" === resolvedValue.status && | ||
((boundArgs = resolvedValue.value), | ||
(resolvedValue.status = "fulfilled"), | ||
(resolvedValue.value = handler.value), | ||
null !== boundArgs && wakeChunk(boundArgs, handler.value))); | ||
}, | ||
function (error) { | ||
if (!handler.errored) { | ||
handler.errored = !0; | ||
handler.value = error; | ||
var chunk = handler.chunk; | ||
null !== chunk && | ||
"blocked" === chunk.status && | ||
triggerErrorOnChunk(chunk, error); | ||
} | ||
} | ||
); | ||
return null; | ||
} | ||
@@ -758,6 +848,4 @@ function getOutlinedModel(response, reference, parentObject, key, map) { | ||
var value = id.value; | ||
for (id = 1; id < reference.length; id++) | ||
if ( | ||
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) | ||
) | ||
for (id = 1; id < reference.length; id++) { | ||
for (; value.$$typeof === REACT_LAZY_TYPE; ) | ||
if (((value = value._payload), "fulfilled" === value.status)) | ||
@@ -772,5 +860,7 @@ value = value.value; | ||
map, | ||
reference.slice(id) | ||
reference.slice(id - 1) | ||
); | ||
return map(response, value); | ||
value = value[reference[id]]; | ||
} | ||
return map(response, value, parentObject, key); | ||
case "pending": | ||
@@ -854,3 +944,3 @@ case "blocked": | ||
key, | ||
createServerReferenceProxy | ||
loadServerReference | ||
) | ||
@@ -886,2 +976,4 @@ ); | ||
); | ||
case "Z": | ||
return resolveErrorProd(); | ||
case "i": | ||
@@ -920,2 +1012,3 @@ return ( | ||
bundlerConfig, | ||
serverReferenceConfig, | ||
moduleLoading, | ||
@@ -929,2 +1022,3 @@ callServer, | ||
this._bundlerConfig = bundlerConfig; | ||
this._serverReferenceConfig = serverReferenceConfig; | ||
this._moduleLoading = moduleLoading; | ||
@@ -1162,2 +1256,9 @@ this._callServer = void 0 !== callServer ? callServer : missingCall; | ||
} | ||
function resolveErrorProd() { | ||
var error = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
error.stack = "Error: " + error.message; | ||
return error; | ||
} | ||
function mergeBuffer(buffer, lastChunk) { | ||
@@ -1298,8 +1399,5 @@ for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++) | ||
case 69: | ||
tag = JSON.parse(buffer).digest; | ||
buffer = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
buffer.stack = "Error: " + buffer.message; | ||
buffer.digest = tag; | ||
tag = JSON.parse(buffer); | ||
buffer = resolveErrorProd(); | ||
buffer.digest = tag.digest; | ||
tag = response._chunks; | ||
@@ -1392,2 +1490,3 @@ (chunk = tag.get(id)) | ||
null, | ||
null, | ||
options && options.callServer ? options.callServer : void 0, | ||
@@ -1522,3 +1621,3 @@ void 0, | ||
return new Promise(function (resolve, reject) { | ||
processReply( | ||
var abort = processReply( | ||
value, | ||
@@ -1532,3 +1631,14 @@ "", | ||
); | ||
if (options && options.signal) { | ||
var signal = options.signal; | ||
if (signal.aborted) abort(signal.reason); | ||
else { | ||
var listener = function () { | ||
abort(signal.reason); | ||
signal.removeEventListener("abort", listener); | ||
}; | ||
signal.addEventListener("abort", listener); | ||
} | ||
} | ||
}); | ||
}; |
@@ -17,6 +17,6 @@ /** | ||
var moduleExports = bundlerConfig[metadata[0]]; | ||
if ((bundlerConfig = moduleExports[metadata[2]])) | ||
if ((bundlerConfig = moduleExports && moduleExports[metadata[2]])) | ||
moduleExports = bundlerConfig.name; | ||
else { | ||
bundlerConfig = moduleExports["*"]; | ||
bundlerConfig = moduleExports && moduleExports["*"]; | ||
if (!bundlerConfig) | ||
@@ -26,3 +26,3 @@ throw Error( | ||
metadata[0] + | ||
'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.' | ||
'" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
@@ -37,2 +37,20 @@ moduleExports = metadata[2]; | ||
} | ||
function resolveServerReference(bundlerConfig, id) { | ||
var name = "", | ||
resolvedModuleData = bundlerConfig[id]; | ||
if (resolvedModuleData) name = resolvedModuleData.name; | ||
else { | ||
var idx = id.lastIndexOf("#"); | ||
-1 !== idx && | ||
((name = id.slice(idx + 1)), | ||
(resolvedModuleData = bundlerConfig[id.slice(0, idx)])); | ||
if (!resolvedModuleData) | ||
throw Error( | ||
'Could not find the module "' + | ||
id + | ||
'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
} | ||
return [resolvedModuleData.id, resolvedModuleData.chunks, name]; | ||
} | ||
var chunkCache = new Map(); | ||
@@ -78,2 +96,16 @@ function requireAsyncModule(id) { | ||
} | ||
function requireModule(metadata) { | ||
var moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
return "*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
} | ||
function prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) { | ||
@@ -475,8 +507,13 @@ if (null !== moduleLoading) | ||
writtenObjects = new WeakMap(), | ||
modelRoot = root; | ||
root = serializeModel(root, 0); | ||
modelRoot = root, | ||
json = serializeModel(root, 0); | ||
null === formData | ||
? resolve(root) | ||
: (formData.set(formFieldPrefix + "0", root), | ||
? resolve(json) | ||
: (formData.set(formFieldPrefix + "0", json), | ||
0 === pendingParts && resolve(formData)); | ||
return function () { | ||
0 < pendingParts && | ||
((pendingParts = 0), | ||
null === formData ? resolve(json) : resolve(formData)); | ||
}; | ||
} | ||
@@ -803,18 +840,5 @@ var boundCache = new WeakMap(); | ||
try { | ||
var metadata = chunk.value, | ||
moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
var JSCompiler_inline_result = | ||
"*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
var value = requireModule(chunk.value); | ||
chunk.status = "fulfilled"; | ||
chunk.value = JSCompiler_inline_result; | ||
chunk.value = value; | ||
} catch (error) { | ||
@@ -859,11 +883,15 @@ (chunk.status = "rejected"), (chunk.reason = error); | ||
} | ||
parentObject[key] = map(response, value); | ||
"" === key && null === handler.value && (handler.value = parentObject[key]); | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"3" === key && | ||
i = map(response, value, parentObject, key); | ||
parentObject[key] = i; | ||
"" === key && null === handler.value && (handler.value = i); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE && | ||
null === handler.value.props && | ||
(handler.value.props = parentObject[key]); | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((value = handler.value), key)) { | ||
case "3": | ||
value.props = i; | ||
} | ||
handler.deps--; | ||
@@ -903,8 +931,70 @@ 0 === handler.deps && | ||
} | ||
function createServerReferenceProxy(response, metaData) { | ||
return createBoundServerReference( | ||
metaData, | ||
response._callServer, | ||
response._encodeFormAction | ||
function loadServerReference(response, metaData, parentObject, key) { | ||
if (!response._serverReferenceConfig) | ||
return createBoundServerReference( | ||
metaData, | ||
response._callServer, | ||
response._encodeFormAction | ||
); | ||
var serverReference = resolveServerReference( | ||
response._serverReferenceConfig, | ||
metaData.id | ||
); | ||
if ((response = preloadModule(serverReference))) | ||
metaData.bound && (response = Promise.all([response, metaData.bound])); | ||
else if (metaData.bound) response = Promise.resolve(metaData.bound); | ||
else return requireModule(serverReference); | ||
if (initializingHandler) { | ||
var handler = initializingHandler; | ||
handler.deps++; | ||
} else | ||
handler = initializingHandler = { | ||
parent: null, | ||
chunk: null, | ||
value: null, | ||
deps: 1, | ||
errored: !1 | ||
}; | ||
response.then( | ||
function () { | ||
var resolvedValue = requireModule(serverReference); | ||
if (metaData.bound) { | ||
var boundArgs = metaData.bound.value.slice(0); | ||
boundArgs.unshift(null); | ||
resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs); | ||
} | ||
parentObject[key] = resolvedValue; | ||
"" === key && null === handler.value && (handler.value = resolvedValue); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((boundArgs = handler.value), key)) { | ||
case "3": | ||
boundArgs.props = resolvedValue; | ||
} | ||
handler.deps--; | ||
0 === handler.deps && | ||
((resolvedValue = handler.chunk), | ||
null !== resolvedValue && | ||
"blocked" === resolvedValue.status && | ||
((boundArgs = resolvedValue.value), | ||
(resolvedValue.status = "fulfilled"), | ||
(resolvedValue.value = handler.value), | ||
null !== boundArgs && wakeChunk(boundArgs, handler.value))); | ||
}, | ||
function (error) { | ||
if (!handler.errored) { | ||
handler.errored = !0; | ||
handler.value = error; | ||
var chunk = handler.chunk; | ||
null !== chunk && | ||
"blocked" === chunk.status && | ||
triggerErrorOnChunk(chunk, error); | ||
} | ||
} | ||
); | ||
return null; | ||
} | ||
@@ -925,6 +1015,4 @@ function getOutlinedModel(response, reference, parentObject, key, map) { | ||
var value = id.value; | ||
for (id = 1; id < reference.length; id++) | ||
if ( | ||
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) | ||
) | ||
for (id = 1; id < reference.length; id++) { | ||
for (; value.$$typeof === REACT_LAZY_TYPE; ) | ||
if (((value = value._payload), "fulfilled" === value.status)) | ||
@@ -939,5 +1027,7 @@ value = value.value; | ||
map, | ||
reference.slice(id) | ||
reference.slice(id - 1) | ||
); | ||
return map(response, value); | ||
value = value[reference[id]]; | ||
} | ||
return map(response, value, parentObject, key); | ||
case "pending": | ||
@@ -1021,3 +1111,3 @@ case "blocked": | ||
key, | ||
createServerReferenceProxy | ||
loadServerReference | ||
) | ||
@@ -1053,2 +1143,4 @@ ); | ||
); | ||
case "Z": | ||
return resolveErrorProd(); | ||
case "i": | ||
@@ -1087,2 +1179,3 @@ return ( | ||
bundlerConfig, | ||
serverReferenceConfig, | ||
moduleLoading, | ||
@@ -1096,2 +1189,3 @@ callServer, | ||
this._bundlerConfig = bundlerConfig; | ||
this._serverReferenceConfig = serverReferenceConfig; | ||
this._moduleLoading = moduleLoading; | ||
@@ -1334,2 +1428,9 @@ this._callServer = void 0 !== callServer ? callServer : missingCall; | ||
} | ||
function resolveErrorProd() { | ||
var error = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
error.stack = "Error: " + error.message; | ||
return error; | ||
} | ||
function mergeBuffer(buffer, lastChunk) { | ||
@@ -1470,8 +1571,5 @@ for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++) | ||
case 69: | ||
tag = JSON.parse(buffer).digest; | ||
buffer = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
buffer.stack = "Error: " + buffer.message; | ||
buffer.digest = tag; | ||
tag = JSON.parse(buffer); | ||
buffer = resolveErrorProd(); | ||
buffer.digest = tag.digest; | ||
tag = response._chunks; | ||
@@ -1567,4 +1665,5 @@ (chunk = tag.get(id)) | ||
return new ResponseInstance( | ||
options.ssrManifest.moduleMap, | ||
options.ssrManifest.moduleLoading, | ||
options.serverConsumerManifest.moduleMap, | ||
options.serverConsumerManifest.serverModuleMap, | ||
options.serverConsumerManifest.moduleLoading, | ||
noServerCall, | ||
@@ -1694,3 +1793,3 @@ options.encodeFormAction, | ||
return new Promise(function (resolve, reject) { | ||
processReply( | ||
var abort = processReply( | ||
value, | ||
@@ -1704,3 +1803,14 @@ "", | ||
); | ||
if (options && options.signal) { | ||
var signal = options.signal; | ||
if (signal.aborted) abort(signal.reason); | ||
else { | ||
var listener = function () { | ||
abort(signal.reason); | ||
signal.removeEventListener("abort", listener); | ||
}; | ||
signal.addEventListener("abort", listener); | ||
} | ||
} | ||
}); | ||
}; |
@@ -18,6 +18,6 @@ /** | ||
var moduleExports = bundlerConfig[metadata[0]]; | ||
if ((bundlerConfig = moduleExports[metadata[2]])) | ||
if ((bundlerConfig = moduleExports && moduleExports[metadata[2]])) | ||
moduleExports = bundlerConfig.name; | ||
else { | ||
bundlerConfig = moduleExports["*"]; | ||
bundlerConfig = moduleExports && moduleExports["*"]; | ||
if (!bundlerConfig) | ||
@@ -27,3 +27,3 @@ throw Error( | ||
metadata[0] + | ||
'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.' | ||
'" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
@@ -38,2 +38,20 @@ moduleExports = metadata[2]; | ||
} | ||
function resolveServerReference(bundlerConfig, id) { | ||
var name = "", | ||
resolvedModuleData = bundlerConfig[id]; | ||
if (resolvedModuleData) name = resolvedModuleData.name; | ||
else { | ||
var idx = id.lastIndexOf("#"); | ||
-1 !== idx && | ||
((name = id.slice(idx + 1)), | ||
(resolvedModuleData = bundlerConfig[id.slice(0, idx)])); | ||
if (!resolvedModuleData) | ||
throw Error( | ||
'Could not find the module "' + | ||
id + | ||
'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.' | ||
); | ||
} | ||
return [resolvedModuleData.id, resolvedModuleData.chunks, name]; | ||
} | ||
var chunkCache = new Map(); | ||
@@ -79,2 +97,16 @@ function requireAsyncModule(id) { | ||
} | ||
function requireModule(metadata) { | ||
var moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
return "*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
} | ||
function prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) { | ||
@@ -476,8 +508,13 @@ if (null !== moduleLoading) | ||
writtenObjects = new WeakMap(), | ||
modelRoot = root; | ||
root = serializeModel(root, 0); | ||
modelRoot = root, | ||
json = serializeModel(root, 0); | ||
null === formData | ||
? resolve(root) | ||
: (formData.set(formFieldPrefix + "0", root), | ||
? resolve(json) | ||
: (formData.set(formFieldPrefix + "0", json), | ||
0 === pendingParts && resolve(formData)); | ||
return function () { | ||
0 < pendingParts && | ||
((pendingParts = 0), | ||
null === formData ? resolve(json) : resolve(formData)); | ||
}; | ||
} | ||
@@ -804,18 +841,5 @@ var boundCache = new WeakMap(); | ||
try { | ||
var metadata = chunk.value, | ||
moduleExports = __turbopack_require__(metadata[0]); | ||
if (4 === metadata.length && "function" === typeof moduleExports.then) | ||
if ("fulfilled" === moduleExports.status) | ||
moduleExports = moduleExports.value; | ||
else throw moduleExports.reason; | ||
var JSCompiler_inline_result = | ||
"*" === metadata[2] | ||
? moduleExports | ||
: "" === metadata[2] | ||
? moduleExports.__esModule | ||
? moduleExports.default | ||
: moduleExports | ||
: moduleExports[metadata[2]]; | ||
var value = requireModule(chunk.value); | ||
chunk.status = "fulfilled"; | ||
chunk.value = JSCompiler_inline_result; | ||
chunk.value = value; | ||
} catch (error) { | ||
@@ -860,11 +884,15 @@ (chunk.status = "rejected"), (chunk.reason = error); | ||
} | ||
parentObject[key] = map(response, value); | ||
"" === key && null === handler.value && (handler.value = parentObject[key]); | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"3" === key && | ||
i = map(response, value, parentObject, key); | ||
parentObject[key] = i; | ||
"" === key && null === handler.value && (handler.value = i); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE && | ||
null === handler.value.props && | ||
(handler.value.props = parentObject[key]); | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((value = handler.value), key)) { | ||
case "3": | ||
value.props = i; | ||
} | ||
handler.deps--; | ||
@@ -904,8 +932,70 @@ 0 === handler.deps && | ||
} | ||
function createServerReferenceProxy(response, metaData) { | ||
return createBoundServerReference( | ||
metaData, | ||
response._callServer, | ||
response._encodeFormAction | ||
function loadServerReference(response, metaData, parentObject, key) { | ||
if (!response._serverReferenceConfig) | ||
return createBoundServerReference( | ||
metaData, | ||
response._callServer, | ||
response._encodeFormAction | ||
); | ||
var serverReference = resolveServerReference( | ||
response._serverReferenceConfig, | ||
metaData.id | ||
); | ||
if ((response = preloadModule(serverReference))) | ||
metaData.bound && (response = Promise.all([response, metaData.bound])); | ||
else if (metaData.bound) response = Promise.resolve(metaData.bound); | ||
else return requireModule(serverReference); | ||
if (initializingHandler) { | ||
var handler = initializingHandler; | ||
handler.deps++; | ||
} else | ||
handler = initializingHandler = { | ||
parent: null, | ||
chunk: null, | ||
value: null, | ||
deps: 1, | ||
errored: !1 | ||
}; | ||
response.then( | ||
function () { | ||
var resolvedValue = requireModule(serverReference); | ||
if (metaData.bound) { | ||
var boundArgs = metaData.bound.value.slice(0); | ||
boundArgs.unshift(null); | ||
resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs); | ||
} | ||
parentObject[key] = resolvedValue; | ||
"" === key && null === handler.value && (handler.value = resolvedValue); | ||
if ( | ||
parentObject[0] === REACT_ELEMENT_TYPE && | ||
"object" === typeof handler.value && | ||
null !== handler.value && | ||
handler.value.$$typeof === REACT_ELEMENT_TYPE | ||
) | ||
switch (((boundArgs = handler.value), key)) { | ||
case "3": | ||
boundArgs.props = resolvedValue; | ||
} | ||
handler.deps--; | ||
0 === handler.deps && | ||
((resolvedValue = handler.chunk), | ||
null !== resolvedValue && | ||
"blocked" === resolvedValue.status && | ||
((boundArgs = resolvedValue.value), | ||
(resolvedValue.status = "fulfilled"), | ||
(resolvedValue.value = handler.value), | ||
null !== boundArgs && wakeChunk(boundArgs, handler.value))); | ||
}, | ||
function (error) { | ||
if (!handler.errored) { | ||
handler.errored = !0; | ||
handler.value = error; | ||
var chunk = handler.chunk; | ||
null !== chunk && | ||
"blocked" === chunk.status && | ||
triggerErrorOnChunk(chunk, error); | ||
} | ||
} | ||
); | ||
return null; | ||
} | ||
@@ -926,6 +1016,4 @@ function getOutlinedModel(response, reference, parentObject, key, map) { | ||
var value = id.value; | ||
for (id = 1; id < reference.length; id++) | ||
if ( | ||
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE) | ||
) | ||
for (id = 1; id < reference.length; id++) { | ||
for (; value.$$typeof === REACT_LAZY_TYPE; ) | ||
if (((value = value._payload), "fulfilled" === value.status)) | ||
@@ -940,5 +1028,7 @@ value = value.value; | ||
map, | ||
reference.slice(id) | ||
reference.slice(id - 1) | ||
); | ||
return map(response, value); | ||
value = value[reference[id]]; | ||
} | ||
return map(response, value, parentObject, key); | ||
case "pending": | ||
@@ -1022,3 +1112,3 @@ case "blocked": | ||
key, | ||
createServerReferenceProxy | ||
loadServerReference | ||
) | ||
@@ -1054,2 +1144,4 @@ ); | ||
); | ||
case "Z": | ||
return resolveErrorProd(); | ||
case "i": | ||
@@ -1088,2 +1180,3 @@ return ( | ||
bundlerConfig, | ||
serverReferenceConfig, | ||
moduleLoading, | ||
@@ -1097,2 +1190,3 @@ callServer, | ||
this._bundlerConfig = bundlerConfig; | ||
this._serverReferenceConfig = serverReferenceConfig; | ||
this._moduleLoading = moduleLoading; | ||
@@ -1335,2 +1429,9 @@ this._callServer = void 0 !== callServer ? callServer : missingCall; | ||
} | ||
function resolveErrorProd() { | ||
var error = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
error.stack = "Error: " + error.message; | ||
return error; | ||
} | ||
function mergeBuffer(buffer, lastChunk) { | ||
@@ -1471,8 +1572,5 @@ for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++) | ||
case 69: | ||
tag = JSON.parse(buffer).digest; | ||
buffer = Error( | ||
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error." | ||
); | ||
buffer.stack = "Error: " + buffer.message; | ||
buffer.digest = tag; | ||
tag = JSON.parse(buffer); | ||
buffer = resolveErrorProd(); | ||
buffer.digest = tag.digest; | ||
tag = response._chunks; | ||
@@ -1566,6 +1664,11 @@ (chunk = tag.get(id)) | ||
} | ||
exports.createFromNodeStream = function (stream, ssrManifest, options) { | ||
exports.createFromNodeStream = function ( | ||
stream, | ||
serverConsumerManifest, | ||
options | ||
) { | ||
var response = new ResponseInstance( | ||
ssrManifest.moduleMap, | ||
ssrManifest.moduleLoading, | ||
serverConsumerManifest.moduleMap, | ||
serverConsumerManifest.serverModuleMap, | ||
serverConsumerManifest.moduleLoading, | ||
noServerCall, | ||
@@ -1572,0 +1675,0 @@ options ? options.encodeFormAction : void 0, |
{ | ||
"name": "react-server-dom-turbopack", | ||
"description": "React Server Components bindings for DOM using Turbopack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.", | ||
"version": "19.0.0-rc-b57d2823-20240822", | ||
"version": "19.0.0-rc-b7e21579-20241031", | ||
"keywords": [ | ||
@@ -81,4 +81,4 @@ "react" | ||
"peerDependencies": { | ||
"react": "19.0.0-rc-b57d2823-20240822", | ||
"react-dom": "19.0.0-rc-b57d2823-20240822" | ||
"react": "19.0.0-rc-b7e21579-20241031", | ||
"react-dom": "19.0.0-rc-b7e21579-20241031" | ||
}, | ||
@@ -85,0 +85,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1157405
33022