react-markup 0.0.0-experimental-7283a213-20241206 → 0.0.0-experimental-372ec00c-20241209

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.
@@ -8635,5 +8635,5 @@
8635
8635
  });
8636
8636
  });
8637
8637
  };
8638
- exports.version = "19.0.0-experimental-7283a213-20241206";
8638
+ exports.version = "19.0.0-experimental-372ec00c-20241209";
8639
8639
  })();
@@ -5710,4 +5710,4 @@ exports.experimental_renderToHTML = function (children, options) {
5710
5710
  });
5711
5711
  });
5712
5712
  };
5713
- exports.version = "19.0.0-experimental-7283a213-20241206";
5713
+ exports.version = "19.0.0-experimental-372ec00c-20241209";
@@ -179,14 +179,6 @@
179
179
  suspendedThenable$1 = null;
180
180
  return thenable;
181
181
  }
182
- function prepareToUseHooksForComponent(
183
- prevThenableState,
184
- componentDebugInfo
185
- ) {
186
- thenableIndexCounter$1 = 0;
187
- thenableState$1 = prevThenableState;
188
- currentComponentDebugInfo = componentDebugInfo;
189
- }
190
182
  function getThenableStateAfterSuspending$1() {
191
183
  var state = thenableState$1 || [];
192
184
  state._componentDebugInfo = currentComponentDebugInfo;
@@ -1148,6 +1140,71 @@
1148
1140
  currentOwner = null;
1149
1141
  }
1150
1142
  }
1143
+ function processServerComponentReturnValue(
1144
+ request,
1145
+ task,
1146
+ Component,
1147
+ result
1148
+ ) {
1149
+ if (
1150
+ "object" !== typeof result ||
1151
+ null === result ||
1152
+ isClientReference(result)
1153
+ )
1154
+ return result;
1155
+ if ("function" === typeof result.then)
1156
+ return (
1157
+ result.then(function (resolvedValue) {
1158
+ "object" === typeof resolvedValue &&
1159
+ null !== resolvedValue &&
1160
+ resolvedValue.$$typeof === REACT_ELEMENT_TYPE &&
1161
+ (resolvedValue._store.validated = 1);
1162
+ }, voidHandler),
1163
+ "fulfilled" === result.status
1164
+ ? result.value
1165
+ : createLazyWrapperAroundWakeable(result)
1166
+ );
1167
+ result.$$typeof === REACT_ELEMENT_TYPE && (result._store.validated = 1);
1168
+ var iteratorFn = getIteratorFn(result);
1169
+ if (iteratorFn) {
1170
+ var multiShot = _defineProperty({}, Symbol.iterator, function () {
1171
+ var iterator = iteratorFn.call(result);
1172
+ iterator !== result ||
1173
+ ("[object GeneratorFunction]" ===
1174
+ Object.prototype.toString.call(Component) &&
1175
+ "[object Generator]" ===
1176
+ Object.prototype.toString.call(result)) ||
1177
+ callWithDebugContextInDEV(request, task, function () {
1178
+ console.error(
1179
+ "Returning an Iterator from a Server Component is not supported since it cannot be looped over more than once. "
1180
+ );
1181
+ });
1182
+ return iterator;
1183
+ });
1184
+ multiShot._debugInfo = result._debugInfo;
1185
+ return multiShot;
1186
+ }
1187
+ return "function" !== typeof result[ASYNC_ITERATOR] ||
1188
+ ("function" === typeof ReadableStream &&
1189
+ result instanceof ReadableStream)
1190
+ ? result
1191
+ : ((multiShot = _defineProperty({}, ASYNC_ITERATOR, function () {
1192
+ var iterator = result[ASYNC_ITERATOR]();
1193
+ iterator !== result ||
1194
+ ("[object AsyncGeneratorFunction]" ===
1195
+ Object.prototype.toString.call(Component) &&
1196
+ "[object AsyncGenerator]" ===
1197
+ Object.prototype.toString.call(result)) ||
1198
+ callWithDebugContextInDEV(request, task, function () {
1199
+ console.error(
1200
+ "Returning an AsyncIterator from a Server Component is not supported since it cannot be looped over more than once. "
1201
+ );
1202
+ });
1203
+ return iterator;
1204
+ })),
1205
+ (multiShot._debugInfo = result._debugInfo),
1206
+ multiShot);
1207
+ }
1151
1208
  function renderFunctionComponent$1(
1152
1209
  request,
1153
1210
  task,
@@ -1185,7 +1242,9 @@
1185
1242
  2 === validated &&
1186
1243
  warnForMissingKey$1(request, key, componentDebugInfo, task.debugTask);
1187
1244
  }
1188
- prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
1245
+ thenableIndexCounter$1 = 0;
1246
+ thenableState$1 = prevThenableState;
1247
+ currentComponentDebugInfo = componentDebugInfo;
1189
1248
  props = task.debugTask
1190
1249
  ? task.debugTask.run(
1191
1250
  callComponentInDEV$1.bind(
@@ -1205,74 +1264,21 @@
1205
1264
  props.then(voidHandler, voidHandler),
1206
1265
  null)
1207
1266
  );
