react-markup 0.0.0-experimental-1eaccd82-20240816 → 0.0.0-experimental-6ebfd5b0-20240818

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.
@@ -5057,7 +5057,7 @@
5057
5057
  } else internalInstance.queue = null;
5058
5058
  }
5059
5059
  var nextChildren = callRenderInDEV(instance);
5060
- if (1 === request.status) throw AbortSigil;
5060
+ if (1 === request.status) throw null;
5061
5061
  instance.props !== resolvedProps &&
5062
5062
  (didWarnAboutReassigningProps ||
5063
5063
  console.error(
@@ -5089,7 +5089,7 @@
5089
5089
  props,
5090
5090
  void 0
5091
5091
  );
5092
- if (1 === request.status) throw AbortSigil;
5092
+ if (1 === request.status) throw null;
5093
5093
  var hasId = 0 !== localIdCounter,
5094
5094
  actionStateCount = actionStateCounter,
5095
5095
  actionStateMatchingIndex$jscomp$0 = actionStateMatchingIndex;
@@ -5329,8 +5329,7 @@
5329
5329
  (boundarySegment.status = 1);
5330
5330
  } catch (thrownValue) {
5331
5331
  throw (
5332
- ((boundarySegment.status =
5333
- thrownValue === AbortSigil ? 3 : 4),
5332
+ ((boundarySegment.status = 1 === request.status ? 3 : 4),
5334
5333
  thrownValue)
5335
5334
  );
5336
5335
  } finally {
@@ -5375,7 +5374,7 @@
5375
5374
  }
5376
5375
  } catch (thrownValue$2) {
5377
5376
  newBoundary.status = 4;
5378
- if (thrownValue$2 === AbortSigil) {
5377
+ if (1 === request.status) {
5379
5378
  contentRootSegment.status = 3;
5380
5379
  var error = request.fatalError;
5381
5380
  } else
@@ -5536,7 +5535,7 @@
5536
5535
  return;
5537
5536
  case REACT_LAZY_TYPE:
5538
5537
  var Component = callLazyInitInDEV(type);
5539
- if (1 === request.status) throw AbortSigil;
5538
+ if (1 === request.status) throw null;
5540
5539
  renderElement(request, task, keyPath, Component, props, ref);
5541
5540
  return;
5542
5541
  }
@@ -5827,7 +5826,7 @@
5827
5826
  );
5828
5827
  case REACT_LAZY_TYPE:
5829
5828
  node = callLazyInitInDEV(node);
5830
- if (1 === request.status) throw AbortSigil;
5829
+ if (1 === request.status) throw null;
5831
5830
  renderNodeDestructive(request, task, node, childIndex);
5832
5831
  return;
5833
5832
  }
@@ -6754,7 +6753,9 @@
6754
6753
  erroredReplay(
6755
6754
  request$jscomp$0,
6756
6755
  request.blockedBoundary,
6757
- x === AbortSigil ? request$jscomp$0.fatalError : x,
6756
+ 1 === request$jscomp$0.status
6757
+ ? request$jscomp$0.fatalError
6758
+ : x,
6758
6759
  errorInfo,
6759
6760
  request.replay.nodes,
6760
6761
  request.replay.slots,
@@ -6799,7 +6800,7 @@
6799
6800
  var x$jscomp$0 =
6800
6801
  thrownValue === SuspenseException
6801
6802
  ? getSuspendedThenable()
6802
- : thrownValue === AbortSigil
6803
+ : 1 === request.status
6803
6804
  ? request.fatalError
6804
6805
  : thrownValue;
6805
6806
  if ("object" === typeof x$jscomp$0 && null !== x$jscomp$0) {
@@ -8448,7 +8449,6 @@
8448
8449
  },
8449
8450
  callLazyInitInDEV =
8450
8451
  callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
8451
- AbortSigil = {},
8452
8452
  didWarnAboutBadClass = {},
8453
8453
  didWarnAboutContextTypes = {},
8454
8454
  didWarnAboutContextTypeOnFunctionComponent = {},
@@ -8511,5 +8511,5 @@
8511
8511
  });
8512
8512
  });
8513
8513
  };
8514
- exports.version = "19.0.0-experimental-1eaccd82-20240816";
8514
+ exports.version = "19.0.0-experimental-6ebfd5b0-20240818";
8515
8515
  })();
@@ -3314,7 +3314,6 @@ function createRequest(
3314
3314
  formState
3315
3315
  );
3316
3316
  }
3317
- var AbortSigil = {};
3318
3317
  function pingTask(request, task) {
3319
3318
  request.pingedTasks.push(task);
3320
3319
  1 === request.pingedTasks.length &&
@@ -3643,14 +3642,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
3643
3642
  }
3644
3643
  else defaultProps.queue = null;
3645
3644
  type = newProps.render();
3646
- if (1 === request.status) throw AbortSigil;
3645
+ if (1 === request.status) throw null;
3647
3646
  props = task.keyPath;
3648
3647
  task.keyPath = keyPath;
3649
3648
  renderNodeDestructive(request, task, type, -1);
3650
3649
  task.keyPath = props;
