react-markup 0.0.0-experimental-3edc000d-20240926 → 0.0.0-experimental-d8c90fa4-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.
@@ -8625,5 +8625,5 @@
8625
8625
  });
8626
8626
  });
8627
8627
  };
8628
- exports.version = "19.0.0-experimental-3edc000d-20240926";
8628
+ exports.version = "19.0.0-experimental-d8c90fa4-20241001";
8629
8629
  })();
@@ -5703,4 +5703,4 @@ exports.experimental_renderToHTML = function (children, options) {
5703
5703
  });
5704
5704
  });
5705
5705
  };
5706
- exports.version = "19.0.0-experimental-3edc000d-20240926";
5706
+ exports.version = "19.0.0-experimental-d8c90fa4-20241001";
@@ -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
- outlineModel(request, componentDebugInfo);
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 = { objectCount: 0 };
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 void 0 !== parent
2232
- ? parent
2233
- : isArrayImpl(value)
2234
- ? value
2235
- : value instanceof Map
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
- "$Q" +
2296
+ "$W" +
2238
2297
  outlineConsoleValue(request, counter, value).toString(16))
2239
- : value instanceof Set
2240
- ? ((value = Array.from(value)),
2241
- "$W" +
2242
- outlineConsoleValue(request, counter, value).toString(16))
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
- : isReactComponentInfo(value)
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 "unknown value";
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 = { objectCount: 0 },
2369
- env = (0, request.environmentName)();
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 "unknown value";
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
- outlineModel(request, debugInfo[i]),
2446
+ outlineComponentInfo(request, debugInfo[i]),
2393
2447
  emitDebugChunk(request, id, debugInfo[i]);
2394
2448
  }
2395
2449
  function emitChunk(request, task, value) {
@@ -3870,6 +3924,17 @@
3870
3924
  createFormData
3871
3925
  )
3872
3926
  );
3927
+ case "Z":
3928
+ return (
3929
+ (value = value.slice(2)),
3930
+ getOutlinedModel(
3931
+ response,
3932
+ value,
3933
+ parentObject,
3934
+ key,
3935
+ resolveErrorDev
3936
+ )
3937
+ );
3873
3938
  case "i":
3874
3939
  return (
3875
3940
  (value = value.slice(2)),
@@ -3963,6 +4028,30 @@
3963
4028
  this._rootEnvironmentName = environmentName;
3964
4029
  this._fromJSON = createFromJSONCallback(this);
3965
4030
  }
4031
+ function resolveModel(response, id, model) {
4032
+ var chunks = response._chunks,
4033
+ chunk = chunks.get(id);
4034
+ chunk
4035
+ ? resolveModelChunk(chunk, model)
4036
+ : chunks.set(
4037
+ id,
4038
+ new ReactPromise("resolved_model", model, null, response)
4039
+ );
4040
+ }
4041
+ function resolveText(response, id, text) {
4042
+ var chunks = response._chunks,
4043
+ chunk = chunks.get(id);
4044
+ chunk && "pending" !== chunk.status
4045
+ ? chunk.reason.enqueueValue(text)
4046
+ : chunks.set(id, new ReactPromise("fulfilled", text, null, response));
4047
+ }
4048
+ function resolveModule(response, id, model) {
4049
+ response._chunks.get(id);
4050
+ JSON.parse(model, response._fromJSON);
4051
+ throw Error(
4052
+ "renderToHTML should not have emitted Client References. This is a bug in React."
4053
+ );
4054
+ }
3966
4055
  function resolveStream(response, id, stream, controller) {
3967
4056
  var chunks = response._chunks,
3968
4057
  chunk = chunks.get(id);
@@ -4154,6 +4243,46 @@
4154
4243
  }
4155
4244
  );
4156
4245
  }
