react-server-dom-webpack 19.2.0-canary-0038c501-20250429 → 19.2.0-canary-e9db3cc2-20250501

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.
@@ -2693,10 +2693,10 @@
2693
2693
  return hook.checkDCE ? !0 : !1;
2694
2694
  })({
2695
2695
  bundleType: 1,
2696
- version: "19.2.0-canary-0038c501-20250429",
2696
+ version: "19.2.0-canary-e9db3cc2-20250501",
2697
2697
  rendererPackageName: "react-server-dom-webpack",
2698
2698
  currentDispatcherRef: ReactSharedInternals,
2699
- reconcilerVersion: "19.2.0-canary-0038c501-20250429",
2699
+ reconcilerVersion: "19.2.0-canary-e9db3cc2-20250501",
2700
2700
  getCurrentComponentInfo: function () {
2701
2701
  return currentOwnerInDEV;
2702
2702
  }
@@ -1215,6 +1215,20 @@
1215
1215
  getAsyncIterator = getAsyncIterator.call(children);
1216
1216
  return serializeAsyncIterable(request, task, children, getAsyncIterator);
1217
1217
  }
1218
+ function deferTask(request, task) {
1219
+ task = createTask(
1220
+ request,
1221
+ task.model,
1222
+ task.keyPath,
1223
+ task.implicitSlot,
1224
+ request.abortableTasks,
1225
+ task.debugOwner,
1226
+ task.debugStack,
1227
+ task.debugTask
1228
+ );
1229
+ pingTask(request, task);
1230
+ return serializeLazyID(task.id);
1231
+ }
1218
1232
  function outlineTask(request, task) {
1219
1233
  task = createTask(
1220
1234
  request,
@@ -1229,7 +1243,7 @@
1229
1243
  retryTask(request, task);
1230
1244
  return task.status === COMPLETED
1231
1245
  ? serializeByValueID(task.id)
1232
- : "$L" + task.id.toString(16);
1246
+ : serializeLazyID(task.id);
1233
1247
  }
1234
1248
  function renderElement(request, task, type, key, ref, props, validated) {
1235
1249
  if (null !== ref && void 0 !== ref)
@@ -1418,6 +1432,9 @@
1418
1432
  function serializeByValueID(id) {
1419
1433
  return "$" + id.toString(16);
1420
1434
  }
1435
+ function serializeLazyID(id) {
1436
+ return "$L" + id.toString(16);
1437
+ }
1421
1438
  function serializeNumber(number) {
1422
1439
  return Number.isFinite(number)
1423
1440
  ? 0 === number && -Infinity === 1 / number
@@ -1447,7 +1464,7 @@
1447
1464
  existingId = writtenClientReferences.get(clientReferenceKey);
1448
1465
  if (void 0 !== existingId)
1449
1466
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1450
- ? "$L" + existingId.toString(16)
1467
+ ? serializeLazyID(existingId)
1451
1468
  : serializeByValueID(existingId);
1452
1469
  try {
1453
1470
  var config = request.bundlerConfig,
@@ -1485,7 +1502,7 @@
1485
1502
  request.completedImportChunks.push(processedChunk);
1486
1503
  writtenClientReferences.set(clientReferenceKey, importId);
1487
1504
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1488
- ? "$L" + importId.toString(16)
1505
+ ? serializeLazyID(importId)
1489
1506
  : serializeByValueID(importId);
1490
1507
  } catch (x) {
1491
1508
  return (
@@ -1625,7 +1642,7 @@
1625
1642
  return (
1626
1643
  (task.status = ABORTED),
1627
1644
  (task = request.fatalError),
1628
- parent ? "$L" + task.toString(16) : serializeByValueID(task)
1645
+ parent ? serializeLazyID(task) : serializeByValueID(task)
1629
1646
  );
1630
1647
  key =
1631
1648
  thrownValue === SuspenseException
@@ -1653,7 +1670,7 @@
1653
1670
  (task.keyPath = prevKeyPath),
1654
1671
  (task.implicitSlot = prevImplicitSlot),
1655
1672
  parent
1656
- ? "$L" + request.id.toString(16)
1673
+ ? serializeLazyID(request.id)
1657
1674
  : serializeByValueID(request.id)
1658
1675
  );
1659
1676
  task.keyPath = prevKeyPath;
@@ -1663,7 +1680,7 @@
1663
1680
  task = logRecoverableError(request, key, task);
1664
1681
  emitErrorChunk(request, prevKeyPath, task, key);
1665
1682
  return parent
1666
- ? "$L" + prevKeyPath.toString(16)
1683
+ ? serializeLazyID(prevKeyPath)
1667
1684
  : serializeByValueID(prevKeyPath);
1668
1685
  }
1669
1686
  }
@@ -1675,6 +1692,7 @@
1675
1692
  value
1676
1693
  ) {
1677
1694
  task.model = value;
1695
+ serializedSize += parentPropertyName.length;
1678
1696
  if (value === REACT_ELEMENT_TYPE) return "$";
1679
1697
  if (null === value) return null;
1680
1698
  if ("object" === typeof value) {
@@ -1695,6 +1713,7 @@
1695
1713
  _existingReference + ":" + parentPropertyName),
1696
1714
  _writtenObjects.set(value, elementReference)));
1697
1715
  }