3651
3650
  } else {
3652
3651
  type = renderWithHooks(request, task, keyPath, type, props, void 0);
3653
- if (1 === request.status) throw AbortSigil;
3652
+ if (1 === request.status) throw null;
3654
3653
  finishFunctionComponent(
3655
3654
  request,
3656
3655
  task,
@@ -3830,8 +3829,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
3830
3829
  renderNode(request, task, ref, -1), (propName.status = 1);
3831
3830
  } catch (thrownValue) {
3832
3831
  throw (
3833
- ((propName.status = thrownValue === AbortSigil ? 3 : 4),
3834
- thrownValue)
3832
+ ((propName.status = 1 === request.status ? 3 : 4), thrownValue)
3835
3833
  );
3836
3834
  } finally {
3837
3835
  (task.blockedSegment = contextType), (task.keyPath = type);
@@ -3872,7 +3870,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
3872
3870
  }
3873
3871
  } catch (thrownValue$18) {
3874
3872
  (propName$23.status = 4),
3875
- thrownValue$18 === AbortSigil
3873
+ 1 === request.status
3876
3874
  ? ((textEmbedded.status = 3), (newProps = request.fatalError))
3877
3875
  : ((textEmbedded.status = 4), (newProps = thrownValue$18)),
3878
3876
  (defaultProps = getThrownInfo(task.componentStack)),
@@ -3984,7 +3982,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
3984
3982
  case REACT_LAZY_TYPE:
3985
3983
  newProps = type._init;
3986
3984
  type = newProps(type._payload);
3987
- if (1 === request.status) throw AbortSigil;
3985
+ if (1 === request.status) throw null;
3988
3986
  renderElement(request, task, keyPath, type, props, ref);
3989
3987
  return;
3990
3988
  }
@@ -4220,7 +4218,7 @@ function retryNode(request, task) {
4220
4218
  case REACT_LAZY_TYPE:
4221
4219
  childNodes = node._init;
4222
4220
  node = childNodes(node._payload);
4223
- if (1 === request.status) throw AbortSigil;
4221
+ if (1 === request.status) throw null;
4224
4222
  renderNodeDestructive(request, task, node, childIndex);
4225
4223
  return;
4226
4224
  }
@@ -4957,7 +4955,9 @@ function performWork(request$jscomp$1) {
4957
4955
  erroredReplay(
4958
4956
  request$jscomp$0,
4959
4957
  task.blockedBoundary,
4960
- x === AbortSigil ? request$jscomp$0.fatalError : x,
4958
+ 1 === request$jscomp$0.status
4959
+ ? request$jscomp$0.fatalError
4960
+ : x,
4961
4961
  errorInfo,
4962
4962
  task.replay.nodes,
4963
4963
  task.replay.slots
@@ -4993,7 +4993,7 @@ function performWork(request$jscomp$1) {
4993
4993
  var x$jscomp$0 =
4994
4994
  thrownValue === SuspenseException
4995
4995
  ? getSuspendedThenable()
4996
- : thrownValue === AbortSigil
4996
+ : 1 === request.status
4997
4997
  ? request.fatalError
4998
4998
  : thrownValue;
4999
4999
  if ("object" === typeof x$jscomp$0 && null !== x$jscomp$0) {
@@ -5617,4 +5617,4 @@ exports.experimental_renderToHTML = function (children, options) {
5617
5617
  });
5618
5618
  });
5619
5619
  };
5620
- exports.version = "19.0.0-experimental-1eaccd82-20240816";
5620
+ exports.version = "19.0.0-experimental-6ebfd5b0-20240818";
@@ -869,10 +869,16 @@
869
869
  default:
870
870
  if (request.status === ABORTING$1)
871
871
  return (
872
- (newTask.status = ABORTED$1),
873
- (task = stringify(serializeByValueID$1(request.fatalError))),
874
- emitModelChunk(request, newTask.id, task),
875
872
  request.abortableTasks.delete(newTask),
873
+ (newTask.status = ABORTED$1),
874
+ request.fatalError === haltSymbol
875
+ ? emitModelChunk(
876
+ request,
877
+ newTask.id,
878
+ reusableInfinitePromiseModel
879
+ )
880
+ : ((task = stringify(serializeByValueID$1(request.fatalError))),
881
+ emitModelChunk(request, newTask.id, task)),
876
882
  newTask.id
877
883
  );
878
884
  "string" !== typeof thenable.status &&
@@ -937,19 +943,24 @@
937
943
  if (!aborted) {
938
944
  aborted = !0;
939
945
  request.abortListeners.delete(error);
940
- if (
941
- "object" === typeof reason &&
942
- null !== reason &&
943
- reason.$$typeof === REACT_POSTPONE_TYPE
944
- )
945
- logPostpone$1(request, reason.message, streamTask),
946
- emitPostponeChunk(request, streamTask.id, reason);
946
+ if (request.fatalError === haltSymbol) var cancelWith = reason;
947
947
  else {
948
- var digest = logRecoverableError$1(request, reason, streamTask);
949
- emitErrorChunk(request, streamTask.id, digest, reason);
948
+ if (
949
+ "object" === typeof reason &&
950
+ null !== reason &&
951
+ reason.$$typeof === REACT_POSTPONE_TYPE
952
+ )
953
+ (cancelWith = reason),
954
+ logPostpone$1(request, reason.message, streamTask),
955
+ emitPostponeChunk(request, streamTask.id, reason);
956
+ else {
957
+ cancelWith = reason;
958
+ var digest = logRecoverableError$1(request, reason, streamTask);
959
+ emitErrorChunk(request, streamTask.id, digest, reason);
960
+ }
961
+ enqueueFlush(request);
950
962
  }
951
- enqueueFlush(request);
952
- reader.cancel(reason).then(error, error);
963
+ reader.cancel(cancelWith).then(error, error);
953
964
  }