4246
+ function stopStream(response, id, row) {
4247
+ (response = response._chunks.get(id)) &&
4248
+ "fulfilled" === response.status &&
4249
+ response.reason.close("" === row ? '"$undefined"' : row);
4250
+ }
4251
+ function resolveErrorDev(response, errorInfo) {
4252
+ var env = errorInfo.env;
4253
+ errorInfo = buildFakeCallStack(
4254
+ response,
4255
+ errorInfo.stack,
4256
+ env,
4257
+ Error.bind(
4258
+ null,
4259
+ errorInfo.message ||
4260
+ "An error occurred in the Server Components render but no message was provided"
4261
+ )
4262
+ );
4263
+ response = getRootTask(response, env);
4264
+ response = null != response ? response.run(errorInfo) : errorInfo();
4265
+ response.environmentName = env;
4266
+ return response;
4267
+ }
4268
+ function resolvePostponeDev(response, id, reason, stack, env) {
4269
+ reason = buildFakeCallStack(
4270
+ response,
4271
+ stack,
4272
+ env,
4273
+ Error.bind(null, reason || "")
4274
+ );
4275
+ stack = response._debugRootTask;
4276
+ reason = null != stack ? stack.run(reason) : reason();
4277
+ reason.$$typeof = REACT_POSTPONE_TYPE;
4278
+ stack = response._chunks;
4279
+ (env = stack.get(id))
4280
+ ? triggerErrorOnChunk(env, reason)
4281
+ : stack.set(id, new ReactPromise("rejected", null, reason, response));
4282
+ }
4283
+ function resolveHint(response, code, model) {
4284
+ JSON.parse(model, response._fromJSON);
4285
+ }
4157
4286
  function createFakeFunction(
4158
4287
  name,
4159
4288
  filename,
@@ -4295,10 +4424,100 @@
4295
4424
  null != debugInfo.owner &&
4296
4425
  initializeFakeStack(response, debugInfo.owner));
4297
4426
  }
4427
+ function resolveDebugInfo(response, id, debugInfo) {
4428
+ initializeFakeTask(
4429
+ response,
4430
+ debugInfo,
4431
+ void 0 === debugInfo.env ? response._rootEnvironmentName : debugInfo.env
4432
+ );
4433
+ null === debugInfo.owner && null != response._debugRootOwner
4434
+ ? ((debugInfo.owner = response._debugRootOwner),
4435
+ (debugInfo.debugStack = response._debugRootStack))
4436
+ : initializeFakeStack(response, debugInfo);
4437
+ response = getChunk(response, id);
4438
+ (response._debugInfo || (response._debugInfo = [])).push(debugInfo);
4439
+ }
4298
4440
  function getCurrentStackInDEV$1() {
4299
4441
  var owner = currentOwnerInDEV;
4300
4442
  return null === owner ? "" : getOwnerStackByComponentInfoInDev(owner);
4301
4443
  }
4444
+ function resolveConsoleEntry(response, value) {
4445
+ if (response._replayConsole) {
4446
+ var payload = JSON.parse(value, response._fromJSON);
4447
+ value = payload[0];
4448
+ var stackTrace = payload[1],
4449
+ owner = payload[2],
4450
+ env = payload[3];
4451
+ payload = payload.slice(4);
4452
+ replayConsoleWithCallStackInDEV(
4453
+ response,
4454
+ value,
4455
+ stackTrace,
4456
+ owner,
4457
+ env,
4458
+ payload
4459
+ );
4460
+ }
4461
+ }
4462
+ function processFullStringRow(response, id, tag, row) {
4463
+ switch (tag) {
4464
+ case 73:
4465
+ resolveModule(response, id, row);
4466
+ break;
4467
+ case 72:
4468
+ resolveHint(response, row[0], row.slice(1));
4469
+ break;
4470
+ case 69:
4471
+ row = JSON.parse(row);
4472
+ tag = resolveErrorDev(response, row);
4473
+ tag.digest = row.digest;
4474
+ row = response._chunks;
4475
+ var chunk = row.get(id);
4476
+ chunk
4477
+ ? triggerErrorOnChunk(chunk, tag)
4478
+ : row.set(id, new ReactPromise("rejected", null, tag, response));
4479
+ break;
4480
+ case 84:
4481
+ resolveText(response, id, row);
4482
+ break;
4483
+ case 68:
4484
+ tag = new ReactPromise("resolved_model", row, null, response);
4485
+ initializeModelChunk(tag);
4486
+ "fulfilled" === tag.status
4487
+ ? resolveDebugInfo(response, id, tag.value)
4488
+ : tag.then(
4489
+ function (v) {
4490
+ return resolveDebugInfo(response, id, v);
4491
+ },
4492
+ function () {}
4493
+ );
4494
+ break;
4495
+ case 87:
4496
+ resolveConsoleEntry(response, row);
4497
+ break;
4498
+ case 82:
4499
+ startReadableStream(response, id, void 0);
4500
+ break;
4501
+ case 114:
4502
+ startReadableStream(response, id, "bytes");
4503
+ break;
4504
+ case 88:
4505
+ startAsyncIterable(response, id, !1);
4506
+ break;
4507
+ case 120:
4508
+ startAsyncIterable(response, id, !0);
4509
+ break;
4510
+ case 67:
4511
+ stopStream(response, id, row);
4512
+ break;
4513
+ case 80:
4514
+ tag = JSON.parse(row);
4515
+ resolvePostponeDev(response, id, tag.reason, tag.stack, tag.env);
4516
+ break;
4517
+ default:
4518
+ resolveModel(response, id, row);
4519
+ }
4520
+ }
4302
4521
  function createFromJSONCallback(response) {
4303
4522
  return function (key, value) {
4304
4523
  if ("string" === typeof value)
@@ -12855,143 +13074,8 @@
12855
13074
  throw Error(
12856
13075
  "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
13076
  );
12858
- rowLength = chunk.slice(i, lastIdx);
12859
- i = flightResponse;
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
- }
13077
+ i = chunk.slice(i, lastIdx);
13078
+ processFullStringRow(flightResponse, rowID, rowTag, i);
12995
13079
  i = lastIdx;
12996
13080
  3 === rowState && i++;
12997
13081
  rowLength = rowID = rowTag = rowState = 0;
@@ -13029,5 +13113,5 @@
13029
13113
  });