1716
+ if (serializedSize > MAX_ROW_SIZE) return deferTask(request, task);
1698
1717
  if ((_existingReference = value._debugInfo)) {
1699
1718
  if (null === debugID) return outlineTask(request, task);
1700
1719
  forwardDebugInfo(request, debugID, _existingReference);
@@ -1720,6 +1739,7 @@
1720
1739
  _writtenObjects.set(request, elementReference));
1721
1740
  return request;
1722
1741
  case REACT_LAZY_TYPE:
1742
+ if (serializedSize > MAX_ROW_SIZE) return deferTask(request, task);
1723
1743
  task.thenableState = null;
1724
1744
  elementReference = callLazyInitInDEV(value);
1725
1745
  if (request.status === ABORTING) throw null;
@@ -1885,14 +1905,17 @@
1885
1905
  return value;
1886
1906
  }
1887
1907
  if ("string" === typeof value)
1888
- return "Z" === value[value.length - 1] &&
1908
+ return (
1909
+ (serializedSize += value.length),
1910
+ "Z" === value[value.length - 1] &&
1889
1911
  parent[parentPropertyName] instanceof Date
1890
- ? "$D" + value
1891
- : 1024 <= value.length && null !== byteLengthOfChunk
1892
- ? serializeLargeTextString(request, value)
1893
- : "$" === value[0]
1894
- ? "$" + value
1895
- : value;
1912
+ ? "$D" + value
1913
+ : 1024 <= value.length && null !== byteLengthOfChunk
1914
+ ? serializeLargeTextString(request, value)
1915
+ : "$" === value[0]
1916
+ ? "$" + value
1917
+ : value
1918
+ );
1896
1919
  if ("boolean" === typeof value) return value;
1897
1920
  if ("number" === typeof value) return serializeNumber(value);
1898
1921
  if ("undefined" === typeof value) return "$undefined";
@@ -2390,36 +2413,43 @@
2390
2413
  }
