react-markup 0.0.0-experimental-d5bba18b-20241009 → 0.0.0-experimental-77f43893-20241010

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-d5bba18b-20241009";
8628
+ exports.version = "19.0.0-experimental-77f43893-20241010";
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-d5bba18b-20241009";
5706
+ exports.version = "19.0.0-experimental-77f43893-20241010";
@@ -899,20 +899,22 @@
899
899
  pingTask$1(request, newTask);
900
900
  },
901
901
  function (reason) {
902
- if (
903
- "object" === typeof reason &&
904
- null !== reason &&
905
- reason.$$typeof === REACT_POSTPONE_TYPE
906
- )
907
- logPostpone$1(request, reason.message, newTask),
908
- emitPostponeChunk(request, newTask.id, reason);
909
- else {
910
- var _digest = logRecoverableError$1(request, reason, newTask);
911
- emitErrorChunk(request, newTask.id, _digest, reason);
902
+ if (newTask.status === PENDING$3) {
903
+ if (
904
+ "object" === typeof reason &&
905
+ null !== reason &&
906
+ reason.$$typeof === REACT_POSTPONE_TYPE
907
+ )
908
+ logPostpone$1(request, reason.message, newTask),
909
+ emitPostponeChunk(request, newTask.id, reason);
910
+ else {
911
+ var _digest = logRecoverableError$1(request, reason, newTask);
912
+ emitErrorChunk(request, newTask.id, _digest, reason);
913
+ }
914
+ newTask.status = ERRORED$2;
915
+ request.abortableTasks.delete(newTask);
916
+ enqueueFlush(request);
912
917
  }
913
- newTask.status = ERRORED$2;
914
- request.abortableTasks.delete(newTask);
915
- enqueueFlush(request);
916
918
  }
917
919
  );
918
920
  return newTask.id;
@@ -1914,6 +1916,7 @@
1914
1916
  elementReference = value[ASYNC_ITERATOR];
1915
1917
  if ("function" === typeof elementReference)
1916
1918
  return renderAsyncFragment(request, task, value, elementReference);
1919
+ if (value instanceof Date) return "$D" + value.toJSON();
1917
1920
  elementReference = getPrototypeOf(value);