13030
13114
  });
13031
13115
  };
13032
- exports.version = "19.0.0-experimental-3edc000d-20240926";
13116
+ exports.version = "19.0.0-experimental-d8c90fa4-20241001";
13033
13117
  })();
@@ -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)
@@ -2762,6 +2763,8 @@ function parseModelString(response, parentObject, key, value) {
2762
2763
  (value = value.slice(2)),
2763
2764
  getOutlinedModel(response, value, parentObject, key, createFormData)
2764
2765
  );
2766
+ case "Z":
2767
+ return resolveErrorProd();
2765
2768
  case "i":
2766
2769
  return (
2767
2770
  (value = value.slice(2)),
@@ -2999,6 +3002,13 @@ function startAsyncIterable(response, id, iterator) {
2999
3002
  }
3000
3003
  );
3001
3004
  }
3005
+ function resolveErrorProd() {
3006
+ var error = Error(
3007
+ "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."
3008
+ );
3009
+ error.stack = "Error: " + error.message;
3010
+ return error;
3011
+ }
3002
3012
  function createFromJSONCallback(response) {
3003
3013
  return function (key, value) {
3004
3014
  if ("string" === typeof value)
@@ -8460,12 +8470,9 @@ exports.experimental_renderToHTML = function (children, options) {
8460
8470
  JSON.parse(rowID, flightResponse._fromJSON);
8461
8471
  break;
8462
8472
  case 69:
8463
- rowTag = JSON.parse(i).digest;
8464
- i = Error(
8465
- "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."
8466
- );
8467
- i.stack = "Error: " + i.message;
8468
- i.digest = rowTag;
8473
+ rowTag = JSON.parse(i);
8474
+ i = resolveErrorProd();
8475
+ i.digest = rowTag.digest;
8469
8476
  rowTag = flightResponse._chunks;
8470
8477
  (rowLength = rowTag.get(rowID))
8471
8478
  ? triggerErrorOnChunk(rowLength, i)
@@ -8667,4 +8674,4 @@ exports.experimental_renderToHTML = function (children, options) {
8667
8674
  });
8668
8675
  });
8669
8676
  };
8670
- exports.version = "19.0.0-experimental-3edc000d-20240926";
8677
+ exports.version = "19.0.0-experimental-d8c90fa4-20241001";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-3edc000d-20240926",
3
+ "version": "0.0.0-experimental-d8c90fa4-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-3edc000d-20240926"
20
+ "react": "0.0.0-experimental-d8c90fa4-20241001"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",