1208
- if (
1209
- "object" === typeof props &&
1210
- null !== props &&
1211
- !isClientReference(props)
1212
- ) {
1213
- if ("function" === typeof props.then) {
1214
- validated = props;
1215
- validated.then(function (resolvedValue) {
1216
- "object" === typeof resolvedValue &&
1217
- null !== resolvedValue &&
1218
- resolvedValue.$$typeof === REACT_ELEMENT_TYPE &&
1219
- (resolvedValue._store.validated = 1);
1220
- }, voidHandler);
1221
- if ("fulfilled" === validated.status) return validated.value;
1222
- props = createLazyWrapperAroundWakeable(props);
1223
- }
1224
- var iteratorFn = getIteratorFn(props);
1225
- if (iteratorFn) {
1226
- var iterableChild = props;
1227
- props = _defineProperty({}, Symbol.iterator, function () {
1228
- var iterator = iteratorFn.call(iterableChild);
1229
- iterator !== iterableChild ||
1230
- ("[object GeneratorFunction]" ===
1231
- Object.prototype.toString.call(Component) &&
1232
- "[object Generator]" ===
1233
- Object.prototype.toString.call(iterableChild)) ||
1234
- callWithDebugContextInDEV(request, task, function () {
1235
- console.error(
1236
- "Returning an Iterator from a Server Component is not supported since it cannot be looped over more than once. "
1237
- );
1238
- });
1239
- return iterator;
1240
- });
1241
- props._debugInfo = iterableChild._debugInfo;
1242
- } else if (
1243
- "function" !== typeof props[ASYNC_ITERATOR] ||
1244
- ("function" === typeof ReadableStream &&
1245
- props instanceof ReadableStream)
1246
- )
1247
- props.$$typeof === REACT_ELEMENT_TYPE && (props._store.validated = 1);
1248
- else {
1249
- var _iterableChild = props;
1250
- props = _defineProperty({}, ASYNC_ITERATOR, function () {
1251
- var iterator = _iterableChild[ASYNC_ITERATOR]();
1252
- iterator !== _iterableChild ||
1253
- ("[object AsyncGeneratorFunction]" ===
1254
- Object.prototype.toString.call(Component) &&
1255
- "[object AsyncGenerator]" ===
1256
- Object.prototype.toString.call(_iterableChild)) ||
1257
- callWithDebugContextInDEV(request, task, function () {
1258
- console.error(
1259
- "Returning an AsyncIterator from a Server Component is not supported since it cannot be looped over more than once. "
1260
- );
1261
- });
1262
- return iterator;
1263
- });
1264
- props._debugInfo = _iterableChild._debugInfo;
1265
- }
1266
- }
1267
- validated = task.keyPath;
1268
- prevThenableState = task.implicitSlot;
1267
+ props = processServerComponentReturnValue(
1268
+ request,
1269
+ task,
1270
+ Component,
1271
+ props
1272
+ );
1273
+ Component = task.keyPath;
1274
+ validated = task.implicitSlot;
1269
1275
  null !== key
1270
- ? (task.keyPath = null === validated ? key : validated + "," + key)
1271
- : null === validated && (task.implicitSlot = !0);
1272
- key = renderModelDestructive(request, task, emptyRoot, "", props);
1273
- task.keyPath = validated;
1274
- task.implicitSlot = prevThenableState;
1275
- return key;
1276
+ ? (task.keyPath = null === Component ? key : Component + "," + key)
1277
+ : null === Component && (task.implicitSlot = !0);
1278
+ request = renderModelDestructive(request, task, emptyRoot, "", props);
1279
+ task.keyPath = Component;
1280
+ task.implicitSlot = validated;
1281
+ return request;
1276
1282
  }
1277
1283
  function warnForMissingKey$1(request, key, componentDebugInfo, debugTask) {
1278
1284
  function logKeyError() {
@@ -4479,15 +4485,17 @@
4479
4485
  initializeFakeStack(response, debugInfo.owner));
4480
4486
  }
4481
4487
  function resolveDebugInfo(response, id, debugInfo) {
4482
- initializeFakeTask(
4483
- response,
4484
- debugInfo,
4485
- void 0 === debugInfo.env ? response._rootEnvironmentName : debugInfo.env
4486
- );
4488
+ var env =
4489
+ void 0 === debugInfo.env
4490
+ ? response._rootEnvironmentName
4491
+ : debugInfo.env;
4492
+ void 0 !== debugInfo.stack &&
4493
+ initializeFakeTask(response, debugInfo, env);
4487
4494
  null === debugInfo.owner && null != response._debugRootOwner
4488
4495
  ? ((debugInfo.owner = response._debugRootOwner),
4489
4496
  (debugInfo.debugStack = response._debugRootStack))
4490
- : initializeFakeStack(response, debugInfo);
4497
+ : void 0 !== debugInfo.stack &&
4498
+ initializeFakeStack(response, debugInfo);
4491
4499
  response = getChunk(response, id);
4492
4500
  (response._debugInfo || (response._debugInfo = [])).push(debugInfo);
4493
4501
  }