954
965
  }
955
966
  var supportsBYOB = stream.supportsBYOB;
@@ -1017,20 +1028,25 @@
1017
1028
  if (!aborted) {
1018
1029
  aborted = !0;
1019
1030
  request.abortListeners.delete(error);
1020
- if (
1021
- "object" === typeof reason &&
1022
- null !== reason &&
1023
- reason.$$typeof === REACT_POSTPONE_TYPE
1024
- )
1025
- logPostpone$1(request, reason.message, streamTask),
1026
- emitPostponeChunk(request, streamTask.id, reason);
1031
+ if (request.fatalError === haltSymbol) var throwWith = reason;
1027
1032
  else {
1028
- var digest = logRecoverableError$1(request, reason, streamTask);
1029
- emitErrorChunk(request, streamTask.id, digest, reason);
1033
+ if (
1034
+ "object" === typeof reason &&
1035
+ null !== reason &&
1036
+ reason.$$typeof === REACT_POSTPONE_TYPE
1037
+ )
1038
+ (throwWith = reason),
1039
+ logPostpone$1(request, reason.message, streamTask),
1040
+ emitPostponeChunk(request, streamTask.id, reason);
1041
+ else {
1042
+ throwWith = reason;
1043
+ var digest = logRecoverableError$1(request, reason, streamTask);
1044
+ emitErrorChunk(request, streamTask.id, digest, reason);
1045
+ }
1046
+ enqueueFlush(request);
1030
1047
  }
1031
- enqueueFlush(request);
1032
1048
  "function" === typeof iterator.throw &&
1033
- iterator.throw(reason).then(error, error);
1049
+ iterator.throw(throwWith).then(error, error);
1034
1050
  }
1035
1051
  }
1036
1052
  var isIterator = iterable === iterator,
@@ -1575,11 +1591,15 @@
1575
1591
  if (!aborted) {
1576
1592
  aborted = !0;
1577
1593
  request.abortListeners.delete(error);
1578
- var digest = logRecoverableError$1(request, reason, newTask);
1579
- emitErrorChunk(request, newTask.id, digest, reason);
1580
- request.abortableTasks.delete(newTask);
1581
- enqueueFlush(request);
1582
- reader.cancel(reason).then(error, error);
1594
+ if (request.fatalError === haltSymbol) var cancelWith = reason;
1595
+ else {
1596
+ cancelWith = reason;
1597
+ var digest = logRecoverableError$1(request, reason, newTask);
1598
+ emitErrorChunk(request, newTask.id, digest, reason);
1599
+ request.abortableTasks.delete(newTask);
1600
+ enqueueFlush(request);
1601
+ }
1602
+ reader.cancel(cancelWith).then(error, error);
1583
1603
  }
1584
1604
  }
1585
1605
  var model = [blob.type],
@@ -1629,12 +1649,14 @@
1629
1649
  : thrownValue;
1630
1650
  if ("object" === typeof key && null !== key) {
1631
1651
  if ("function" === typeof key.then) {
1632
- if (request.status === ABORTING$1)
1633
- return (
1634
- (task.status = ABORTED$1),
1635
- (task = request.fatalError),
1636
- parent ? "$L" + task.toString(16) : serializeByValueID$1(task)
1637
- );
1652
+ if (request.status === ABORTING$1) {
1653
+ task.status = ABORTED$1;
1654
+ if (request.fatalError === haltSymbol) return "$@";
1655
+ task = request.fatalError;
1656
+ return parent
1657
+ ? "$L" + task.toString(16)
1658
+ : serializeByValueID$1(task);
1659
+ }
1638
1660
  request = createTask(
1639
1661
  request,
1640
1662
  task.model,
@@ -1665,12 +1687,12 @@
1665
1687
  parent ? "$L" + value.toString(16) : serializeByValueID$1(value)
1666
1688
  );
1667
1689
  }
1668
- if (request.status === ABORTING$1)
1669
- return (
1670
- (task.status = ABORTED$1),
1671
- (task = request.fatalError),
1672
- parent ? "$L" + task.toString(16) : serializeByValueID$1(task)
1673
- );
1690
+ if (request.status === ABORTING$1) {
1691
+ task.status = ABORTED$1;
1692
+ if (request.fatalError === haltSymbol) return "$@";
1693
+ task = request.fatalError;
1694
+ return parent ? "$L" + task.toString(16) : serializeByValueID$1(task);
1695
+ }
1674
1696
  task.keyPath = prevKeyPath;
1675
1697
  task.implicitSlot = prevImplicitSlot;
1676
1698
  request.pendingChunks++;
@@ -2406,8 +2428,18 @@
2406
2428
  if (request.status === ABORTING$1) {
2407
2429
  request.abortableTasks.delete(task);
2408
2430
  task.status = ABORTED$1;
2409
- var model = stringify(serializeByValueID$1(request.fatalError));
2410
- emitModelChunk(request, task.id, model);
2431
+ if (request.fatalError === haltSymbol)
2432
+ emitModelChunk(
2433
+ request,
2434
+ task.id,
2435
+ reusableInfinitePromiseModel
2436
+ );
2437
+ else {
2438
+ var model = stringify(
2439
+ serializeByValueID$1(request.fatalError)
2440
+ );
2441
+ emitModelChunk(request, task.id, model);
2442
+ }
2411
2443
  return;
2412
2444
  }
2413
2445
  task.status = PENDING$3;
@@ -2424,12 +2456,18 @@
2424
2456
  return;
2425
2457
  }