2391
2414
  function emitChunk(request, task, value) {
2392
2415
  var id = task.id;
2393
- "string" === typeof value && null !== byteLengthOfChunk
2394
- ? emitTextChunk(request, id, value)
2395
- : value instanceof ArrayBuffer
2396
- ? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
2397
- : value instanceof Int8Array
2398
- ? emitTypedArrayChunk(request, id, "O", value)
2399
- : value instanceof Uint8Array
2400
- ? emitTypedArrayChunk(request, id, "o", value)
2401
- : value instanceof Uint8ClampedArray
2402
- ? emitTypedArrayChunk(request, id, "U", value)
2403
- : value instanceof Int16Array
2404
- ? emitTypedArrayChunk(request, id, "S", value)
2405
- : value instanceof Uint16Array
2406
- ? emitTypedArrayChunk(request, id, "s", value)
2407
- : value instanceof Int32Array
2408
- ? emitTypedArrayChunk(request, id, "L", value)
2409
- : value instanceof Uint32Array
2410
- ? emitTypedArrayChunk(request, id, "l", value)
2411
- : value instanceof Float32Array
2412
- ? emitTypedArrayChunk(request, id, "G", value)
2413
- : value instanceof Float64Array
2414
- ? emitTypedArrayChunk(request, id, "g", value)
2415
- : value instanceof BigInt64Array
2416
- ? emitTypedArrayChunk(request, id, "M", value)
2417
- : value instanceof BigUint64Array
2418
- ? emitTypedArrayChunk(request, id, "m", value)
2419
- : value instanceof DataView
2420
- ? emitTypedArrayChunk(request, id, "V", value)
2421
- : ((value = stringify(value, task.toJSON)),
2422
- emitModelChunk(request, task.id, value));
2416
+ if ("string" === typeof value && null !== byteLengthOfChunk)
2417
+ emitTextChunk(request, id, value);
2418
+ else if (value instanceof ArrayBuffer)
2419
+ emitTypedArrayChunk(request, id, "A", new Uint8Array(value));
2420
+ else if (value instanceof Int8Array)
2421
+ emitTypedArrayChunk(request, id, "O", value);
2422
+ else if (value instanceof Uint8Array)
2423
+ emitTypedArrayChunk(request, id, "o", value);
2424
+ else if (value instanceof Uint8ClampedArray)
2425
+ emitTypedArrayChunk(request, id, "U", value);
2426
+ else if (value instanceof Int16Array)
2427
+ emitTypedArrayChunk(request, id, "S", value);
2428
+ else if (value instanceof Uint16Array)
2429
+ emitTypedArrayChunk(request, id, "s", value);
2430
+ else if (value instanceof Int32Array)
2431
+ emitTypedArrayChunk(request, id, "L", value);
2432
+ else if (value instanceof Uint32Array)
2433
+ emitTypedArrayChunk(request, id, "l", value);
2434
+ else if (value instanceof Float32Array)
2435
+ emitTypedArrayChunk(request, id, "G", value);
2436
+ else if (value instanceof Float64Array)
2437
+ emitTypedArrayChunk(request, id, "g", value);
2438
+ else if (value instanceof BigInt64Array)
2439
+ emitTypedArrayChunk(request, id, "M", value);
2440
+ else if (value instanceof BigUint64Array)
2441
+ emitTypedArrayChunk(request, id, "m", value);
2442
+ else if (value instanceof DataView)
2443
+ emitTypedArrayChunk(request, id, "V", value);
2444
+ else {
2445
+ id = serializedSize;
2446
+ try {
2447
+ var json = stringify(value, task.toJSON);
2448
+ emitModelChunk(request, task.id, json);
2449
+ } finally {
2450
+ serializedSize = id;
2451
+ }
2452
+ }
2423
2453
  }
2424
2454
  function erroredTask(request, task, error) {
2425
2455
  task.status = ERRORED$1;
@@ -3872,6 +3902,8 @@
3872
3902
  PRERENDER = 21,
3873
3903
  currentRequest = null,
3874
3904
  debugID = null,
3905
+ serializedSize = 0,
3906
+ MAX_ROW_SIZE = 3200,
3875
3907
  modelRoot = !1,
3876
3908
  emptyRoot = {},
3877
3909
  chunkCache = new Map(),
@@ -1046,6 +1046,18 @@ function renderFragment(request, task, children) {
1046
1046
  task.implicitSlot ? [request] : request)
1047
1047
  : children;
1048
1048
  }