@@ -13169,5 +13177,5 @@
13169
13177
  });
13170
13178
  });
13171
13179
  };
13172
- exports.version = "19.0.0-experimental-7283a213-20241206";
13180
+ exports.version = "19.0.0-experimental-372ec00c-20241209";
13173
13181
  })();
@@ -889,63 +889,57 @@ function createLazyWrapperAroundWakeable(wakeable) {
889
889
  return { $$typeof: REACT_LAZY_TYPE, _payload: wakeable, _init: readThenable };
890
890
  }
891
891
  function voidHandler() {}
892
+ function processServerComponentReturnValue(request, task, Component, result) {
893
+ if (
894
+ "object" !== typeof result ||
895
+ null === result ||
896
+ result.$$typeof === CLIENT_REFERENCE_TAG$1
897
+ )
898
+ return result;
899
+ if ("function" === typeof result.then)
900
+ return "fulfilled" === result.status
901
+ ? result.value
902
+ : createLazyWrapperAroundWakeable(result);
903
+ var iteratorFn = getIteratorFn(result);
904
+ return iteratorFn
905
+ ? ((request = {}),
906
+ (request[Symbol.iterator] = function () {
907
+ return iteratorFn.call(result);
908
+ }),
909
+ request)
910
+ : "function" !== typeof result[ASYNC_ITERATOR] ||
911
+ ("function" === typeof ReadableStream &&
912
+ result instanceof ReadableStream)
913
+ ? result
914
+ : ((request = {}),
915
+ (request[ASYNC_ITERATOR] = function () {
916
+ return result[ASYNC_ITERATOR]();
917
+ }),
918
+ request);
919
+ }
892
920
  function renderFunctionComponent$1(request, task, key, Component, props) {
893
921
  var prevThenableState = task.thenableState;
894
922
  task.thenableState = null;
895
923
  thenableIndexCounter$1 = 0;
896
924
  thenableState$1 = prevThenableState;
897
- Component = Component(props, void 0);
925
+ props = Component(props, void 0);
898
926
  if (12 === request.status)
899
927
  throw (
900
- ("object" === typeof Component &&
901
- null !== Component &&
902
- "function" === typeof Component.then &&
903
- Component.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
904
- Component.then(voidHandler, voidHandler),
928
+ ("object" === typeof props &&
929
+ null !== props &&
930
+ "function" === typeof props.then &&
931
+ props.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
932
+ props.then(voidHandler, voidHandler),
905
933
  null)
906
934
  );
907
- if (
908
- "object" === typeof Component &&
909
- null !== Component &&
910
- Component.$$typeof !== CLIENT_REFERENCE_TAG$1
911
- ) {
912
- if ("function" === typeof Component.then) {
913
- props = Component;
914
- if ("fulfilled" === props.status) return props.value;
915
- Component = createLazyWrapperAroundWakeable(Component);
916
- }
917
- var iteratorFn = getIteratorFn(Component);
918
- if (iteratorFn) {
919
- var iterableChild = Component;
920
- Component = {};
921
- Component =
922
- ((Component[Symbol.iterator] = function () {
923
- return iteratorFn.call(iterableChild);
924
- }),
925
- Component);
926
- } else if (
927
- !(
928
- "function" !== typeof Component[ASYNC_ITERATOR] ||
929
- ("function" === typeof ReadableStream &&
930
- Component instanceof ReadableStream)
931
- )
932
- ) {
933
- var iterableChild$13 = Component;
934
- Component = {};
935
- Component =
936
- ((Component[ASYNC_ITERATOR] = function () {
937
- return iterableChild$13[ASYNC_ITERATOR]();
938
- }),
939
- Component);
940
- }
941
- }
942
- props = task.keyPath;
935
+ props = processServerComponentReturnValue(request, task, Component, props);
936
+ Component = task.keyPath;
943
937
  prevThenableState = task.implicitSlot;
944
938
  null !== key
945
- ? (task.keyPath = null === props ? key : props + "," + key)
946
- : null === props && (task.implicitSlot = !0);
947
- request = renderModelDestructive(request, task, emptyRoot, "", Component);
948
- task.keyPath = props;
939
+ ? (task.keyPath = null === Component ? key : Component + "," + key)
940
+ : null === Component && (task.implicitSlot = !0);
941
+ request = renderModelDestructive(request, task, emptyRoot, "", props);
942
+ task.keyPath = Component;
949
943
  task.implicitSlot = prevThenableState;
950
944
  return request;
951
945
  }
@@ -8696,4 +8690,4 @@ exports.experimental_renderToHTML = function (children, options) {
8696
8690
  });
8697
8691
  });
8698
8692
  };
8699
- exports.version = "19.0.0-experimental-7283a213-20241206";
8693
+ exports.version = "19.0.0-experimental-372ec00c-20241209";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-7283a213-20241206",
3
+ "version": "0.0.0-experimental-372ec00c-20241209",
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-7283a213-20241206"
20
+ "react": "0.0.0-experimental-372ec00c-20241209"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",