2426
2458
  }
2427
- if (request.status === ABORTING$1) {
2428
- request.abortableTasks.delete(task);
2429
- task.status = ABORTED$1;
2430
- var _model = stringify(serializeByValueID$1(request.fatalError));
2431
- emitModelChunk(request, task.id, _model);
2432
- } else {
2459
+ if (request.status === ABORTING$1)
2460
+ if (
2461
+ (request.abortableTasks.delete(task),
2462
+ (task.status = ABORTED$1),
2463
+ request.fatalError === haltSymbol)
2464
+ )
2465
+ emitModelChunk(request, task.id, reusableInfinitePromiseModel);
2466
+ else {
2467
+ var _model = stringify(serializeByValueID$1(request.fatalError));
2468
+ emitModelChunk(request, task.id, _model);
2469
+ }
2470
+ else {
2433
2471
  request.abortableTasks.delete(task);
2434
2472
  task.status = ERRORED$2;
2435
2473
  var digest = logRecoverableError$1(request, x, task);
@@ -3143,6 +3181,49 @@
3143
3181
  );
3144
3182
  }
3145
3183
  }
3184
+ function createFakeServerFunction(
3185
+ name,
3186
+ filename,
3187
+ sourceMap,
3188
+ line,
3189
+ col,
3190
+ environmentName,
3191
+ innerFunction
3192
+ ) {
3193
+ name || (name = "<anonymous>");
3194
+ var encodedName = JSON.stringify(name);
3195
+ 1 >= line
3196
+ ? ((line = encodedName.length + 7),
3197
+ (col =
3198
+ "s=>({" +
3199
+ encodedName +
3200
+ " ".repeat(col < line ? 0 : col - line) +
3201
+ ":(...args) => s(...args)})\n/* This module is a proxy to a Server Action. Turn on Source Maps to see the server source. */"))
3202
+ : (col =
3203
+ "/* This module is a proxy to a Server Action. Turn on Source Maps to see the server source. */" +
3204
+ "\n".repeat(line - 2) +
3205
+ "server=>({" +
3206
+ encodedName +
3207
+ ":\n" +
3208
+ " ".repeat(1 > col ? 0 : col - 1) +
3209
+ "(...args) => server(...args)})");
3210
+ filename.startsWith("/") && (filename = "file://" + filename);
3211
+ sourceMap
3212
+ ? ((col +=
3213
+ "\n//# sourceURL=rsc://React/" +
3214
+ encodeURIComponent(environmentName) +
3215
+ "/" +
3216
+ filename +
3217
+ "?s" +
3218
+ fakeServerFunctionIdx++),
3219
+ (col += "\n//# sourceMappingURL=" + sourceMap))
3220
+ : filename && (col += "\n//# sourceURL=" + filename);
3221
+ try {
3222
+ return (0, eval)(col)(innerFunction)[name];
3223
+ } catch (x) {
3224
+ return innerFunction;
3225
+ }
3226
+ }
3146
3227
  function registerServerReference(
3147
3228
  proxy,
3148
3229
  reference$jscomp$0,
@@ -3197,6 +3278,52 @@
3197
3278
  }
3198
3279
  return newFn;
3199
3280
  }
3281
+ function createBoundServerReference(
3282
+ metaData,
3283
+ callServer,
3284
+ encodeFormAction,
3285
+ findSourceMapURL
3286
+ ) {
3287
+ function action() {
3288
+ var args = Array.prototype.slice.call(arguments);
3289
+ return bound
3290
+ ? "fulfilled" === bound.status
3291
+ ? callServer(id, bound.value.concat(args))
3292
+ : Promise.resolve(bound).then(function (boundArgs) {
3293
+ return callServer(id, boundArgs.concat(args));
3294
+ })
3295
+ : callServer(id, args);
3296
+ }
3297
+ var id = metaData.id,
3298
+ bound = metaData.bound,
3299
+ location = metaData.location;
3300
+ if (location) {
3301
+ var functionName = metaData.name || "",
3302
+ filename = location[1],
3303
+ line = location[2];
3304
+ location = location[3];
3305
+ metaData = metaData.env || "Server";
3306
+ findSourceMapURL =
3307
+ null == findSourceMapURL
3308
+ ? null
3309
+ : findSourceMapURL(filename, metaData);
3310
+ action = createFakeServerFunction(
3311
+ functionName,
3312
+ filename,
3313
+ findSourceMapURL,
3314
+ line,
3315
+ location,
3316
+ metaData,
3317
+ action
3318
+ );
3319
+ }
3320
+ registerServerReference(
3321
+ action,
3322
+ { id: id, bound: bound },
3323
+ encodeFormAction
3324
+ );
3325
+ return action;
3326
+ }
3200
3327
  function getComponentNameFromType(type) {
3201
3328
  if (null == type) return null;
3202
3329
  if ("function" === typeof type)
@@ -3511,20 +3638,12 @@
3511
3638
  return null;
3512
3639
  }