1049
+ var serializedSize = 0;
1050
+ function deferTask(request, task) {
1051
+ task = createTask(
1052
+ request,
1053
+ task.model,
1054
+ task.keyPath,
1055
+ task.implicitSlot,
1056
+ request.abortableTasks
1057
+ );
1058
+ pingTask(request, task);
1059
+ return "$L" + task.id.toString(16);
1060
+ }
1049
1061
  function renderElement(request, task, type, key, ref, props) {
1050
1062
  if (null !== ref && void 0 !== ref)
1051
1063
  throw Error(
@@ -1322,6 +1334,7 @@ function renderModelDestructive(
1322
1334
  value
1323
1335
  ) {
1324
1336
  task.model = value;
1337
+ serializedSize += parentPropertyName.length;
1325
1338
  if (value === REACT_ELEMENT_TYPE) return "$";
1326
1339
  if (null === value) return null;
1327
1340
  if ("object" === typeof value) {
@@ -1341,6 +1354,7 @@ function renderModelDestructive(
1341
1354
  ((elementReference = parent + ":" + parentPropertyName),
1342
1355
  writtenObjects.set(value, elementReference)));
1343
1356
  }
1357
+ if (3200 < serializedSize) return deferTask(request, task);
1344
1358
  parentPropertyName = value.props;
1345
1359
  parent = parentPropertyName.ref;
1346
1360
  request = renderElement(
@@ -1358,6 +1372,7 @@ function renderModelDestructive(
1358
1372
  writtenObjects.set(request, elementReference));
1359
1373
  return request;
1360
1374
  case REACT_LAZY_TYPE:
1375
+ if (3200 < serializedSize) return deferTask(request, task);
1361
1376
  task.thenableState = null;
1362
1377
  parentPropertyName = value._init;
1363
1378
  value = parentPropertyName(value._payload);
@@ -1507,6 +1522,7 @@ function renderModelDestructive(
1507
1522
  return value;
1508
1523
  }
1509
1524
  if ("string" === typeof value) {
1525
+ serializedSize += value.length;
1510
1526
  if (
1511
1527
  "Z" === value[value.length - 1] &&
1512
1528
  parent[parentPropertyName] instanceof Date
@@ -1674,36 +1690,43 @@ function emitTextChunk(request, id, text) {
1674
1690
  }
1675
1691
  function emitChunk(request, task, value) {
1676
1692
  var id = task.id;
1677
- "string" === typeof value && null !== byteLengthOfChunk
1678
- ? emitTextChunk(request, id, value)
1679
- : value instanceof ArrayBuffer
1680
- ? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
1681
- : value instanceof Int8Array
1682
- ? emitTypedArrayChunk(request, id, "O", value)
1683
- : value instanceof Uint8Array
1684
- ? emitTypedArrayChunk(request, id, "o", value)
1685
- : value instanceof Uint8ClampedArray
1686
- ? emitTypedArrayChunk(request, id, "U", value)
1687
- : value instanceof Int16Array
1688
- ? emitTypedArrayChunk(request, id, "S", value)
1689
- : value instanceof Uint16Array
1690
- ? emitTypedArrayChunk(request, id, "s", value)
1691
- : value instanceof Int32Array
1692
- ? emitTypedArrayChunk(request, id, "L", value)
1693
- : value instanceof Uint32Array
1694
- ? emitTypedArrayChunk(request, id, "l", value)
1695
- : value instanceof Float32Array
1696
- ? emitTypedArrayChunk(request, id, "G", value)
1697
- : value instanceof Float64Array
1698
- ? emitTypedArrayChunk(request, id, "g", value)
1699
- : value instanceof BigInt64Array
1700
- ? emitTypedArrayChunk(request, id, "M", value)
1701
- : value instanceof BigUint64Array
1702
- ? emitTypedArrayChunk(request, id, "m", value)
1703
- : value instanceof DataView
1704
- ? emitTypedArrayChunk(request, id, "V", value)
1705
- : ((value = stringify(value, task.toJSON)),
1706
- emitModelChunk(request, task.id, value));
1693
+ if ("string" === typeof value && null !== byteLengthOfChunk)
1694
+ emitTextChunk(request, id, value);
1695
+ else if (value instanceof ArrayBuffer)
1696
+ emitTypedArrayChunk(request, id, "A", new Uint8Array(value));
1697
+ else if (value instanceof Int8Array)
1698
+ emitTypedArrayChunk(request, id, "O", value);
1699
+ else if (value instanceof Uint8Array)
1700
+ emitTypedArrayChunk(request, id, "o", value);
1701
+ else if (value instanceof Uint8ClampedArray)
1702
+ emitTypedArrayChunk(request, id, "U", value);
1703
+ else if (value instanceof Int16Array)
1704
+ emitTypedArrayChunk(request, id, "S", value);
1705
+ else if (value instanceof Uint16Array)
1706
+ emitTypedArrayChunk(request, id, "s", value);
1707
+ else if (value instanceof Int32Array)
1708
+ emitTypedArrayChunk(request, id, "L", value);
1709
+ else if (value instanceof Uint32Array)
1710
+ emitTypedArrayChunk(request, id, "l", value);
1711
+ else if (value instanceof Float32Array)
1712
+ emitTypedArrayChunk(request, id, "G", value);
1713
+ else if (value instanceof Float64Array)
1714
+ emitTypedArrayChunk(request, id, "g", value);
1715
+ else if (value instanceof BigInt64Array)
1716
+ emitTypedArrayChunk(request, id, "M", value);
1717
+ else if (value instanceof BigUint64Array)
1718
+ emitTypedArrayChunk(request, id, "m", value);
1719
+ else if (value instanceof DataView)
1720
+ emitTypedArrayChunk(request, id, "V", value);
1721
+ else {
1722
+ id = serializedSize;
1723
+ try {
1724
+ var json = stringify(value, task.toJSON);
1725
+ emitModelChunk(request, task.id, json);
1726
+ } finally {
1727
+ serializedSize = id;
1728
+ }
1729
+ }
1707
1730
  }
1708
1731
  function erroredTask(request, task, error) {
1709
1732
  task.status = 4;
@@ -1278,6 +1278,20 @@
1278
1278
  getAsyncIterator = getAsyncIterator.call(children);
1279
1279
  return serializeAsyncIterable(request, task, children, getAsyncIterator);
1280
1280
  }
1281
+ function deferTask(request, task) {
1282
+ task = createTask(
1283
+ request,
1284
+ task.model,
1285
+ task.keyPath,
1286
+ task.implicitSlot,
1287
+ request.abortableTasks,
1288
+ task.debugOwner,
1289
+ task.debugStack,
1290
+ task.debugTask
1291
+ );
1292
+ pingTask(request, task);
1293
+ return serializeLazyID(task.id);
1294
+ }
1281
1295
  function outlineTask(request, task) {
1282
1296
  task = createTask(
1283
1297
  request,
@@ -1292,7 +1306,7 @@
1292
1306
  retryTask(request, task);
1293
1307
  return task.status === COMPLETED
1294
1308
  ? serializeByValueID(task.id)
1295
- : "$L" + task.id.toString(16);
1309
+ : serializeLazyID(task.id);
1296
1310
  }
1297
1311
  function renderElement(request, task, type, key, ref, props, validated) {
1298
1312
  if (null !== ref && void 0 !== ref)
@@ -1481,6 +1495,9 @@
1481
1495
  function serializeByValueID(id) {
1482
1496
  return "$" + id.toString(16);
1483
1497
  }
1498
+ function serializeLazyID(id) {
1499
+ return "$L" + id.toString(16);
1500
+ }
1484
1501
  function serializeNumber(number) {
1485
1502
  return Number.isFinite(number)
1486
1503
  ? 0 === number && -Infinity === 1 / number
@@ -1510,7 +1527,7 @@
1510
1527
  existingId = writtenClientReferences.get(clientReferenceKey);
1511
1528
  if (void 0 !== existingId)
1512
1529
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1513
- ? "$L" + existingId.toString(16)
1530
+ ? serializeLazyID(existingId)
1514
1531
  : serializeByValueID(existingId);
1515
1532
  try {
1516
1533
  var config = request.bundlerConfig,
@@ -1548,7 +1565,7 @@
1548
1565
  request.completedImportChunks.push(processedChunk);
1549
1566
  writtenClientReferences.set(clientReferenceKey, importId);
1550
1567
  return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1551
- ? "$L" + importId.toString(16)
1568
+ ? serializeLazyID(importId)
1552
1569
  : serializeByValueID(importId);
1553
1570
  } catch (x) {
1554
1571
  return (
@@ -1688,7 +1705,7 @@
1688
1705
  return (
1689
1706
  (task.status = ABORTED),
1690
1707
  (task = request.fatalError),
1691
- parent ? "$L" + task.toString(16) : serializeByValueID(task)
1708
+ parent ? serializeLazyID(task) : serializeByValueID(task)
1692
1709
  );
1693
1710
  key =
1694
1711
  thrownValue === SuspenseException
@@ -1716,7 +1733,7 @@
1716
1733
  (task.keyPath = prevKeyPath),
1717
1734
  (task.implicitSlot = prevImplicitSlot),
1718
1735
  parent
1719
- ? "$L" + request.id.toString(16)
1736
+ ? serializeLazyID(request.id)
1720
1737
  : serializeByValueID(request.id)
1721
1738
  );
1722
1739
  task.keyPath = prevKeyPath;
@@ -1726,7 +1743,7 @@
1726
1743
  task = logRecoverableError(request, key, task);
1727
1744
  emitErrorChunk(request, prevKeyPath, task, key);
1728
1745
  return parent
1729
- ? "$L" + prevKeyPath.toString(16)
1746
+ ? serializeLazyID(prevKeyPath)
1730
1747
  : serializeByValueID(prevKeyPath);
1731
1748
  }
1732
1749
  }
@@ -1738,6 +1755,7 @@
1738
1755
  value
1739
1756
  ) {
1740
1757
  task.model = value;
1758
+ serializedSize += parentPropertyName.length;
1741
1759
  if (value === REACT_ELEMENT_TYPE) return "$";
1742
1760
  if (null === value) return null;
1743
1761
  if ("object" === typeof value) {
@@ -1758,6 +1776,7 @@
1758
1776
  _existingReference + ":" + parentPropertyName),
1759
1777
  _writtenObjects.set(value, elementReference)));
1760
1778
  }
1779
+ if (serializedSize > MAX_ROW_SIZE) return deferTask(request, task);
1761
1780
  if ((_existingReference = value._debugInfo)) {
1762
1781
  if (null === debugID) return outlineTask(request, task);
1763
1782
  forwardDebugInfo(request, debugID, _existingReference);
@@ -1783,6 +1802,7 @@
1783
1802
  _writtenObjects.set(request, elementReference));
1784
1803
  return request;
1785
1804
  case REACT_LAZY_TYPE:
1805
+ if (serializedSize > MAX_ROW_SIZE) return deferTask(request, task);
1786
1806
  task.thenableState = null;
1787
1807
  elementReference = callLazyInitInDEV(value);
1788
1808
  if (request.status === ABORTING) throw null;
@@ -1948,14 +1968,17 @@
1948
1968
  return value;
1949
1969
  }
1950
1970
  if ("string" === typeof value)
1951
- return "Z" === value[value.length - 1] &&
1971
+ return (
1972
+ (serializedSize += value.length),
1973
+ "Z" === value[value.length - 1] &&
1952
1974
  parent[parentPropertyName] instanceof Date
1953
- ? "$D" + value
1954
- : 1024 <= value.length && null !== byteLengthOfChunk
1955
- ? serializeLargeTextString(request, value)
1956
- : "$" === value[0]
1957
- ? "$" + value
1958
- : value;
1975
+ ? "$D" + value
1976
+ : 1024 <= value.length && null !== byteLengthOfChunk
1977
+ ? serializeLargeTextString(request, value)
1978
+ : "$" === value[0]
1979
+ ? "$" + value
1980
+ : value
1981
+ );
1959
1982
  if ("boolean" === typeof value) return value;
1960
1983
  if ("number" === typeof value) return serializeNumber(value);
1961
1984
  if ("undefined" === typeof value) return "$undefined";
@@ -2464,36 +2487,43 @@
2464
2487
  }
2465
2488
  function emitChunk(request, task, value) {
2466
2489
  var id = task.id;
2467
- "string" === typeof value && null !== byteLengthOfChunk
2468
- ? emitTextChunk(request, id, value)
2469
- : value instanceof ArrayBuffer
2470
- ? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
2471
- : value instanceof Int8Array
2472
- ? emitTypedArrayChunk(request, id, "O", value)
2473
- : value instanceof Uint8Array
2474
- ? emitTypedArrayChunk(request, id, "o", value)
2475
- : value instanceof Uint8ClampedArray
2476
- ? emitTypedArrayChunk(request, id, "U", value)
2477
- : value instanceof Int16Array
2478
- ? emitTypedArrayChunk(request, id, "S", value)
2479
- : value instanceof Uint16Array
2480
- ? emitTypedArrayChunk(request, id, "s", value)
2481
- : value instanceof Int32Array
2482
- ? emitTypedArrayChunk(request, id, "L", value)
2483
- : value instanceof Uint32Array
2484
- ? emitTypedArrayChunk(request, id, "l", value)
2485
- : value instanceof Float32Array
2486
- ? emitTypedArrayChunk(request, id, "G", value)
2487
- : value instanceof Float64Array
2488
- ? emitTypedArrayChunk(request, id, "g", value)
2489
- : value instanceof BigInt64Array
2490
- ? emitTypedArrayChunk(request, id, "M", value)
2491
- : value instanceof BigUint64Array
2492
- ? emitTypedArrayChunk(request, id, "m", value)
2493
- : value instanceof DataView
2494
- ? emitTypedArrayChunk(request, id, "V", value)
2495
- : ((value = stringify(value, task.toJSON)),
2496
- emitModelChunk(request, task.id, value));
2490
+ if ("string" === typeof value && null !== byteLengthOfChunk)
2491
+ emitTextChunk(request, id, value);
2492
+ else if (value instanceof ArrayBuffer)
2493
+ emitTypedArrayChunk(request, id, "A", new Uint8Array(value));
2494
+ else if (value instanceof Int8Array)
2495
+ emitTypedArrayChunk(request, id, "O", value);
2496
+ else if (value instanceof Uint8Array)
2497
+ emitTypedArrayChunk(request, id, "o", value);
2498
+ else if (value instanceof Uint8ClampedArray)
2499
+ emitTypedArrayChunk(request, id, "U", value);
2500
+ else if (value instanceof Int16Array)
2501
+ emitTypedArrayChunk(request, id, "S", value);
2502
+ else if (value instanceof Uint16Array)
2503
+ emitTypedArrayChunk(request, id, "s", value);
2504
+ else if (value instanceof Int32Array)
2505
+ emitTypedArrayChunk(request, id, "L", value);
2506
+ else if (value instanceof Uint32Array)
2507
+ emitTypedArrayChunk(request, id, "l", value);
2508
+ else if (value instanceof Float32Array)
2509
+ emitTypedArrayChunk(request, id, "G", value);
2510
+ else if (value instanceof Float64Array)
2511
+ emitTypedArrayChunk(request, id, "g", value);
2512
+ else if (value instanceof BigInt64Array)
2513
+ emitTypedArrayChunk(request, id, "M", value);
2514
+ else if (value instanceof BigUint64Array)
2515
+ emitTypedArrayChunk(request, id, "m", value);
2516
+ else if (value instanceof DataView)
2517
+ emitTypedArrayChunk(request, id, "V", value);
2518
+ else {
2519
+ id = serializedSize;
2520
+ try {
2521
+ var json = stringify(value, task.toJSON);
2522
+ emitModelChunk(request, task.id, json);
2523
+ } finally {
2524
+ serializedSize = id;
2525
+ }
2526
+ }
2497
2527
  }
2498
2528
  function erroredTask(request, task, error) {
2499
2529
  task.status = ERRORED$1;
@@ -3950,6 +3980,8 @@
3950
3980
  PRERENDER = 21,
3951
3981
  currentRequest = null,
3952
3982
  debugID = null,
3983
+ serializedSize = 0,
3984
+ MAX_ROW_SIZE = 3200,
3953
3985
  modelRoot = !1,
3954
3986
  emptyRoot = {},
3955
3987
  chunkCache = new Map(),