react-markup 0.0.0-experimental-2d16326d-20240930 → 0.0.0-experimental-459fd418-20241001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1171,9 +1171,10 @@
|
|
|
1171
1171
|
null === task.debugStack
|
|
1172
1172
|
? null
|
|
1173
1173
|
: filterStackTrace(request, task.debugStack, 1);
|
|
1174
|
+
componentDebugInfo.props = props;
|
|
1174
1175
|
componentDebugInfo.debugStack = task.debugStack;
|
|
1175
1176
|
componentDebugInfo.debugTask = task.debugTask;
|
|
1176
|
-
|
|
1177
|
+
outlineComponentInfo(request, componentDebugInfo);
|
|
1177
1178
|
emitDebugChunk(request, componentDebugID, componentDebugInfo);
|
|
1178
1179
|
task.environmentName = componentEnv;
|
|
1179
1180
|
2 === validated &&
|
|
@@ -1383,6 +1384,7 @@
|
|
|
1383
1384
|
null === task.debugStack
|
|
1384
1385
|
? null
|
|
1385
1386
|
: filterStackTrace(request, task.debugStack, 1),
|
|
1387
|
+
props: props,
|
|
1386
1388
|
debugStack: task.debugStack,
|
|
1387
1389
|
debugTask: task.debugTask
|
|
1388
1390
|
}),
|
|
@@ -1450,6 +1452,8 @@
|
|
|
1450
1452
|
);
|
|
1451
1453
|
ref = task.keyPath;
|
|
1452
1454
|
null === key ? (key = ref) : null !== ref && (key = ref + "," + key);
|
|
1455
|
+
null !== task.debugOwner &&
|
|
1456
|
+
outlineComponentInfo(request, task.debugOwner);
|
|
1453
1457
|
request = [
|
|
1454
1458
|
REACT_ELEMENT_TYPE,
|
|
1455
1459
|
type,
|
|
@@ -1657,18 +1661,6 @@
|
|
|
1657
1661
|
reader.read().then(progress).catch(error);
|
|
1658
1662
|
return "$B" + newTask.id.toString(16);
|
|
1659
1663
|
}
|
|
1660
|
-
function isReactComponentInfo(value) {
|
|
1661
|
-
return (
|
|
1662
|
-
(("object" === typeof value.debugTask &&
|
|
1663
|
-
null !== value.debugTask &&
|
|
1664
|
-
"function" === typeof value.debugTask.run) ||
|
|
1665
|
-
value.debugStack instanceof Error) &&
|
|
1666
|
-
(isArrayImpl(value.stack) || null === value.stack) &&
|
|
1667
|
-
"string" === typeof value.name &&
|
|
1668
|
-
"string" === typeof value.env &&
|
|
1669
|
-
void 0 !== value.owner
|
|
1670
|
-
);
|
|
1671
|
-
}
|
|
1672
1664
|
function renderModel(request, task, parent, key, value) {
|
|
1673
1665
|
var prevKeyPath = task.keyPath,
|
|
1674
1666
|
prevImplicitSlot = task.implicitSlot;
|
|
@@ -1877,6 +1869,7 @@
|
|
|
1877
1869
|
if (value instanceof Set) return serializeSet(request, value);
|
|
1878
1870
|
if ("function" === typeof FormData && value instanceof FormData)
|
|
1879
1871
|
return serializeFormData(request, value);
|
|
1872
|
+
if (value instanceof Error) return serializeErrorValue(request, value);
|
|
1880
1873
|
if (value instanceof ArrayBuffer)
|
|
1881
1874
|
return serializeTypedArray(request, "A", new Uint8Array(value));
|
|
1882
1875
|
if (value instanceof Int8Array)
|
|
@@ -1931,17 +1924,6 @@
|
|
|
1931
1924
|
"Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." +
|
|
1932
1925
|
describeObjectForErrorMessage(parent, parentPropertyName)
|
|
1933
1926
|
);
|
|
1934
|
-
if (isReactComponentInfo(value))
|
|
1935
|
-
return (
|
|
1936
|
-
(request = {
|
|
1937
|
-
name: value.name,
|
|
1938
|
-
env: value.env,
|
|
1939
|
-
key: value.key,
|
|
1940
|
-
owner: value.owner
|
|
1941
|
-
}),
|
|
1942
|
-
(request.stack = value.stack),
|
|
1943
|
-
request
|
|
1944
|
-
);
|
|
1945
1927
|
if ("Object" !== objectName(value))
|
|
1946
1928
|
callWithDebugContextInDEV(request, task, function () {
|
|
1947
1929
|
console.error(
|
|
@@ -2119,6 +2101,27 @@
|
|
|
2119
2101
|
"\n";
|
|
2120
2102
|
request.completedErrorChunks.push(id);
|
|
2121
2103
|
}
|
|
2104
|
+
function serializeErrorValue(request, error) {
|
|
2105
|
+
var env = (0, request.environmentName)();
|
|
2106
|
+
try {
|
|
2107
|
+
var message = String(error.message);
|
|
2108
|
+
var stack = filterStackTrace(request, error, 0);
|
|
2109
|
+
var errorEnv = error.environmentName;
|
|
2110
|
+
"string" === typeof errorEnv && (env = errorEnv);
|
|
2111
|
+
} catch (x) {
|
|
2112
|
+
(message =
|
|
2113
|
+
"An error occurred but serializing the error message failed."),
|
|
2114
|
+
(stack = []);
|
|
2115
|
+
}
|
|
2116
|
+
return (
|
|
2117
|
+
"$Z" +
|
|
2118
|
+
outlineModel(request, {
|
|
2119
|
+
message: message,
|
|
2120
|
+
stack: stack,
|
|
2121
|
+
env: env
|
|
2122
|
+
}).toString(16)
|
|
2123
|
+
);
|
|
2124
|
+
}
|
|
2122
2125
|
function emitErrorChunk(request, id, digest, error) {
|
|
2123
2126
|
var env = (0, request.environmentName)();
|
|
2124
2127
|
try {
|
|
@@ -2151,7 +2154,7 @@
|
|
|
2151
2154
|
request.completedRegularChunks.push(id);
|
|
2152
2155
|
}
|
|
2153
2156
|
function emitDebugChunk(request, id, debugInfo) {
|
|
2154
|
-
var counter = {
|
|
2157
|
+
var counter = { objectLimit: 500 };
|
|
2155
2158
|
debugInfo = stringify(debugInfo, function (parentPropertyName, value) {
|
|
2156
2159
|
return renderConsoleValue(
|
|
2157
2160
|
request,
|
|
@@ -2164,6 +2167,33 @@
|
|
|
2164
2167
|
id = id.toString(16) + ":D" + debugInfo + "\n";
|
|
2165
2168
|
request.completedRegularChunks.push(id);
|
|
2166
2169
|
}
|
|
2170
|
+
function outlineComponentInfo(request, componentInfo) {
|
|
2171
|
+
if (!request.writtenObjects.has(componentInfo)) {
|
|
2172
|
+
null != componentInfo.owner &&
|
|
2173
|
+
outlineComponentInfo(request, componentInfo.owner);
|
|
2174
|
+
var objectLimit = 10;
|
|
2175
|
+
null != componentInfo.stack &&
|
|
2176
|
+
(objectLimit += componentInfo.stack.length);
|
|
2177
|
+
objectLimit = { objectLimit: objectLimit };
|
|
2178
|
+
var componentDebugInfo = {
|
|
2179
|
+
name: componentInfo.name,
|
|
2180
|
+
env: componentInfo.env,
|
|
2181
|
+
key: componentInfo.key,
|
|
2182
|
+
owner: componentInfo.owner
|
|
2183
|
+
};
|
|
2184
|
+
componentDebugInfo.stack = componentInfo.stack;
|
|
2185
|
+
componentDebugInfo.props = componentInfo.props;
|
|
2186
|
+
objectLimit = outlineConsoleValue(
|
|
2187
|
+
request,
|
|
2188
|
+
objectLimit,
|
|
2189
|
+
componentDebugInfo
|
|
2190
|
+
);
|
|
2191
|
+
request.writtenObjects.set(
|
|
2192
|
+
componentInfo,
|
|
2193
|
+
serializeByValueID$1(objectLimit)
|
|
2194
|
+
);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2167
2197
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
|
2168
2198
|
TaintRegistryByteLengths.has(typedArray.byteLength) &&
|
|
2169
2199
|
((id = TaintRegistryValues.get(
|
|
@@ -2202,11 +2232,39 @@
|
|
|
2202
2232
|
((parent = request.temporaryReferences.get(value)), void 0 !== parent)
|
|
2203
2233
|
)
|
|
2204
2234
|
return "$T" + parent;
|
|
2205
|
-
if (500 < counter.objectCount) return "$Y";
|
|
2206
|
-
counter.objectCount++;
|
|
2207
2235
|
parent = request.writtenObjects.get(value);
|
|
2236
|
+
if (void 0 !== parent) return parent;
|
|
2237
|
+
if (0 >= counter.objectLimit) return "$Y";
|
|
2238
|
+
counter.objectLimit--;
|
|
2239
|
+
switch (value.$$typeof) {
|
|
2240
|
+
case REACT_ELEMENT_TYPE:
|
|
2241
|
+
return (
|
|
2242
|
+
null != value._owner &&
|
|
2243
|
+
outlineComponentInfo(request, value._owner),
|
|
2244
|
+
(counter = null),
|
|
2245
|
+
null != value._debugStack &&
|
|
2246
|
+
((counter = filterStackTrace(request, value._debugStack, 1)),
|
|
2247
|
+
(parent = outlineConsoleValue(
|
|
2248
|
+
request,
|
|
2249
|
+
{ objectLimit: counter.length + 2 },
|
|
2250
|
+
counter
|
|
2251
|
+
)),
|
|
2252
|
+
request.writtenObjects.set(
|
|
2253
|
+
counter,
|
|
2254
|
+
serializeByValueID$1(parent)
|
|
2255
|
+
)),
|
|
2256
|
+
[
|
|
2257
|
+
REACT_ELEMENT_TYPE,
|
|
2258
|
+
value.type,
|
|
2259
|
+
value.key,
|
|
2260
|
+
value.props,
|
|
2261
|
+
value._owner,
|
|
2262
|
+
counter,
|
|
2263
|
+
value._store.validated
|
|
2264
|
+
]
|
|
2265
|
+
);
|
|
2266
|
+
}
|
|
2208
2267
|
if ("function" === typeof value.then) {
|
|
2209
|
-
if (void 0 !== parent) return parent;
|
|
2210
2268
|
switch (value.status) {
|
|
2211
2269
|
case "fulfilled":
|
|
2212
2270
|
return (
|
|
@@ -2228,20 +2286,19 @@
|
|
|
2228
2286
|
}
|
|
2229
2287
|
return "$@";
|
|
2230
2288
|
}
|
|
2231
|
-
return
|
|
2232
|
-
?
|
|
2233
|
-
:
|
|
2234
|
-
? value
|
|
2235
|
-
|
|
2289
|
+
return isArrayImpl(value)
|
|
2290
|
+
? value
|
|
2291
|
+
: value instanceof Map
|
|
2292
|
+
? ((value = Array.from(value)),
|
|
2293
|
+
"$Q" + outlineConsoleValue(request, counter, value).toString(16))
|
|
2294
|
+
: value instanceof Set
|
|
2236
2295
|
? ((value = Array.from(value)),
|
|
2237
|
-
"$
|
|
2296
|
+
"$W" +
|
|
2238
2297
|
outlineConsoleValue(request, counter, value).toString(16))
|
|
2239
|
-
: value instanceof
|
|
2240
|
-
? (
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
: "function" === typeof FormData && value instanceof FormData
|
|
2244
|
-
? serializeFormData(request, value)
|
|
2298
|
+
: "function" === typeof FormData && value instanceof FormData
|
|
2299
|
+
? serializeFormData(request, value)
|
|
2300
|
+
: value instanceof Error
|
|
2301
|
+
? serializeErrorValue(request, value)
|
|
2245
2302
|
: value instanceof ArrayBuffer
|
|
2246
2303
|
? serializeTypedArray(request, "A", new Uint8Array(value))
|
|
2247
2304
|
: value instanceof Int8Array
|
|
@@ -2285,17 +2342,7 @@
|
|
|
2285
2342
|
? serializeBlob(request, value)
|
|
2286
2343
|
: getIteratorFn(value)
|
|
2287
2344
|
? Array.from(value)
|
|
2288
|
-
:
|
|
2289
|
-
? ((request = {
|
|
2290
|
-
name: value.name,
|
|
2291
|
-
env: value.env,
|
|
2292
|
-
key: value.key,
|
|
2293
|
-
owner: value.owner
|
|
2294
|
-
}),
|
|
2295
|
-
(request.stack =
|
|
2296
|
-
value.stack),
|
|
2297
|
-
request)
|
|
2298
|
-
: value;
|
|
2345
|
+
: value;
|
|
2299
2346
|
}
|
|
2300
2347
|
if ("string" === typeof value) {
|
|
2301
2348
|
if ("Z" === value[value.length - 1] && originalValue instanceof Date)
|
|
@@ -2348,7 +2395,10 @@
|
|
|
2348
2395
|
value
|
|
2349
2396
|
);
|
|
2350
2397
|
} catch (x) {
|
|
2351
|
-
return
|
|
2398
|
+
return (
|
|
2399
|
+
"Unknown Value: React could not send it from the server.\n" +
|
|
2400
|
+
x.message
|
|
2401
|
+
);
|
|
2352
2402
|
}
|
|
2353
2403
|
});
|
|
2354
2404
|
request.pendingChunks++;
|
|
@@ -2365,8 +2415,9 @@
|
|
|
2365
2415
|
stackTrace,
|
|
2366
2416
|
args
|
|
2367
2417
|
) {
|
|
2368
|
-
var counter = {
|
|
2369
|
-
|
|
2418
|
+
var counter = { objectLimit: 500 };
|
|
2419
|
+
null != owner && outlineComponentInfo(request, owner);
|
|
2420
|
+
var env = (0, request.environmentName)();
|
|
2370
2421
|
methodName = [methodName, stackTrace, owner, env];
|
|
2371
2422
|
methodName.push.apply(methodName, args);
|
|
2372
2423
|
args = stringify(methodName, function (parentPropertyName, value) {
|
|
@@ -2379,7 +2430,10 @@
|
|
|
2379
2430
|
value
|
|
2380
2431
|
);
|
|
2381
2432
|
} catch (x) {
|
|
2382
|
-
return
|
|
2433
|
+
return (
|
|
2434
|
+
"Unknown Value: React could not send it from the server.\n" +
|
|
2435
|
+
x.message
|
|
2436
|
+
);
|
|
2383
2437
|
}
|
|
2384
2438
|
});
|
|
2385
2439
|
id = id.toString(16) + ":W" + args + "\n";
|
|
@@ -2389,7 +2443,7 @@
|
|
|
2389
2443
|
for (var i = 0; i < debugInfo.length; i++)
|
|
2390
2444
|
request.pendingChunks++,
|
|
2391
2445
|
"string" === typeof debugInfo[i].name &&
|
|
2392
|
-
|
|
2446
|
+
outlineComponentInfo(request, debugInfo[i]),
|
|
2393
2447
|
emitDebugChunk(request, id, debugInfo[i]);
|
|
2394
2448
|
}
|
|
2395
2449
|
function emitChunk(request, task, value) {
|
|
@@ -3137,12 +3191,17 @@
|
|
|
3137
3191
|
pendingParts = 0,
|
|
3138
3192
|
formData = null,
|
|
3139
3193
|
writtenObjects = new WeakMap(),
|
|
3140
|
-
modelRoot = root
|
|
3141
|
-
|
|
3194
|
+
modelRoot = root,
|
|
3195
|
+
json = serializeModel(root, 0);
|
|
3142
3196
|
null === formData
|
|
3143
|
-
? resolve(
|
|
3144
|
-
: (formData.set(formFieldPrefix + "0",
|
|
3197
|
+
? resolve(json)
|
|
3198
|
+
: (formData.set(formFieldPrefix + "0", json),
|
|
3145
3199
|
0 === pendingParts && resolve(formData));
|
|
3200
|
+
return function () {
|
|
3201
|
+
0 < pendingParts &&
|
|
3202
|
+
((pendingParts = 0),
|
|
3203
|
+
null === formData ? resolve(json) : resolve(formData));
|
|
3204
|
+
};
|
|
3146
3205
|
}
|
|
3147
3206
|
function encodeFormData(reference) {
|
|
3148
3207
|
var resolve,
|
|
@@ -3870,6 +3929,17 @@
|
|
|
3870
3929
|
createFormData
|
|
3871
3930
|
)
|
|
3872
3931
|
);
|
|
3932
|
+
case "Z":
|
|
3933
|
+
return (
|
|
3934
|
+
(value = value.slice(2)),
|
|
3935
|
+
getOutlinedModel(
|
|
3936
|
+
response,
|
|
3937
|
+
value,
|
|
3938
|
+
parentObject,
|
|
3939
|
+
key,
|
|
3940
|
+
resolveErrorDev
|
|
3941
|
+
)
|
|
3942
|
+
);
|
|
3873
3943
|
case "i":
|
|
3874
3944
|
return (
|
|
3875
3945
|
(value = value.slice(2)),
|
|
@@ -3963,6 +4033,30 @@
|
|
|
3963
4033
|
this._rootEnvironmentName = environmentName;
|
|
3964
4034
|
this._fromJSON = createFromJSONCallback(this);
|
|
3965
4035
|
}
|
|
4036
|
+
function resolveModel(response, id, model) {
|
|
4037
|
+
var chunks = response._chunks,
|
|
4038
|
+
chunk = chunks.get(id);
|
|
4039
|
+
chunk
|
|
4040
|
+
? resolveModelChunk(chunk, model)
|
|
4041
|
+
: chunks.set(
|
|
4042
|
+
id,
|
|
4043
|
+
new ReactPromise("resolved_model", model, null, response)
|
|
4044
|
+
);
|
|
4045
|
+
}
|
|
4046
|
+
function resolveText(response, id, text) {
|
|
4047
|
+
var chunks = response._chunks,
|
|
4048
|
+
chunk = chunks.get(id);
|
|
4049
|
+
chunk && "pending" !== chunk.status
|
|
4050
|
+
? chunk.reason.enqueueValue(text)
|
|
4051
|
+
: chunks.set(id, new ReactPromise("fulfilled", text, null, response));
|
|
4052
|
+
}
|
|
4053
|
+
function resolveModule(response, id, model) {
|
|
4054
|
+
response._chunks.get(id);
|
|
4055
|
+
JSON.parse(model, response._fromJSON);
|
|
4056
|
+
throw Error(
|
|
4057
|
+
"renderToHTML should not have emitted Client References. This is a bug in React."
|
|
4058
|
+
);
|
|
4059
|
+
}
|
|
3966
4060
|
function resolveStream(response, id, stream, controller) {
|
|
3967
4061
|
var chunks = response._chunks,
|
|
3968
4062
|
chunk = chunks.get(id);
|
|
@@ -4154,6 +4248,46 @@
|
|
|
4154
4248
|
}
|
|
4155
4249
|
);
|
|
4156
4250
|
}
|
|
4251
|
+
function stopStream(response, id, row) {
|
|
4252
|
+
(response = response._chunks.get(id)) &&
|
|
4253
|
+
"fulfilled" === response.status &&
|
|
4254
|
+
response.reason.close("" === row ? '"$undefined"' : row);
|
|
4255
|
+
}
|
|
4256
|
+
function resolveErrorDev(response, errorInfo) {
|
|
4257
|
+
var env = errorInfo.env;
|
|
4258
|
+
errorInfo = buildFakeCallStack(
|
|
4259
|
+
response,
|
|
4260
|
+
errorInfo.stack,
|
|
4261
|
+
env,
|
|
4262
|
+
Error.bind(
|
|
4263
|
+
null,
|
|
4264
|
+
errorInfo.message ||
|
|
4265
|
+
"An error occurred in the Server Components render but no message was provided"
|
|
4266
|
+
)
|
|
4267
|
+
);
|
|
4268
|
+
response = getRootTask(response, env);
|
|
4269
|
+
response = null != response ? response.run(errorInfo) : errorInfo();
|
|
4270
|
+
response.environmentName = env;
|
|
4271
|
+
return response;
|
|
4272
|
+
}
|
|
4273
|
+
function resolvePostponeDev(response, id, reason, stack, env) {
|
|
4274
|
+
reason = buildFakeCallStack(
|
|
4275
|
+
response,
|
|
4276
|
+
stack,
|
|
4277
|
+
env,
|
|
4278
|
+
Error.bind(null, reason || "")
|
|
4279
|
+
);
|
|
4280
|
+
stack = response._debugRootTask;
|
|
4281
|
+
reason = null != stack ? stack.run(reason) : reason();
|
|
4282
|
+
reason.$$typeof = REACT_POSTPONE_TYPE;
|
|
4283
|
+
stack = response._chunks;
|
|
4284
|
+
(env = stack.get(id))
|
|
4285
|
+
? triggerErrorOnChunk(env, reason)
|
|
4286
|
+
: stack.set(id, new ReactPromise("rejected", null, reason, response));
|
|
4287
|
+
}
|
|
4288
|
+
function resolveHint(response, code, model) {
|
|
4289
|
+
JSON.parse(model, response._fromJSON);
|
|
4290
|
+
}
|
|
4157
4291
|
function createFakeFunction(
|
|
4158
4292
|
name,
|
|
4159
4293
|
filename,
|
|
@@ -4295,10 +4429,100 @@
|
|
|
4295
4429
|
null != debugInfo.owner &&
|
|
4296
4430
|
initializeFakeStack(response, debugInfo.owner));
|
|
4297
4431
|
}
|
|
4432
|
+
function resolveDebugInfo(response, id, debugInfo) {
|
|
4433
|
+
initializeFakeTask(
|
|
4434
|
+
response,
|
|
4435
|
+
debugInfo,
|
|
4436
|
+
void 0 === debugInfo.env ? response._rootEnvironmentName : debugInfo.env
|
|
4437
|
+
);
|
|
4438
|
+
null === debugInfo.owner && null != response._debugRootOwner
|
|
4439
|
+
? ((debugInfo.owner = response._debugRootOwner),
|
|
4440
|
+
(debugInfo.debugStack = response._debugRootStack))
|
|
4441
|
+
: initializeFakeStack(response, debugInfo);
|
|
4442
|
+
response = getChunk(response, id);
|
|
4443
|
+
(response._debugInfo || (response._debugInfo = [])).push(debugInfo);
|
|
4444
|
+
}
|
|
4298
4445
|
function getCurrentStackInDEV$1() {
|
|
4299
4446
|
var owner = currentOwnerInDEV;
|
|
4300
4447
|
return null === owner ? "" : getOwnerStackByComponentInfoInDev(owner);
|
|
4301
4448
|
}
|
|
4449
|
+
function resolveConsoleEntry(response, value) {
|
|
4450
|
+
if (response._replayConsole) {
|
|
4451
|
+
var payload = JSON.parse(value, response._fromJSON);
|
|
4452
|
+
value = payload[0];
|
|
4453
|
+
var stackTrace = payload[1],
|
|
4454
|
+
owner = payload[2],
|
|
4455
|
+
env = payload[3];
|
|
4456
|
+
payload = payload.slice(4);
|
|
4457
|
+
replayConsoleWithCallStackInDEV(
|
|
4458
|
+
response,
|
|
4459
|
+
value,
|
|
4460
|
+
stackTrace,
|
|
4461
|
+
owner,
|
|
4462
|
+
env,
|
|
4463
|
+
payload
|
|
4464
|
+
);
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
function processFullStringRow(response, id, tag, row) {
|
|
4468
|
+
switch (tag) {
|
|
4469
|
+
case 73:
|
|
4470
|
+
resolveModule(response, id, row);
|
|
4471
|
+
break;
|
|
4472
|
+
case 72:
|
|
4473
|
+
resolveHint(response, row[0], row.slice(1));
|
|
4474
|
+
break;
|
|
4475
|
+
case 69:
|
|
4476
|
+
row = JSON.parse(row);
|
|
4477
|
+
tag = resolveErrorDev(response, row);
|
|
4478
|
+
tag.digest = row.digest;
|
|
4479
|
+
row = response._chunks;
|
|
4480
|
+
var chunk = row.get(id);
|
|
4481
|
+
chunk
|
|
4482
|
+
? triggerErrorOnChunk(chunk, tag)
|
|
4483
|
+
: row.set(id, new ReactPromise("rejected", null, tag, response));
|
|
4484
|
+
break;
|
|
4485
|
+
case 84:
|
|
4486
|
+
resolveText(response, id, row);
|
|
4487
|
+
break;
|
|
4488
|
+
case 68:
|
|
4489
|
+
tag = new ReactPromise("resolved_model", row, null, response);
|
|
4490
|
+
initializeModelChunk(tag);
|
|
4491
|
+
"fulfilled" === tag.status
|
|
4492
|
+
? resolveDebugInfo(response, id, tag.value)
|
|
4493
|
+
: tag.then(
|
|
4494
|
+
function (v) {
|
|
4495
|
+
return resolveDebugInfo(response, id, v);
|
|
4496
|
+
},
|
|
4497
|
+
function () {}
|
|
4498
|
+
);
|
|
4499
|
+
break;
|
|
4500
|
+
case 87:
|
|
4501
|
+
resolveConsoleEntry(response, row);
|
|
4502
|
+
break;
|
|
4503
|
+
case 82:
|
|
4504
|
+
startReadableStream(response, id, void 0);
|
|
4505
|
+
break;
|
|
4506
|
+
case 114:
|
|
4507
|
+
startReadableStream(response, id, "bytes");
|
|
4508
|
+
break;
|
|
4509
|
+
case 88:
|
|
4510
|
+
startAsyncIterable(response, id, !1);
|
|
4511
|
+
break;
|
|
4512
|
+
case 120:
|
|
4513
|
+
startAsyncIterable(response, id, !0);
|
|
4514
|
+
break;
|
|
4515
|
+
case 67:
|
|
4516
|
+
stopStream(response, id, row);
|
|
4517
|
+
break;
|
|
4518
|
+
case 80:
|
|
4519
|
+
tag = JSON.parse(row);
|
|
4520
|
+
resolvePostponeDev(response, id, tag.reason, tag.stack, tag.env);
|
|
4521
|
+
break;
|
|
4522
|
+
default:
|
|
4523
|
+
resolveModel(response, id, row);
|
|
4524
|
+
}
|
|
4525
|
+
}
|
|
4302
4526
|
function createFromJSONCallback(response) {
|
|
4303
4527
|
return function (key, value) {
|
|
4304
4528
|
if ("string" === typeof value)
|
|
@@ -12855,143 +13079,8 @@
|
|
|
12855
13079
|
throw Error(
|
|
12856
13080
|
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
|
12857
13081
|
);
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
switch (rowTag) {
|
|
12861
|
-
case 73:
|
|
12862
|
-
throw (
|
|
12863
|
-
(i._chunks.get(rowID),
|
|
12864
|
-
JSON.parse(rowLength, i._fromJSON),
|
|
12865
|
-
Error(
|
|
12866
|
-
"renderToHTML should not have emitted Client References. This is a bug in React."
|
|
12867
|
-
))
|
|
12868
|
-
);
|
|
12869
|
-
case 72:
|
|
12870
|
-
rowID = rowLength.slice(1);
|
|
12871
|
-
JSON.parse(rowID, i._fromJSON);
|
|
12872
|
-
break;
|
|
12873
|
-
case 69:
|
|
12874
|
-
var error = JSON.parse(rowLength);
|
|
12875
|
-
rowTag = error.digest;
|
|
12876
|
-
rowLength = error.env;
|
|
12877
|
-
error = buildFakeCallStack(
|
|
12878
|
-
i,
|
|
12879
|
-
error.stack,
|
|
12880
|
-
rowLength,
|
|
12881
|
-
Error.bind(
|
|
12882
|
-
null,
|
|
12883
|
-
error.message ||
|
|
12884
|
-
"An error occurred in the Server Components render but no message was provided"
|
|
12885
|
-
)
|
|
12886
|
-
);
|
|
12887
|
-
var rootTask = getRootTask(i, rowLength);
|
|
12888
|
-
error = null != rootTask ? rootTask.run(error) : error();
|
|
12889
|
-
error.digest = rowTag;
|
|
12890
|
-
error.environmentName = rowLength;
|
|
12891
|
-
rowTag = error;
|
|
12892
|
-
rowLength = i._chunks;
|
|
12893
|
-
(error = rowLength.get(rowID))
|
|
12894
|
-
? triggerErrorOnChunk(error, rowTag)
|
|
12895
|
-
: rowLength.set(
|
|
12896
|
-
rowID,
|
|
12897
|
-
new ReactPromise("rejected", null, rowTag, i)
|
|
12898
|
-
);
|
|
12899
|
-
break;
|
|
12900
|
-
case 84:
|
|
12901
|
-
rowTag = i._chunks;
|
|
12902
|
-
(error = rowTag.get(rowID)) && "pending" !== error.status
|
|
12903
|
-
? error.reason.enqueueValue(rowLength)
|
|
12904
|
-
: rowTag.set(
|
|
12905
|
-
rowID,
|
|
12906
|
-
new ReactPromise("fulfilled", rowLength, null, i)
|
|
12907
|
-
);
|
|
12908
|
-
break;
|
|
12909
|
-
case 68:
|
|
12910
|
-
rowTag = JSON.parse(rowLength, i._fromJSON);
|
|
12911
|
-
initializeFakeTask(
|
|
12912
|
-
i,
|
|
12913
|
-
rowTag,
|
|
12914
|
-
void 0 === rowTag.env
|
|
12915
|
-
? i._rootEnvironmentName
|
|
12916
|
-
: rowTag.env
|
|
12917
|
-
);
|
|
12918
|
-
null === rowTag.owner && null != i._debugRootOwner
|
|
12919
|
-
? ((rowTag.owner = i._debugRootOwner),
|
|
12920
|
-
(rowTag.debugStack = i._debugRootStack))
|
|
12921
|
-
: initializeFakeStack(i, rowTag);
|
|
12922
|
-
i = getChunk(i, rowID);
|
|
12923
|
-
(i._debugInfo || (i._debugInfo = [])).push(rowTag);
|
|
12924
|
-
break;
|
|
12925
|
-
case 87:
|
|
12926
|
-
i._replayConsole &&
|
|
12927
|
-
((rootTask = JSON.parse(rowLength, i._fromJSON)),
|
|
12928
|
-
(rowID = rootTask[0]),
|
|
12929
|
-
(rowTag = rootTask[1]),
|
|
12930
|
-
(rowLength = rootTask[2]),
|
|
12931
|
-
(error = rootTask[3]),
|
|
12932
|
-
(rootTask = rootTask.slice(4)),
|
|
12933
|
-
replayConsoleWithCallStackInDEV(
|
|
12934
|
-
i,
|
|
12935
|
-
rowID,
|
|
12936
|
-
rowTag,
|
|
12937
|
-
rowLength,
|
|
12938
|
-
error,
|
|
12939
|
-
rootTask
|
|
12940
|
-
));
|
|
12941
|
-
break;
|
|
12942
|
-
case 82:
|
|
12943
|
-
startReadableStream(i, rowID, void 0);
|
|
12944
|
-
break;
|
|
12945
|
-
case 114:
|
|
12946
|
-
startReadableStream(i, rowID, "bytes");
|
|
12947
|
-
break;
|
|
12948
|
-
case 88:
|
|
12949
|
-
startAsyncIterable(i, rowID, !1);
|
|
12950
|
-
break;
|
|
12951
|
-
case 120:
|
|
12952
|
-
startAsyncIterable(i, rowID, !0);
|
|
12953
|
-
break;
|
|
12954
|
-
case 67:
|
|
12955
|
-
(i = i._chunks.get(rowID)) &&
|
|
12956
|
-
"fulfilled" === i.status &&
|
|
12957
|
-
i.reason.close(
|
|
12958
|
-
"" === rowLength ? '"$undefined"' : rowLength
|
|
12959
|
-
);
|
|
12960
|
-
break;
|
|
12961
|
-
case 80:
|
|
12962
|
-
rowTag = JSON.parse(rowLength);
|
|
12963
|
-
rowTag = buildFakeCallStack(
|
|
12964
|
-
i,
|
|
12965
|
-
rowTag.stack,
|
|
12966
|
-
rowTag.env,
|
|
12967
|
-
Error.bind(null, rowTag.reason || "")
|
|
12968
|
-
);
|
|
12969
|
-
rowLength = i._debugRootTask;
|
|
12970
|
-
rowTag =
|
|
12971
|
-
null != rowLength ? rowLength.run(rowTag) : rowTag();
|
|
12972
|
-
rowTag.$$typeof = REACT_POSTPONE_TYPE;
|
|
12973
|
-
rowLength = i._chunks;
|
|
12974
|
-
(error = rowLength.get(rowID))
|
|
12975
|
-
? triggerErrorOnChunk(error, rowTag)
|
|
12976
|
-
: rowLength.set(
|
|
12977
|
-
rowID,
|
|
12978
|
-
new ReactPromise("rejected", null, rowTag, i)
|
|
12979
|
-
);
|
|
12980
|
-
break;
|
|
12981
|
-
default:
|
|
12982
|
-
(rowTag = i._chunks),
|
|
12983
|
-
(error = rowTag.get(rowID))
|
|
12984
|
-
? resolveModelChunk(error, rowLength)
|
|
12985
|
-
: rowTag.set(
|
|
12986
|
-
rowID,
|
|
12987
|
-
new ReactPromise(
|
|
12988
|
-
"resolved_model",
|
|
12989
|
-
rowLength,
|
|
12990
|
-
null,
|
|
12991
|
-
i
|
|
12992
|
-
)
|
|
12993
|
-
);
|
|
12994
|
-
}
|
|
13082
|
+
i = chunk.slice(i, lastIdx);
|
|
13083
|
+
processFullStringRow(flightResponse, rowID, rowTag, i);
|
|
12995
13084
|
i = lastIdx;
|
|
12996
13085
|
3 === rowState && i++;
|
|
12997
13086
|
rowLength = rowID = rowTag = rowState = 0;
|
|
@@ -13029,5 +13118,5 @@
|
|
|
13029
13118
|
});
|
|
13030
13119
|
});
|
|
13031
13120
|
};
|
|
13032
|
-
exports.version = "19.0.0-experimental-
|
|
13121
|
+
exports.version = "19.0.0-experimental-459fd418-20241001";
|
|
13033
13122
|
})();
|
|
@@ -1309,6 +1309,7 @@ function renderModelDestructive(
|
|
|
1309
1309
|
(value = Array.from(value.entries())),
|
|
1310
1310
|
"$K" + outlineModel(request, value).toString(16)
|
|
1311
1311
|
);
|
|
1312
|
+
if (value instanceof Error) return "$Z";
|
|
1312
1313
|
if (value instanceof ArrayBuffer)
|
|
1313
1314
|
return serializeTypedArray(request, "A", new Uint8Array(value));
|
|
1314
1315
|
if (value instanceof Int8Array)
|
|
@@ -2168,12 +2169,17 @@ function processReply(
|
|
|
2168
2169
|
pendingParts = 0,
|
|
2169
2170
|
formData = null,
|
|
2170
2171
|
writtenObjects = new WeakMap(),
|
|
2171
|
-
modelRoot = root
|
|
2172
|
-
|
|
2172
|
+
modelRoot = root,
|
|
2173
|
+
json = serializeModel(root, 0);
|
|
2173
2174
|
null === formData
|
|
2174
|
-
? resolve(
|
|
2175
|
-
: (formData.set(formFieldPrefix + "0",
|
|
2175
|
+
? resolve(json)
|
|
2176
|
+
: (formData.set(formFieldPrefix + "0", json),
|
|
2176
2177
|
0 === pendingParts && resolve(formData));
|
|
2178
|
+
return function () {
|
|
2179
|
+
0 < pendingParts &&
|
|
2180
|
+
((pendingParts = 0),
|
|
2181
|
+
null === formData ? resolve(json) : resolve(formData));
|
|
2182
|
+
};
|
|
2177
2183
|
}
|
|
2178
2184
|
var boundCache = new WeakMap();
|
|
2179
2185
|
function encodeFormData(reference) {
|
|
@@ -2762,6 +2768,8 @@ function parseModelString(response, parentObject, key, value) {
|
|
|
2762
2768
|
(value = value.slice(2)),
|
|
2763
2769
|
getOutlinedModel(response, value, parentObject, key, createFormData)
|
|
2764
2770
|
);
|
|
2771
|
+
case "Z":
|
|
2772
|
+
return resolveErrorProd();
|
|
2765
2773
|
case "i":
|
|
2766
2774
|
return (
|
|
2767
2775
|
(value = value.slice(2)),
|
|
@@ -2999,6 +3007,13 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
2999
3007
|
}
|
|
3000
3008
|
);
|
|
3001
3009
|
}
|
|
3010
|
+
function resolveErrorProd() {
|
|
3011
|
+
var error = Error(
|
|
3012
|
+
"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."
|
|
3013
|
+
);
|
|
3014
|
+
error.stack = "Error: " + error.message;
|
|
3015
|
+
return error;
|
|
3016
|
+
}
|
|
3002
3017
|
function createFromJSONCallback(response) {
|
|
3003
3018
|
return function (key, value) {
|
|
3004
3019
|
if ("string" === typeof value)
|
|
@@ -8460,12 +8475,9 @@ exports.experimental_renderToHTML = function (children, options) {
|
|
|
8460
8475
|
JSON.parse(rowID, flightResponse._fromJSON);
|
|
8461
8476
|
break;
|
|
8462
8477
|
case 69:
|
|
8463
|
-
rowTag = JSON.parse(i)
|
|
8464
|
-
i =
|
|
8465
|
-
|
|
8466
|
-
);
|
|
8467
|
-
i.stack = "Error: " + i.message;
|
|
8468
|
-
i.digest = rowTag;
|
|
8478
|
+
rowTag = JSON.parse(i);
|
|
8479
|
+
i = resolveErrorProd();
|
|
8480
|
+
i.digest = rowTag.digest;
|
|
8469
8481
|
rowTag = flightResponse._chunks;
|
|
8470
8482
|
(rowLength = rowTag.get(rowID))
|
|
8471
8483
|
? triggerErrorOnChunk(rowLength, i)
|
|
@@ -8667,4 +8679,4 @@ exports.experimental_renderToHTML = function (children, options) {
|
|
|
8667
8679
|
});
|
|
8668
8680
|
});
|
|
8669
8681
|
};
|
|
8670
|
-
exports.version = "19.0.0-experimental-
|
|
8682
|
+
exports.version = "19.0.0-experimental-459fd418-20241001";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-markup",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-459fd418-20241001",
|
|
4
4
|
"description": "React package generating embedded markup such as e-mails with support for Server Components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://react.dev/",
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"react": "0.0.0-experimental-
|
|
20
|
+
"react": "0.0.0-experimental-459fd418-20241001"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"LICENSE",
|