3513
3640
  function createServerReferenceProxy(response, metaData) {
3514
- function proxy() {
3515
- var args = Array.prototype.slice.call(arguments),
3516
- p = metaData.bound;
3517
- return p
3518
- ? "fulfilled" === p.status
3519
- ? callServer(metaData.id, p.value.concat(args))
3520
- : Promise.resolve(p).then(function (bound) {
3521
- return callServer(metaData.id, bound.concat(args));
3522
- })
3523
- : callServer(metaData.id, args);
3524
- }
3525
- var callServer = response._callServer;
3526
- registerServerReference(proxy, metaData, response._encodeFormAction);
3527
- return proxy;
3641
+ return createBoundServerReference(
3642
+ metaData,
3643
+ response._callServer,
3644
+ response._encodeFormAction,
3645
+ response._debugFindSourceMapURL
3646
+ );
3528
3647
  }
3529
3648
  function getOutlinedModel(response, reference, parentObject, key, map) {
3530
3649
  reference = reference.split(":");
@@ -8694,7 +8813,7 @@
8694
8813
  } else internalInstance.queue = null;
8695
8814
  }
8696
8815
  var nextChildren = callRenderInDEV(instance);
8697
- if (1 === request.status) throw AbortSigil;
8816
+ if (1 === request.status) throw null;
8698
8817
  instance.props !== resolvedProps &&
8699
8818
  (didWarnAboutReassigningProps ||
8700
8819
  console.error(
@@ -8726,7 +8845,7 @@
8726
8845
  props,
8727
8846
  void 0
8728
8847
  );
8729
- if (1 === request.status) throw AbortSigil;
8848
+ if (1 === request.status) throw null;
8730
8849
  var hasId = 0 !== localIdCounter,
8731
8850
  actionStateCount = actionStateCounter,
8732
8851
  actionStateMatchingIndex$jscomp$0 = actionStateMatchingIndex;
@@ -8966,8 +9085,7 @@
8966
9085
  (boundarySegment.status = 1);
8967
9086
  } catch (thrownValue) {
8968
9087
  throw (
8969
- ((boundarySegment.status =
8970
- thrownValue === AbortSigil ? 3 : 4),
9088
+ ((boundarySegment.status = 1 === request.status ? 3 : 4),
8971
9089
  thrownValue)
8972
9090
  );
8973
9091
  } finally {
@@ -9012,7 +9130,7 @@
9012
9130
  }
9013
9131
  } catch (thrownValue$6) {
9014
9132
  newBoundary.status = 4;
9015
- if (thrownValue$6 === AbortSigil) {
9133
+ if (1 === request.status) {
9016
9134
  contentRootSegment.status = 3;
9017
9135
  var error = request.fatalError;
9018
9136
  } else
@@ -9173,7 +9291,7 @@
9173
9291
  return;
9174
9292
  case REACT_LAZY_TYPE:
9175
9293
  var Component = callLazyInitInDEV(type);
9176
- if (1 === request.status) throw AbortSigil;
9294
+ if (1 === request.status) throw null;
9177
9295
  renderElement(request, task, keyPath, Component, props, ref);
9178
9296
  return;
9179
9297
  }
@@ -9464,7 +9582,7 @@
9464
9582
  );
9465
9583
  case REACT_LAZY_TYPE:
9466
9584
  node = callLazyInitInDEV(node);
9467
- if (1 === request.status) throw AbortSigil;
9585
+ if (1 === request.status) throw null;
9468
9586
  renderNodeDestructive(request, task, node, childIndex);
9469
9587
  return;
9470
9588
  }
@@ -10386,7 +10504,9 @@
10386
10504
  erroredReplay(
10387
10505
  request$jscomp$0,
10388
10506
  request.blockedBoundary,
10389
- x === AbortSigil ? request$jscomp$0.fatalError : x,
10507
+ 1 === request$jscomp$0.status
10508
+ ? request$jscomp$0.fatalError
10509
+ : x,
10390
10510
  errorInfo,
10391
10511
  request.replay.nodes,
10392
10512
  request.replay.slots,
@@ -10431,7 +10551,7 @@
10431
10551
  var x$jscomp$0 =
10432
10552
  thrownValue === SuspenseException
10433
10553
  ? getSuspendedThenable()
10434
- : thrownValue === AbortSigil
10554
+ : 1 === request.status
10435
10555
  ? request.fatalError
10436
10556
  : thrownValue;
10437
10557
  if ("object" === typeof x$jscomp$0 && null !== x$jscomp$0) {
@@ -11352,12 +11472,15 @@
11352
11472
  CLOSED$1 = 3,
11353
11473
  currentRequest = null,
11354
11474
  debugID = null,
11475
+ reusableInfinitePromiseModel = stringify("$@"),
11355
11476
  modelRoot = !1,
11356
11477
  emptyRoot = {},
11478
+ haltSymbol = Symbol("halt"),
11357
11479
  bind$1 = Function.prototype.bind,
11358
11480
  ObjectPrototype = Object.prototype,
11359
11481
  knownServerReferences = new WeakMap(),
11360
11482
  boundCache = new WeakMap(),
11483
+ fakeServerFunctionIdx = 0,
11361
11484
  FunctionBind = Function.prototype.bind,
11362
11485
  ArraySlice = Array.prototype.slice,
11363
11486
  REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
@@ -12319,7 +12442,6 @@
12319
12442
  },
12320
12443
  callLazyInitInDEV =
12321
12444
  callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
12322
- AbortSigil = {},
12323
12445
  didWarnAboutBadClass = {},
12324
12446
  didWarnAboutContextTypes = {},
12325
12447
  didWarnAboutContextTypeOnFunctionComponent = {},
@@ -12682,5 +12804,5 @@
12682
12804
  });