1918
1921
  if (
1919
1922
  elementReference !== ObjectPrototype$1 &&
@@ -2217,8 +2220,8 @@
2217
2220
  parentPropertyName,
2218
2221
  value
2219
2222
  ) {
2220
- var originalValue = parent[parentPropertyName];
2221
2223
  if (null === value) return null;
2224
+ if (value === REACT_ELEMENT_TYPE) return "$";
2222
2225
  if ("object" === typeof value) {
2223
2226
  if (isClientReference(value))
2224
2227
  return serializeClientReference(
@@ -2234,35 +2237,31 @@
2234
2237
  return "$T" + parent;
2235
2238
  parent = request.writtenObjects.get(value);
2236
2239
  if (void 0 !== parent) return parent;
2237
- if (0 >= counter.objectLimit) return "$Y";
2240
+ if (0 >= counter.objectLimit && !doNotLimit.has(value)) return "$Y";
2238
2241
  counter.objectLimit--;
2239
2242
  switch (value.$$typeof) {
2240
2243
  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
- );
2244
+ null != value._owner && outlineComponentInfo(request, value._owner);
2245
+ counter = null;
2246
+ if (null != value._debugStack)
2247
+ for (
2248
+ counter = filterStackTrace(request, value._debugStack, 1),
2249
+ doNotLimit.add(counter),
2250
+ request = 0;
2251
+ request < counter.length;
2252
+ request++
2253
+ )
2254
+ doNotLimit.add(counter[request]);
2255
+ doNotLimit.add(value.props);
2256
+ return [
2257
+ REACT_ELEMENT_TYPE,
2258
+ value.type,
2259
+ value.key,
2260
+ value.props,
2261
+ value._owner,
2262
+ counter,
2263
+ value._store.validated
2264
+ ];
2266
2265
  }
2267
2266
  if ("function" === typeof value.then) {
2268
2267
  switch (value.status) {
@@ -2273,79 +2272,93 @@
2273
2272
  );
2274
2273
  case "rejected":
2275
2274
  return (
2276
- (value = value.reason),
2275
+ (counter = value.reason),
2277
2276
  request.pendingChunks++,
2278
- (counter = request.nextChunkId++),
2279
- "object" === typeof value &&
2280
- null !== value &&
2281
- value.$$typeof === REACT_POSTPONE_TYPE
2282
- ? emitPostponeChunk(request, counter, value)
2283
- : emitErrorChunk(request, counter, "", value),
2284
- "$@" + counter.toString(16)
2277
+ (value = request.nextChunkId++),
2278
+ "object" === typeof counter &&
2279
+ null !== counter &&
2280
+ counter.$$typeof === REACT_POSTPONE_TYPE
2281
+ ? emitPostponeChunk(request, value, counter)
2282
+ : emitErrorChunk(request, value, "", counter),
2283
+ "$@" + value.toString(16)
2285
2284
  );
2286
2285
  }
2287
2286
  return "$@";
2288
2287
  }
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
2295
- ? ((value = Array.from(value)),
2296
- "$W" +
2297
- outlineConsoleValue(request, counter, value).toString(16))
2298
- : "function" === typeof FormData && value instanceof FormData
2299
- ? serializeFormData(request, value)
2300
- : value instanceof Error
2301
- ? serializeErrorValue(request, value)
2302
- : value instanceof ArrayBuffer
2303
- ? serializeTypedArray(request, "A", new Uint8Array(value))
2304
- : value instanceof Int8Array
2305
- ? serializeTypedArray(request, "O", value)
2306
- : value instanceof Uint8Array
2307
- ? serializeTypedArray(request, "o", value)
2308
- : value instanceof Uint8ClampedArray
2309
- ? serializeTypedArray(request, "U", value)
2310
- : value instanceof Int16Array
2311
- ? serializeTypedArray(request, "S", value)
2312
- : value instanceof Uint16Array
2313
- ? serializeTypedArray(request, "s", value)
2314
- : value instanceof Int32Array
2315
- ? serializeTypedArray(request, "L", value)
2316
- : value instanceof Uint32Array
2317
- ? serializeTypedArray(request, "l", value)
2318
- : value instanceof Float32Array
2319
- ? serializeTypedArray(request, "G", value)
2320
- : value instanceof Float64Array
2321
- ? serializeTypedArray(request, "g", value)
2322
- : value instanceof BigInt64Array
2323
- ? serializeTypedArray(
2324
- request,
2325
- "M",
2326
- value
2327
- )
2328
- : value instanceof BigUint64Array
2329
- ? serializeTypedArray(
2330
- request,
2331
- "m",
2332
- value
2333
- )
2334
- : value instanceof DataView
2335
- ? serializeTypedArray(
2336
- request,
2337
- "V",
2338
- value
2339
- )
2340
- : "function" === typeof Blob &&
2341
- value instanceof Blob
2342
- ? serializeBlob(request, value)
2343
- : getIteratorFn(value)
2344
- ? Array.from(value)
2345
- : value;
2288
+ if (isArrayImpl(value)) return value;
2289
+ if (value instanceof Map) {
2290
+ value = Array.from(value);
2291
+ counter.objectLimit++;
2292
+ for (parent = 0; parent < value.length; parent++) {
2293
+ var entry = value[parent];
2294
+ doNotLimit.add(entry);
2295
+ parentPropertyName = entry[0];
2296
+ entry = entry[1];
2297
+ "object" === typeof parentPropertyName &&
2298
+ null !== parentPropertyName &&
2299
+ doNotLimit.add(parentPropertyName);
2300
+ "object" === typeof entry &&
2301
+ null !== entry &&
2302
+ doNotLimit.add(entry);
2303
+ }
2304
+ return (
2305
+ "$Q" + outlineConsoleValue(request, counter, value).toString(16)
2306
+ );
2307
+ }
2308
+ if (value instanceof Set) {
2309
+ value = Array.from(value);
2310
+ counter.objectLimit++;
2311
+ for (parent = 0; parent < value.length; parent++)
2312
+ (parentPropertyName = value[parent]),
2313
+ "object" === typeof parentPropertyName &&
2314
+ null !== parentPropertyName &&
2315
+ doNotLimit.add(parentPropertyName);
2316
+ return (
2317
+ "$W" + outlineConsoleValue(request, counter, value).toString(16)
2318
+ );
2319
+ }
2320
+ return "function" === typeof FormData && value instanceof FormData
2321
+ ? serializeFormData(request, value)
2322
+ : value instanceof Error
2323
+ ? serializeErrorValue(request, value)
2324
+ : value instanceof ArrayBuffer
2325
+ ? serializeTypedArray(request, "A", new Uint8Array(value))
2326
+ : value instanceof Int8Array
2327
+ ? serializeTypedArray(request, "O", value)
2328
+ : value instanceof Uint8Array
2329
+ ? serializeTypedArray(request, "o", value)
2330
+ : value instanceof Uint8ClampedArray
2331
+ ? serializeTypedArray(request, "U", value)
2332
+ : value instanceof Int16Array
2333
+ ? serializeTypedArray(request, "S", value)
2334
+ : value instanceof Uint16Array
2335
+ ? serializeTypedArray(request, "s", value)
2336
+ : value instanceof Int32Array
2337
+ ? serializeTypedArray(request, "L", value)
2338
+ : value instanceof Uint32Array
2339
+ ? serializeTypedArray(request, "l", value)
2340
+ : value instanceof Float32Array
2341
+ ? serializeTypedArray(request, "G", value)
2342
+ : value instanceof Float64Array
2343
+ ? serializeTypedArray(request, "g", value)
2344
+ : value instanceof BigInt64Array
2345
+ ? serializeTypedArray(request, "M", value)
2346
+ : value instanceof BigUint64Array
2347
+ ? serializeTypedArray(request, "m", value)
2348
+ : value instanceof DataView
2349
+ ? serializeTypedArray(request, "V", value)
2350
+ : "function" === typeof Blob &&
2351
+ value instanceof Blob
2352
+ ? serializeBlob(request, value)
2353
+ : getIteratorFn(value)
2354
+ ? Array.from(value)
2355
+ : value;
2346
2356
  }