12683
12805
  });
12684
12806
  };
12685
- exports.version = "19.0.0-experimental-1eaccd82-20240816";
12807
+ exports.version = "19.0.0-experimental-6ebfd5b0-20240818";
12686
12808
  })();
@@ -644,10 +644,12 @@ function serializeThenable(request, task, thenable) {
644
644
  default:
645
645
  if (1 === request.status)
646
646
  return (
647
- (newTask.status = 3),
648
- (task = stringify(serializeByValueID$1(request.fatalError))),
649
- emitModelChunk(request, newTask.id, task),
650
647
  request.abortableTasks.delete(newTask),
648
+ (newTask.status = 3),
649
+ request.fatalError === haltSymbol
650
+ ? emitModelChunk(request, newTask.id, reusableInfinitePromiseModel)
651
+ : ((task = stringify(serializeByValueID$1(request.fatalError))),
652
+ emitModelChunk(request, newTask.id, task)),
651
653
  newTask.id
652
654
  );
653
655
  "string" !== typeof thenable.status &&
@@ -708,19 +710,19 @@ function serializeReadableStream(request, task, stream) {
708
710
  if (!aborted) {
709
711
  aborted = !0;
710
712
  request.abortListeners.delete(error);
711
- if (
713
+ if (request.fatalError === haltSymbol) var cancelWith = reason;
714
+ else
712
715
  "object" === typeof reason &&
713
716
  null !== reason &&
714
717
  reason.$$typeof === REACT_POSTPONE_TYPE
715
- )
716
- logPostpone$1(request, reason.message, streamTask),
717
- emitPostponeChunk(request, streamTask.id);
718
- else {
719
- var digest = logRecoverableError$1(request, reason, streamTask);
720
- emitErrorChunk(request, streamTask.id, digest);
721
- }
722
- enqueueFlush(request);
723
- reader.cancel(reason).then(error, error);
718
+ ? ((cancelWith = reason),
719
+ logPostpone$1(request, reason.message, streamTask),
720
+ emitPostponeChunk(request, streamTask.id))
721
+ : ((cancelWith = reason),
722
+ (reason = logRecoverableError$1(request, reason, streamTask)),
723
+ emitErrorChunk(request, streamTask.id, reason)),
724
+ enqueueFlush(request);
725
+ reader.cancel(cancelWith).then(error, error);
724
726
  }
725
727
  }
726
728
  var supportsBYOB = stream.supportsBYOB;
@@ -784,20 +786,20 @@ function serializeAsyncIterable(request, task, iterable, iterator) {
784
786
  if (!aborted) {
785
787
  aborted = !0;
786
788
  request.abortListeners.delete(error);
787
- if (
789
+ if (request.fatalError === haltSymbol) var throwWith = reason;
790
+ else
788
791
  "object" === typeof reason &&
789
792
  null !== reason &&
790
793
  reason.$$typeof === REACT_POSTPONE_TYPE
791
- )
792
- logPostpone$1(request, reason.message, streamTask),
793
- emitPostponeChunk(request, streamTask.id);
794
- else {
795
- var digest = logRecoverableError$1(request, reason, streamTask);
796
- emitErrorChunk(request, streamTask.id, digest);
797
- }
798
- enqueueFlush(request);
794
+ ? ((throwWith = reason),
795
+ logPostpone$1(request, reason.message, streamTask),
796
+ emitPostponeChunk(request, streamTask.id))
797
+ : ((throwWith = reason),
798
+ (reason = logRecoverableError$1(request, reason, streamTask)),
799
+ emitErrorChunk(request, streamTask.id, reason)),
800
+ enqueueFlush(request);
799
801
  "function" === typeof iterator.throw &&
800
- iterator.throw(reason).then(error, error);
802
+ iterator.throw(throwWith).then(error, error);
801
803
  }
802
804
  }
803
805
  iterable = iterable === iterator;
@@ -1007,6 +1009,7 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1007
1009
  function serializeByValueID$1(id) {
1008
1010
  return "$" + id.toString(16);
1009
1011
  }
1012
+ var reusableInfinitePromiseModel = stringify("$@");
1010
1013
  function encodeReferenceChunk(request, id, reference) {
1011
1014
  request = stringify(reference);
1012
1015
  return id.toString(16) + ":" + request + "\n";
@@ -1043,11 +1046,14 @@ function serializeBlob(request, blob) {
1043
1046
  if (!aborted) {
1044
1047
  aborted = !0;
1045
1048
  request.abortListeners.delete(error);
1046
- var digest = logRecoverableError$1(request, reason, newTask);
1047
- emitErrorChunk(request, newTask.id, digest);
1048
- request.abortableTasks.delete(newTask);
1049
- enqueueFlush(request);
1050
- reader.cancel(reason).then(error, error);
1049
+ if (request.fatalError === haltSymbol) var cancelWith = reason;
1050
+ else
1051
+ (cancelWith = reason),
1052
+ (reason = logRecoverableError$1(request, reason, newTask)),
1053
+ emitErrorChunk(request, newTask.id, reason),
1054
+ request.abortableTasks.delete(newTask),
1055
+ enqueueFlush(request);
1056
+ reader.cancel(cancelWith).then(error, error);
1051
1057
  }
1052
1058
  }
1053
1059
  var model = [blob.type],
@@ -1077,12 +1083,12 @@ function renderModel(request, task, parent, key, value) {
1077
1083
  : thrownValue;
1078
1084
  if ("object" === typeof key && null !== key) {
1079
1085
  if ("function" === typeof key.then) {
1080
- if (1 === request.status)
1081
- return (
1082
- (task.status = 3),
1083
- (task = request.fatalError),
1084
- parent ? "$L" + task.toString(16) : serializeByValueID$1(task)
1085
- );
1086
+ if (1 === request.status) {
1087
+ task.status = 3;
1088
+ if (request.fatalError === haltSymbol) return "$@";
1089
+ task = request.fatalError;
1090
+ return parent ? "$L" + task.toString(16) : serializeByValueID$1(task);
1091
+ }
1086
1092
  request = createTask(
1087
1093
  request,
1088
1094
  task.model,
@@ -1110,12 +1116,12 @@ function renderModel(request, task, parent, key, value) {
1110
1116
  parent ? "$L" + value.toString(16) : serializeByValueID$1(value)
1111
1117
  );
1112
1118
  }
1113
- if (1 === request.status)
1114
- return (
1115
- (task.status = 3),
1116
- (task = request.fatalError),
1117
- parent ? "$L" + task.toString(16) : serializeByValueID$1(task)
1118
- );
1119
+ if (1 === request.status) {
1120
+ task.status = 3;
1121
+ if (request.fatalError === haltSymbol) return "$@";
1122
+ task = request.fatalError;
1123
+ return parent ? "$L" + task.toString(16) : serializeByValueID$1(task);
1124
+ }
1119
1125
  task.keyPath = prevKeyPath;
1120
1126
  task.implicitSlot = prevImplicitSlot;
1121
1127
  request.pendingChunks++;
@@ -1547,8 +1553,12 @@ function retryTask$1(request, task) {
1547
1553
  if (1 === request.status) {
1548
1554
  request.abortableTasks.delete(task);
1549
1555
  task.status = 3;
1550
- var model = stringify(serializeByValueID$1(request.fatalError));
1551
- emitModelChunk(request, task.id, model);
1556
+ if (request.fatalError === haltSymbol)
1557
+ emitModelChunk(request, task.id, reusableInfinitePromiseModel);
1558
+ else {
1559
+ var model = stringify(serializeByValueID$1(request.fatalError));
1560
+ emitModelChunk(request, task.id, model);
1561
+ }
1552
1562
  return;
1553
1563
  }
1554
1564
  task.status = 0;
@@ -1565,12 +1575,18 @@ function retryTask$1(request, task) {
1565
1575
  return;
1566
1576
  }
1567
1577
  }
1568
- if (1 === request.status) {
1569
- request.abortableTasks.delete(task);
1570
- task.status = 3;
1571
- var model$25 = stringify(serializeByValueID$1(request.fatalError));
1572
- emitModelChunk(request, task.id, model$25);
1573
- } else {
1578
+ if (1 === request.status)
1579
+ if (
1580
+ (request.abortableTasks.delete(task),
1581
+ (task.status = 3),
1582
+ request.fatalError === haltSymbol)
1583
+ )
1584
+ emitModelChunk(request, task.id, reusableInfinitePromiseModel);
1585
+ else {
1586
+ var model$25 = stringify(serializeByValueID$1(request.fatalError));
1587
+ emitModelChunk(request, task.id, model$25);
1588
+ }
1589
+ else {
1574
1590
  request.abortableTasks.delete(task);
1575
1591
  task.status = 4;
1576
1592
  var digest = logRecoverableError$1(request, x, task);
@@ -1724,7 +1740,8 @@ function abort$1(request, reason) {
1724
1740
  fatalError$1(request, error$33);
1725
1741
  }
1726
1742
  }
1727
- var bind$1 = Function.prototype.bind,
1743
+ var haltSymbol = Symbol("halt"),
1744
+ bind$1 = Function.prototype.bind,
1728
1745
  ObjectPrototype = Object.prototype,
1729
1746
  knownServerReferences = new WeakMap();
1730
1747
  function serializeNumber(number) {
@@ -2229,6 +2246,22 @@ function bind() {
2229
2246
  }
2230
2247
  return newFn;
2231
2248
  }
2249
+ function createBoundServerReference(metaData, callServer, encodeFormAction) {
2250
+ function action() {
2251
+ var args = Array.prototype.slice.call(arguments);
2252
+ return bound
2253
+ ? "fulfilled" === bound.status
2254
+ ? callServer(id, bound.value.concat(args))
2255
+ : Promise.resolve(bound).then(function (boundArgs) {
2256
+ return callServer(id, boundArgs.concat(args));
2257
+ })
2258
+ : callServer(id, args);
2259
+ }
2260
+ var id = metaData.id,
2261
+ bound = metaData.bound;
2262
+ registerServerReference(action, { id: id, bound: bound }, encodeFormAction);
2263
+ return action;
2264
+ }
2232
2265
  var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
2233
2266
  function getComponentNameFromType(type) {
2234
2267
  if (null == type) return null;
@@ -2514,20 +2547,11 @@ function waitForReference(
2514
2547
  return null;
2515
2548
  }
2516
2549
  function createServerReferenceProxy(response, metaData) {
2517
- function proxy() {
2518
- var args = Array.prototype.slice.call(arguments),
2519
- p = metaData.bound;
2520
- return p
2521
- ? "fulfilled" === p.status
2522
- ? callServer(metaData.id, p.value.concat(args))
2523
- : Promise.resolve(p).then(function (bound) {
2524
- return callServer(metaData.id, bound.concat(args));
2525
- })
2526
- : callServer(metaData.id, args);
2527
- }
2528
- var callServer = response._callServer;
2529
- registerServerReference(proxy, metaData, response._encodeFormAction);
2530
- return proxy;
2550
+ return createBoundServerReference(
2551
+ metaData,
2552
+ response._callServer,
2553
+ response._encodeFormAction
2554
+ );
2531
2555
  }
2532
2556
  function getOutlinedModel(response, reference, parentObject, key, map) {
2533
2557
  reference = reference.split(":");
@@ -5937,7 +5961,6 @@ function createRequest(
5937
5961
  formState
5938
5962
  );
5939
5963
  }
5940
- var AbortSigil = {};
5941
5964
  function pingTask(request, task) {
5942
5965
  request.pingedTasks.push(task);
5943
5966
  1 === request.pingedTasks.length &&
@@ -6266,14 +6289,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
6266
6289
  }
6267
6290
  else defaultProps.queue = null;
6268
6291
  type = newProps.render();
6269
- if (1 === request.status) throw AbortSigil;
6292
+ if (1 === request.status) throw null;
6270
6293
  props = task.keyPath;
6271
6294
  task.keyPath = keyPath;
6272
6295
  renderNodeDestructive(request, task, type, -1);
6273
6296
  task.keyPath = props;
6274
6297
  } else {
6275
6298
  type = renderWithHooks(request, task, keyPath, type, props, void 0);
6276
- if (1 === request.status) throw AbortSigil;
6299
+ if (1 === request.status) throw null;
6277
6300
  finishFunctionComponent(
6278
6301
  request,
6279
6302
  task,
@@ -6453,8 +6476,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
6453
6476
  renderNode(request, task, ref, -1), (propName.status = 1);
6454
6477
  } catch (thrownValue) {
6455
6478
  throw (
6456
- ((propName.status = thrownValue === AbortSigil ? 3 : 4),
6457
- thrownValue)
6479
+ ((propName.status = 1 === request.status ? 3 : 4), thrownValue)
6458
6480
  );
6459
6481
  } finally {
6460
6482
  (task.blockedSegment = contextType), (task.keyPath = type);
@@ -6495,7 +6517,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
6495
6517
  }
6496
6518
  } catch (thrownValue$84) {
6497
6519
  (propName$89.status = 4),
6498
- thrownValue$84 === AbortSigil
6520
+ 1 === request.status
6499
6521
  ? ((textEmbedded.status = 3), (newProps = request.fatalError))
6500
6522
  : ((textEmbedded.status = 4), (newProps = thrownValue$84)),
6501
6523
  (defaultProps = getThrownInfo(task.componentStack)),
@@ -6607,7 +6629,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
6607
6629
  case REACT_LAZY_TYPE:
6608
6630
  newProps = type._init;
6609
6631
  type = newProps(type._payload);
6610
- if (1 === request.status) throw AbortSigil;
6632
+ if (1 === request.status) throw null;
6611
6633
  renderElement(request, task, keyPath, type, props, ref);
6612
6634
  return;
6613
6635
  }
@@ -6843,7 +6865,7 @@ function retryNode(request, task) {
6843
6865
  case REACT_LAZY_TYPE:
6844
6866
  childNodes = node._init;
6845
6867
  node = childNodes(node._payload);
6846
- if (1 === request.status) throw AbortSigil;
6868
+ if (1 === request.status) throw null;
6847
6869
  renderNodeDestructive(request, task, node, childIndex);
6848
6870
  return;
6849
6871
  }
@@ -7575,7 +7597,9 @@ function performWork(request$jscomp$1) {
7575
7597
  erroredReplay(
7576
7598
  request$jscomp$0,
7577
7599
  task.blockedBoundary,
7578
- x === AbortSigil ? request$jscomp$0.fatalError : x,
7600
+ 1 === request$jscomp$0.status
7601
+ ? request$jscomp$0.fatalError
7602
+ : x,
7579
7603
  errorInfo,
7580
7604
  task.replay.nodes,
7581
7605
  task.replay.slots
@@ -7611,7 +7635,7 @@ function performWork(request$jscomp$1) {
7611
7635
  var x$jscomp$0 =
7612
7636
  thrownValue === SuspenseException
7613
7637
  ? getSuspendedThenable()
7614
- : thrownValue === AbortSigil
7638
+ : 1 === request.status
7615
7639
  ? request.fatalError
7616
7640
  : thrownValue;
7617
7641
  if ("object" === typeof x$jscomp$0 && null !== x$jscomp$0) {
@@ -8469,4 +8493,4 @@ exports.experimental_renderToHTML = function (children, options) {
8469
8493
  });
8470
8494
  });
8471
8495
  };
8472
- exports.version = "19.0.0-experimental-1eaccd82-20240816";
8496
+ exports.version = "19.0.0-experimental-6ebfd5b0-20240818";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-1eaccd82-20240816",
3
+ "version": "0.0.0-experimental-6ebfd5b0-20240818",
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-1eaccd82-20240816"
20
+ "react": "0.0.0-experimental-6ebfd5b0-20240818"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",