2347
2357
  if ("string" === typeof value) {
2348
- if ("Z" === value[value.length - 1] && originalValue instanceof Date)
2358
+ if (
2359
+ "Z" === value[value.length - 1] &&
2360
+ parent[parentPropertyName] instanceof Date
2361
+ )
2349
2362
  request = "$D" + value;
2350
2363
  else {
2351
2364
  if (1024 <= value.length)
@@ -2374,17 +2387,20 @@
2374
2387
  if ("symbol" === typeof value) {
2375
2388
  counter = request.writtenSymbols.get(value);
2376
2389
  if (void 0 !== counter) return serializeByValueID$1(counter);
2377
- value = value.description;
2390
+ counter = value.description;
2378
2391
  request.pendingChunks++;
2379
- counter = request.nextChunkId++;
2380
- emitSymbolChunk(request, counter, value);
2381
- return serializeByValueID$1(counter);
2392
+ value = request.nextChunkId++;
2393
+ emitSymbolChunk(request, value, counter);
2394
+ return serializeByValueID$1(value);
2382
2395
  }
2383
2396
  return "bigint" === typeof value
2384
2397
  ? "$n" + value.toString(10)
2385
- : "unknown type " + typeof value;
2398
+ : value instanceof Date
2399
+ ? "$D" + value.toJSON()
2400
+ : "unknown type " + typeof value;
2386
2401
  }
2387
2402
  function outlineConsoleValue(request, counter, model) {
2403
+ "object" === typeof model && null !== model && doNotLimit.add(model);
2388
2404
  var json = stringify(model, function (parentPropertyName, value) {
2389
2405
  try {
2390
2406
  return renderConsoleValue(
@@ -11857,7 +11873,8 @@
11857
11873
  getPrototypeOf = Object.getPrototypeOf,
11858
11874
  jsxPropsParents = new WeakMap(),
11859
11875
  jsxChildrenParents = new WeakMap(),
11860
- CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
11876
+ CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"),
11877
+ doNotLimit = new WeakSet();
11861
11878
  "object" === typeof console &&
11862
11879
  null !== console &&
11863
11880
  (patchConsole(console, "assert"),
@@ -13118,5 +13135,5 @@
13118
13135
  });
13119
13136
  });
13120
13137
  };
13121
- exports.version = "19.0.0-experimental-d5bba18b-20241009";
13138
+ exports.version = "19.0.0-experimental-77f43893-20241010";
13122
13139
  })();
@@ -674,16 +674,17 @@ function serializeThenable(request, task, thenable) {
674
674
  pingTask$1(request, newTask);
675
675
  },
676
676
  function (reason) {
677
- "object" === typeof reason &&
678
- null !== reason &&
679
- reason.$$typeof === REACT_POSTPONE_TYPE
680
- ? (logPostpone$1(request, reason.message, newTask),
681
- emitPostponeChunk(request, newTask.id))
682
- : ((reason = logRecoverableError$1(request, reason, newTask)),
683
- emitErrorChunk(request, newTask.id, reason));
684
- newTask.status = 4;
685
- request.abortableTasks.delete(newTask);
686
- enqueueFlush(request);
677
+ 0 === newTask.status &&
678
+ ("object" === typeof reason &&
679
+ null !== reason &&
680
+ reason.$$typeof === REACT_POSTPONE_TYPE
681
+ ? (logPostpone$1(request, reason.message, newTask),
682
+ emitPostponeChunk(request, newTask.id))
683
+ : ((reason = logRecoverableError$1(request, reason, newTask)),
684
+ emitErrorChunk(request, newTask.id, reason)),
685
+ (newTask.status = 4),
686
+ request.abortableTasks.delete(newTask),
687
+ enqueueFlush(request));
687
688
  }
688
689
  );
689
690
  return newTask.id;
@@ -1368,6 +1369,7 @@ function renderModelDestructive(
1368
1369
  ))),
1369
1370
  value
1370
1371
  );
1372
+ if (value instanceof Date) return "$D" + value.toJSON();
1371
1373
  request = getPrototypeOf(value);
1372
1374
  if (
1373
1375
  request !== ObjectPrototype$1 &&
@@ -8679,4 +8681,4 @@ exports.experimental_renderToHTML = function (children, options) {
8679
8681
  });
8680
8682
  });
8681
8683
  };
8682
- exports.version = "19.0.0-experimental-d5bba18b-20241009";
8684
+ exports.version = "19.0.0-experimental-77f43893-20241010";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markup",
3
- "version": "0.0.0-experimental-d5bba18b-20241009",
3
+ "version": "0.0.0-experimental-77f43893-20241010",
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-d5bba18b-20241009"
20
+ "react": "0.0.0-experimental-77f43893-20241010"
21
21
  },
22
22
  "files": [
23
23
  "LICENSE",