react-dom 19.2.0-canary-143d3e1b-20250425 → 19.2.0-canary-c498bfce-20250426

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.
@@ -191,6 +191,9 @@ function stringToChunk(content) {
191
191
  function stringToPrecomputedChunk(content) {
192
192
  return textEncoder.encode(content);
193
193
  }
194
+ function byteLengthOfChunk(chunk) {
195
+ return chunk.byteLength;
196
+ }
194
197
  function closeWithError(destination, error) {
195
198
  "function" === typeof destination.error
196
199
  ? destination.error(error)
@@ -3950,6 +3953,7 @@ function RequestInstance(
3950
3953
  this.fatalError = null;
3951
3954
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
3952
3955
  this.completedPreambleSegments = this.completedRootSegment = null;
3956
+ this.byteSize = 0;
3953
3957
  this.abortableTasks = abortSet;
3954
3958
  this.pingedTasks = [];
3955
3959
  this.clientRenderedBoundaries = [];
@@ -4564,11 +4568,11 @@ function renderElement(request, task, keyPath, type, props, ref) {
4564
4568
  }
4565
4569
  } else {
4566
4570
  type = task.keyPath;
4567
- var parentBoundary = task.blockedBoundary;
4568
- ref = task.blockedPreamble;
4571
+ ref = task.blockedBoundary;
4572
+ propName$33 = task.blockedPreamble;
4569
4573
  var parentHoistableState = task.hoistableState;
4570
- propName$33 = task.blockedSegment;
4571
- propName = props.fallback;
4574
+ propName = task.blockedSegment;
4575
+ var fallback = props.fallback;
4572
4576
  props = props.children;
4573
4577
  var fallbackAbortSet = new Set();
4574
4578
  var newBoundary =
@@ -4584,14 +4588,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
4584
4588
  (newBoundary.trackedContentKeyPath = keyPath);
4585
4589
  var boundarySegment = createPendingSegment(
4586
4590
  request,
4587
- propName$33.chunks.length,
4591
+ propName.chunks.length,
4588
4592
  newBoundary,
4589
4593
  task.formatContext,
4590
4594
  !1,
4591
4595
  !1
4592
4596
  );
4593
- propName$33.children.push(boundarySegment);
4594
- propName$33.lastPushedText = !1;
4597
+ propName.children.push(boundarySegment);
4598
+ propName.lastPushedText = !1;
4595
4599
  var contentRootSegment = createPendingSegment(
4596
4600
  request,
4597
4601
  0,
@@ -4611,19 +4615,20 @@ function renderElement(request, task, keyPath, type, props, ref) {
4611
4615
  task.keyPath = newProps;
4612
4616
  boundarySegment.status = 6;
4613
4617
  try {
4614
- renderNode(request, task, propName, -1),
4618
+ renderNode(request, task, fallback, -1),
4615
4619
  boundarySegment.lastPushedText &&
4616
4620
  boundarySegment.textEmbedded &&
4617
4621
  boundarySegment.chunks.push(textSeparator),
4618
- (boundarySegment.status = 1);
4622
+ (boundarySegment.status = 1),
4623
+ finishedSegment(request, ref, boundarySegment);
4619
4624
  } catch (thrownValue) {
4620
4625
  throw (
4621
4626
  ((boundarySegment.status = 12 === request.status ? 3 : 4),
4622
4627
  thrownValue)
4623
4628
  );
4624
4629
  } finally {
4625
- (task.blockedSegment = propName$33),
4626
- (task.blockedPreamble = ref),
4630
+ (task.blockedSegment = propName),
4631
+ (task.blockedPreamble = propName$33),
4627
4632
  (task.keyPath = type);
4628
4633
  }
4629
4634
  task = createRenderTask(
@@ -4659,10 +4664,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
4659
4664
  contentRootSegment.textEmbedded &&
4660
4665
  contentRootSegment.chunks.push(textSeparator),
4661
4666
  (contentRootSegment.status = 1),
4667
+ finishedSegment(request, newBoundary, contentRootSegment),
4662
4668
  queueCompletedSegment(newBoundary, contentRootSegment),
4663
- 0 === newBoundary.pendingTasks && 0 === newBoundary.status)
4669
+ 0 === newBoundary.pendingTasks &&
4670
+ 0 === newBoundary.status &&
4671
+ ((newBoundary.status = 1),
4672
+ !(newBoundary.byteSize > request.progressiveChunkSize)))
4664
4673
  ) {
4665
- newBoundary.status = 1;
4666
4674
  0 === request.pendingRootTasks &&
4667
4675
  task.blockedPreamble &&
4668
4676
  preparePreamble(request);
@@ -4684,18 +4692,18 @@ function renderElement(request, task, keyPath, type, props, ref) {
4684
4692
  (newBoundary.errorDigest = initialState),
4685
4693
  untrackBoundary(request, newBoundary);
4686
4694
  } finally {
4687
- (task.blockedBoundary = parentBoundary),
4688
- (task.blockedPreamble = ref),
4695
+ (task.blockedBoundary = ref),
4696
+ (task.blockedPreamble = propName$33),
4689
4697
  (task.hoistableState = parentHoistableState),
4690
- (task.blockedSegment = propName$33),
4698
+ (task.blockedSegment = propName),
4691
4699
  (task.keyPath = type);
4692
4700
  }
4693
4701
  task = createRenderTask(
4694
4702
  request,
4695
4703
  null,
4696
- propName,
4704
+ fallback,
4697
4705
  -1,
4698
- parentBoundary,
4706
+ ref,
4699
4707
  boundarySegment,
4700
4708
  newBoundary.fallbackPreamble,
4701
4709
  newBoundary.fallbackState,
@@ -4717,9 +4725,8 @@ function renderElement(request, task, keyPath, type, props, ref) {
4717
4725
  switch (type.$$typeof) {
4718
4726
  case REACT_FORWARD_REF_TYPE:
4719
4727
  if ("ref" in props)
4720
- for (newBoundary in ((newProps = {}), props))
4721
- "ref" !== newBoundary &&
4722
- (newProps[newBoundary] = props[newBoundary]);
4728
+ for (fallback in ((newProps = {}), props))
4729
+ "ref" !== fallback && (newProps[fallback] = props[fallback]);
4723
4730
  else newProps = props;
4724
4731
  type = renderWithHooks(
4725
4732
  request,
@@ -4805,6 +4812,7 @@ function resumeNode(request, task, segmentId, node, childIndex) {
4805
4812
  (task.blockedSegment = resumedSegment),
4806
4813
  renderNode(request, task, node, childIndex),
4807
4814
  (resumedSegment.status = 1),
4815
+ finishedSegment(request, blockedBoundary, resumedSegment),
4808
4816
  null === blockedBoundary
4809
4817
  ? (request.completedRootSegment = resumedSegment)
4810
4818
  : (queueCompletedSegment(blockedBoundary, resumedSegment),
@@ -5497,6 +5505,16 @@ function queueCompletedSegment(boundary, segment) {
5497
5505
  1 === childSegment.status && queueCompletedSegment(boundary, childSegment);
5498
5506
  } else boundary.completedSegments.push(segment);
5499
5507
  }
5508
+ function finishedSegment(request, boundary, segment) {
5509
+ if (null !== byteLengthOfChunk) {
5510
+ segment = segment.chunks;
5511
+ for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
5512
+ segmentByteSize += segment[i].byteLength;
5513
+ null === boundary
5514
+ ? (request.byteSize += segmentByteSize)
5515
+ : (boundary.byteSize += segmentByteSize);
5516
+ }
5517
+ }
5500
5518
  function finishedTask(request, boundary, segment) {
5501
5519
  if (null === boundary) {
5502
5520
  if (null !== segment && segment.parentFlushed) {
@@ -5518,8 +5536,12 @@ function finishedTask(request, boundary, segment) {
5518
5536
  boundary.parentFlushed &&
5519
5537
  request.completedBoundaries.push(boundary),
5520
5538
  1 === boundary.status &&
5521
- (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
5522
- boundary.fallbackAbortableTasks.clear(),
5539
+ (boundary.byteSize > request.progressiveChunkSize ||
5540
+ (boundary.fallbackAbortableTasks.forEach(
5541
+ abortTaskSoft,
5542
+ request
5543
+ ),
5544
+ boundary.fallbackAbortableTasks.clear()),
5523
5545
  0 === request.pendingRootTasks &&
5524
5546
  null === request.trackedPostpones &&
5525
5547
  null !== boundary.contentPreamble &&
@@ -5640,6 +5662,7 @@ function performWork(request$jscomp$2) {
5640
5662
  request$jscomp$1.chunks.push(textSeparator),
5641
5663
  task.abortSet.delete(task),
5642
5664
  (request$jscomp$1.status = 1),
5665
+ finishedSegment(request, task.blockedBoundary, request$jscomp$1),
5643
5666
  finishedTask(request, task.blockedBoundary, request$jscomp$1);
5644
5667
  } catch (thrownValue) {
5645
5668
  resetHooksState();
@@ -6288,12 +6311,12 @@ function abort(request, reason) {
6288
6311
  }
6289
6312
  function ensureCorrectIsomorphicReactVersion() {
6290
6313
  var isomorphicReactPackageVersion = React.version;
6291
- if ("19.2.0-canary-143d3e1b-20250425" !== isomorphicReactPackageVersion)
6314
+ if ("19.2.0-canary-c498bfce-20250426" !== isomorphicReactPackageVersion)
6292
6315
  throw Error(
6293
6316
  formatProdErrorMessage(
6294
6317
  527,
6295
6318
  isomorphicReactPackageVersion,
6296
- "19.2.0-canary-143d3e1b-20250425"
6319
+ "19.2.0-canary-c498bfce-20250426"
6297
6320
  )
6298
6321
  );
6299
6322
  }
@@ -6440,4 +6463,4 @@ exports.renderToReadableStream = function (children, options) {
6440
6463
  startWork(request);
6441
6464
  });
6442
6465
  };
6443
- exports.version = "19.2.0-canary-143d3e1b-20250425";
6466
+ exports.version = "19.2.0-canary-c498bfce-20250426";
@@ -201,6 +201,9 @@ function flushBuffered(destination) {
201
201
  function writeChunk(destination, chunk) {
202
202
  0 !== chunk.length && destination.write(chunk);
203
203
  }
204
+ function byteLengthOfChunk(chunk) {
205
+ return Buffer.byteLength(chunk, "utf8");
206
+ }
204
207
  function closeWithError(destination, error) {
205
208
  "function" === typeof destination.error
206
209
  ? destination.error(error)
@@ -5602,6 +5605,7 @@ function RequestInstance(
5602
5605
  this.fatalError = null;
5603
5606
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
5604
5607
  this.completedPreambleSegments = this.completedRootSegment = null;
5608
+ this.byteSize = 0;
5605
5609
  this.abortableTasks = abortSet;
5606
5610
  this.pingedTasks = [];
5607
5611
  this.clientRenderedBoundaries = [];
@@ -6687,7 +6691,8 @@ function renderElement(request, task, keyPath, type, props, ref) {
6687
6691
  boundarySegment.lastPushedText &&
6688
6692
  boundarySegment.textEmbedded &&
6689
6693
  boundarySegment.chunks.push("\x3c!-- --\x3e"),
6690
- (boundarySegment.status = COMPLETED);
6694
+ (boundarySegment.status = COMPLETED),
6695
+ finishedSegment(request, parentBoundary, boundarySegment);
6691
6696
  } catch (thrownValue) {
6692
6697
  throw (
6693
6698
  ((boundarySegment.status = 12 === request.status ? 3 : 4),
@@ -6733,11 +6738,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
6733
6738
  contentRootSegment.textEmbedded &&
6734
6739
  contentRootSegment.chunks.push("\x3c!-- --\x3e"),
6735
6740
  (contentRootSegment.status = COMPLETED),
6741
+ finishedSegment(request, newBoundary, contentRootSegment),
6736
6742
  queueCompletedSegment(newBoundary, contentRootSegment),
6737
6743
  0 === newBoundary.pendingTasks &&
6738
- newBoundary.status === PENDING)
6744
+ newBoundary.status === PENDING &&
6745
+ ((newBoundary.status = COMPLETED),
6746
+ !(newBoundary.byteSize > request.progressiveChunkSize)))
6739
6747
  ) {
6740
- newBoundary.status = COMPLETED;
6741
6748
  0 === request.pendingRootTasks &&
6742
6749
  task.blockedPreamble &&
6743
6750
  preparePreamble(request);
@@ -6931,6 +6938,7 @@ function resumeNode(request, task, segmentId, node, childIndex) {
6931
6938
  (task.blockedSegment = resumedSegment),
6932
6939
  renderNode(request, task, node, childIndex),
6933
6940
  (resumedSegment.status = COMPLETED),
6941
+ finishedSegment(request, blockedBoundary, resumedSegment),
6934
6942
  null === blockedBoundary
6935
6943
  ? (request.completedRootSegment = resumedSegment)
6936
6944
  : (queueCompletedSegment(blockedBoundary, resumedSegment),
@@ -7810,6 +7818,16 @@ function queueCompletedSegment(boundary, segment) {
7810
7818
  queueCompletedSegment(boundary, childSegment);
7811
7819
  } else boundary.completedSegments.push(segment);
7812
7820
  }
7821
+ function finishedSegment(request, boundary, segment) {
7822
+ if (null !== byteLengthOfChunk) {
7823
+ segment = segment.chunks;
7824
+ for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
7825
+ segmentByteSize += byteLengthOfChunk(segment[i]);
7826
+ null === boundary
7827
+ ? (request.byteSize += segmentByteSize)
7828
+ : (boundary.byteSize += segmentByteSize);
7829
+ }
7830
+ }
7813
7831
  function finishedTask(request, boundary, segment) {
7814
7832
  if (null === boundary) {
7815
7833
  if (null !== segment && segment.parentFlushed) {
@@ -7833,8 +7851,12 @@ function finishedTask(request, boundary, segment) {
7833
7851
  boundary.parentFlushed &&
7834
7852
  request.completedBoundaries.push(boundary),
7835
7853
  boundary.status === COMPLETED &&
7836
- (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
7837
- boundary.fallbackAbortableTasks.clear(),
7854
+ (boundary.byteSize > request.progressiveChunkSize ||
7855
+ (boundary.fallbackAbortableTasks.forEach(
7856
+ abortTaskSoft,
7857
+ request
7858
+ ),
7859
+ boundary.fallbackAbortableTasks.clear()),
7838
7860
  0 === request.pendingRootTasks &&
7839
7861
  null === request.trackedPostpones &&
7840
7862
  null !== boundary.contentPreamble &&
@@ -7971,6 +7993,11 @@ function performWork(request$jscomp$2) {
7971
7993
  request$jscomp$1.chunks.push("\x3c!-- --\x3e"),
7972
7994
  errorDigest.abortSet.delete(errorDigest),
7973
7995
  (request$jscomp$1.status = COMPLETED),
7996
+ finishedSegment(
7997
+ request,
7998
+ errorDigest.blockedBoundary,
7999
+ request$jscomp$1
8000
+ ),
7974
8001
  finishedTask(
7975
8002
  request,
7976
8003
  errorDigest.blockedBoundary,
@@ -8694,13 +8721,13 @@ function abort(request, reason) {
8694
8721
  }
8695
8722
  var isomorphicReactPackageVersion$jscomp$inline_748 = React.version;
8696
8723
  if (
8697
- "19.2.0-canary-143d3e1b-20250425" !==
8724
+ "19.2.0-canary-c498bfce-20250426" !==
8698
8725
  isomorphicReactPackageVersion$jscomp$inline_748
8699
8726
  )
8700
8727
  throw Error(
8701
8728
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
8702
8729
  (isomorphicReactPackageVersion$jscomp$inline_748 +
8703
- "\n - react-dom: 19.2.0-canary-143d3e1b-20250425\nLearn more: https://react.dev/warnings/version-mismatch")
8730
+ "\n - react-dom: 19.2.0-canary-c498bfce-20250426\nLearn more: https://react.dev/warnings/version-mismatch")
8704
8731
  );
8705
8732
  exports.renderToReadableStream = function (children, options) {
8706
8733
  return new Promise(function (resolve, reject) {
@@ -8793,4 +8820,4 @@ exports.renderToReadableStream = function (children, options) {
8793
8820
  startWork(request$jscomp$0);
8794
8821
  });
8795
8822
  };
8796
- exports.version = "19.2.0-canary-143d3e1b-20250425";
8823
+ exports.version = "19.2.0-canary-c498bfce-20250426";
@@ -38,6 +38,9 @@ function flushBuffered(destination) {
38
38
  function writeChunk(destination, chunk) {
39
39
  0 !== chunk.length && destination.write(chunk);
40
40
  }
41
+ function byteLengthOfChunk(chunk) {
42
+ return Buffer.byteLength(chunk, "utf8");
43
+ }
41
44
  function closeWithError(destination, error) {
42
45
  "function" === typeof destination.error
43
46
  ? destination.error(error)
@@ -3598,6 +3601,7 @@ function RequestInstance(
3598
3601
  this.fatalError = null;
3599
3602
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
3600
3603
  this.completedPreambleSegments = this.completedRootSegment = null;
3604
+ this.byteSize = 0;
3601
3605
  this.abortableTasks = abortSet;
3602
3606
  this.pingedTasks = [];
3603
3607
  this.clientRenderedBoundaries = [];
@@ -4178,11 +4182,11 @@ function renderElement(request, task, keyPath, type, props, ref) {
4178
4182
  }
4179
4183
  } else {
4180
4184
  type = task.keyPath;
4181
- var parentBoundary = task.blockedBoundary;
4182
- ref = task.blockedPreamble;
4185
+ ref = task.blockedBoundary;
4186
+ propName$33 = task.blockedPreamble;
4183
4187
  var parentHoistableState = task.hoistableState;
4184
- propName$33 = task.blockedSegment;
4185
- propName = props.fallback;
4188
+ propName = task.blockedSegment;
4189
+ var fallback = props.fallback;
4186
4190
  props = props.children;
4187
4191
  var fallbackAbortSet = new Set();
4188
4192
  var newBoundary =
@@ -4198,14 +4202,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
4198
4202
  (newBoundary.trackedContentKeyPath = keyPath);
4199
4203
  var boundarySegment = createPendingSegment(
4200
4204
  request,
4201
- propName$33.chunks.length,
4205
+ propName.chunks.length,
4202
4206
  newBoundary,
4203
4207
  task.formatContext,
4204
4208
  !1,
4205
4209
  !1
4206
4210
  );
4207
- propName$33.children.push(boundarySegment);
4208
- propName$33.lastPushedText = !1;
4211
+ propName.children.push(boundarySegment);
4212
+ propName.lastPushedText = !1;
4209
4213
  var contentRootSegment = createPendingSegment(
4210
4214
  request,
4211
4215
  0,
@@ -4225,19 +4229,20 @@ function renderElement(request, task, keyPath, type, props, ref) {
4225
4229
  task.keyPath = newProps;
4226
4230
  boundarySegment.status = 6;
4227
4231
  try {
4228
- renderNode(request, task, propName, -1),
4232
+ renderNode(request, task, fallback, -1),
4229
4233
  boundarySegment.lastPushedText &&
4230
4234
  boundarySegment.textEmbedded &&
4231
4235
  boundarySegment.chunks.push("\x3c!-- --\x3e"),
4232
- (boundarySegment.status = 1);
4236
+ (boundarySegment.status = 1),
4237
+ finishedSegment(request, ref, boundarySegment);
4233
4238
  } catch (thrownValue) {
4234
4239
  throw (
4235
4240
  ((boundarySegment.status = 12 === request.status ? 3 : 4),
4236
4241
  thrownValue)
4237
4242
  );
4238
4243
  } finally {
4239
- (task.blockedSegment = propName$33),
4240
- (task.blockedPreamble = ref),
4244
+ (task.blockedSegment = propName),
4245
+ (task.blockedPreamble = propName$33),
4241
4246
  (task.keyPath = type);
4242
4247
  }
4243
4248
  task = createRenderTask(
@@ -4273,10 +4278,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
4273
4278
  contentRootSegment.textEmbedded &&
4274
4279
  contentRootSegment.chunks.push("\x3c!-- --\x3e"),
4275
4280
  (contentRootSegment.status = 1),
4281
+ finishedSegment(request, newBoundary, contentRootSegment),
4276
4282
  queueCompletedSegment(newBoundary, contentRootSegment),
4277
- 0 === newBoundary.pendingTasks && 0 === newBoundary.status)
4283
+ 0 === newBoundary.pendingTasks &&
4284
+ 0 === newBoundary.status &&
4285
+ ((newBoundary.status = 1),
4286
+ !(newBoundary.byteSize > request.progressiveChunkSize)))
4278
4287
  ) {
4279
- newBoundary.status = 1;
4280
4288
  0 === request.pendingRootTasks &&
4281
4289
  task.blockedPreamble &&
4282
4290
  preparePreamble(request);
@@ -4298,18 +4306,18 @@ function renderElement(request, task, keyPath, type, props, ref) {
4298
4306
  (newBoundary.errorDigest = initialState),
4299
4307
  untrackBoundary(request, newBoundary);
4300
4308
  } finally {
4301
- (task.blockedBoundary = parentBoundary),
4302
- (task.blockedPreamble = ref),
4309
+ (task.blockedBoundary = ref),
4310
+ (task.blockedPreamble = propName$33),
4303
4311
  (task.hoistableState = parentHoistableState),
4304
- (task.blockedSegment = propName$33),
4312
+ (task.blockedSegment = propName),
4305
4313
  (task.keyPath = type);
4306
4314
  }
4307
4315
  task = createRenderTask(
4308
4316
  request,
4309
4317
  null,
4310
- propName,
4318
+ fallback,
4311
4319
  -1,
4312
- parentBoundary,
4320
+ ref,
4313
4321
  boundarySegment,
4314
4322
  newBoundary.fallbackPreamble,
4315
4323
  newBoundary.fallbackState,
@@ -4331,9 +4339,8 @@ function renderElement(request, task, keyPath, type, props, ref) {
4331
4339
  switch (type.$$typeof) {
4332
4340
  case REACT_FORWARD_REF_TYPE:
4333
4341
  if ("ref" in props)
4334
- for (newBoundary in ((newProps = {}), props))
4335
- "ref" !== newBoundary &&
4336
- (newProps[newBoundary] = props[newBoundary]);
4342
+ for (fallback in ((newProps = {}), props))
4343
+ "ref" !== fallback && (newProps[fallback] = props[fallback]);
4337
4344
  else newProps = props;
4338
4345
  type = renderWithHooks(
4339
4346
  request,
@@ -4423,6 +4430,7 @@ function resumeNode(request, task, segmentId, node, childIndex) {
4423
4430
  (task.blockedSegment = resumedSegment),
4424
4431
  renderNode(request, task, node, childIndex),
4425
4432
  (resumedSegment.status = 1),
4433
+ finishedSegment(request, blockedBoundary, resumedSegment),
4426
4434
  null === blockedBoundary
4427
4435
  ? (request.completedRootSegment = resumedSegment)
4428
4436
  : (queueCompletedSegment(blockedBoundary, resumedSegment),
@@ -5127,6 +5135,16 @@ function queueCompletedSegment(boundary, segment) {
5127
5135
  1 === childSegment.status && queueCompletedSegment(boundary, childSegment);
5128
5136
  } else boundary.completedSegments.push(segment);
5129
5137
  }
5138
+ function finishedSegment(request, boundary, segment) {
5139
+ if (null !== byteLengthOfChunk) {
5140
+ segment = segment.chunks;
5141
+ for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
5142
+ segmentByteSize += byteLengthOfChunk(segment[i]);
5143
+ null === boundary
5144
+ ? (request.byteSize += segmentByteSize)
5145
+ : (boundary.byteSize += segmentByteSize);
5146
+ }
5147
+ }
5130
5148
  function finishedTask(request, boundary, segment) {
5131
5149
  if (null === boundary) {
5132
5150
  if (null !== segment && segment.parentFlushed) {
@@ -5150,8 +5168,12 @@ function finishedTask(request, boundary, segment) {
5150
5168
  boundary.parentFlushed &&
5151
5169
  request.completedBoundaries.push(boundary),
5152
5170
  1 === boundary.status &&
5153
- (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
5154
- boundary.fallbackAbortableTasks.clear(),
5171
+ (boundary.byteSize > request.progressiveChunkSize ||
5172
+ (boundary.fallbackAbortableTasks.forEach(
5173
+ abortTaskSoft,
5174
+ request
5175
+ ),
5176
+ boundary.fallbackAbortableTasks.clear()),
5155
5177
  0 === request.pendingRootTasks &&
5156
5178
  null === request.trackedPostpones &&
5157
5179
  null !== boundary.contentPreamble &&
@@ -5274,6 +5296,7 @@ function performWork(request$jscomp$2) {
5274
5296
  request$jscomp$1.chunks.push("\x3c!-- --\x3e"),
5275
5297
  task.abortSet.delete(task),
5276
5298
  (request$jscomp$1.status = 1),
5299
+ finishedSegment(request, task.blockedBoundary, request$jscomp$1),
5277
5300
  finishedTask(request, task.blockedBoundary, request$jscomp$1);
5278
5301
  } catch (thrownValue) {
5279
5302
  resetHooksState();
@@ -5919,13 +5942,13 @@ function abort(request, reason) {
5919
5942
  }
5920
5943
  var isomorphicReactPackageVersion$jscomp$inline_768 = React.version;
5921
5944
  if (
5922
- "19.2.0-canary-143d3e1b-20250425" !==
5945
+ "19.2.0-canary-c498bfce-20250426" !==
5923
5946
  isomorphicReactPackageVersion$jscomp$inline_768
5924
5947
  )
5925
5948
  throw Error(
5926
5949
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
5927
5950
  (isomorphicReactPackageVersion$jscomp$inline_768 +
5928
- "\n - react-dom: 19.2.0-canary-143d3e1b-20250425\nLearn more: https://react.dev/warnings/version-mismatch")
5951
+ "\n - react-dom: 19.2.0-canary-c498bfce-20250426\nLearn more: https://react.dev/warnings/version-mismatch")
5929
5952
  );
5930
5953
  exports.renderToReadableStream = function (children, options) {
5931
5954
  return new Promise(function (resolve, reject) {
@@ -6016,4 +6039,4 @@ exports.renderToReadableStream = function (children, options) {
6016
6039
  startWork(request);
6017
6040
  });
6018
6041
  };
6019
- exports.version = "19.2.0-canary-143d3e1b-20250425";
6042
+ exports.version = "19.2.0-canary-c498bfce-20250426";
@@ -316,6 +316,9 @@
316
316
  );
317
317
  return content;
318
318
  }
319
+ function byteLengthOfChunk(chunk) {
320
+ return chunk.byteLength;
321
+ }
319
322
  function closeWithError(destination, error) {
320
323
  "function" === typeof destination.error
321
324
  ? destination.error(error)
@@ -4474,6 +4477,7 @@
4474
4477
  this.fatalError = null;
4475
4478
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
4476
4479
  this.completedPreambleSegments = this.completedRootSegment = null;
4480
+ this.byteSize = 0;
4477
4481
  this.abortableTasks = abortSet;
4478
4482
  this.pingedTasks = [];
4479
4483
  this.clientRenderedBoundaries = [];
@@ -5653,7 +5657,8 @@
5653
5657
  boundarySegment.lastPushedText &&
5654
5658
  boundarySegment.textEmbedded &&
5655
5659
  boundarySegment.chunks.push(textSeparator),
5656
- (boundarySegment.status = COMPLETED);
5660
+ (boundarySegment.status = COMPLETED),
5661
+ finishedSegment(request, parentBoundary, boundarySegment);
5657
5662
  } catch (thrownValue) {
5658
5663
  throw (
5659
5664
  ((boundarySegment.status = 12 === request.status ? 3 : 4),
@@ -5699,11 +5704,13 @@
5699
5704
  contentRootSegment.textEmbedded &&
5700
5705
  contentRootSegment.chunks.push(textSeparator),
5701
5706
  (contentRootSegment.status = COMPLETED),
5707
+ finishedSegment(request, newBoundary, contentRootSegment),
5702
5708
  queueCompletedSegment(newBoundary, contentRootSegment),
5703
5709
  0 === newBoundary.pendingTasks &&
5704
- newBoundary.status === PENDING)
5710
+ newBoundary.status === PENDING &&
5711
+ ((newBoundary.status = COMPLETED),
5712
+ !(newBoundary.byteSize > request.progressiveChunkSize)))
5705
5713
  ) {
5706
- newBoundary.status = COMPLETED;
5707
5714
  0 === request.pendingRootTasks &&
5708
5715
  task.blockedPreamble &&
5709
5716
  preparePreamble(request);
@@ -5898,6 +5905,7 @@
5898
5905
  (task.blockedSegment = resumedSegment),
5899
5906
  renderNode(request, task, node, childIndex),
5900
5907
  (resumedSegment.status = COMPLETED),
5908
+ finishedSegment(request, blockedBoundary, resumedSegment),
5901
5909
  null === blockedBoundary
5902
5910
  ? (request.completedRootSegment = resumedSegment)
5903
5911
  : (queueCompletedSegment(blockedBoundary, resumedSegment),
@@ -6814,6 +6822,16 @@
6814
6822
  queueCompletedSegment(boundary, childSegment);
6815
6823
  } else boundary.completedSegments.push(segment);
6816
6824
  }
6825
+ function finishedSegment(request, boundary, segment) {
6826
+ if (null !== byteLengthOfChunk) {
6827
+ segment = segment.chunks;
6828
+ for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
6829
+ segmentByteSize += segment[i].byteLength;
6830
+ null === boundary
6831
+ ? (request.byteSize += segmentByteSize)
6832
+ : (boundary.byteSize += segmentByteSize);
6833
+ }
6834
+ }
6817
6835
  function finishedTask(request, boundary, segment) {
6818
6836
  if (null === boundary) {
6819
6837
  if (null !== segment && segment.parentFlushed) {
@@ -6837,11 +6855,12 @@
6837
6855
  boundary.parentFlushed &&
6838
6856
  request.completedBoundaries.push(boundary),
6839
6857
  boundary.status === COMPLETED &&
6840
- (boundary.fallbackAbortableTasks.forEach(
6841
- abortTaskSoft,
6842
- request
6843
- ),
6844
- boundary.fallbackAbortableTasks.clear(),
6858
+ (boundary.byteSize > request.progressiveChunkSize ||
6859
+ (boundary.fallbackAbortableTasks.forEach(
6860
+ abortTaskSoft,
6861
+ request
6862
+ ),
6863
+ boundary.fallbackAbortableTasks.clear()),
6845
6864
  0 === request.pendingRootTasks &&
6846
6865
  null === request.trackedPostpones &&
6847
6866
  null !== boundary.contentPreamble &&
@@ -6981,6 +7000,11 @@
6981
7000
  request$jscomp$1.chunks.push(textSeparator),
6982
7001
  errorDigest.abortSet.delete(errorDigest),
6983
7002
  (request$jscomp$1.status = COMPLETED),
7003
+ finishedSegment(
7004
+ request,
7005
+ errorDigest.blockedBoundary,
7006
+ request$jscomp$1
7007
+ ),
6984
7008
  finishedTask(
6985
7009
  request,
6986
7010
  errorDigest.blockedBoundary,
@@ -7839,11 +7863,11 @@
7839
7863
  }
7840
7864
  function ensureCorrectIsomorphicReactVersion() {
7841
7865
  var isomorphicReactPackageVersion = React.version;
7842
- if ("19.2.0-canary-143d3e1b-20250425" !== isomorphicReactPackageVersion)
7866
+ if ("19.2.0-canary-c498bfce-20250426" !== isomorphicReactPackageVersion)
7843
7867
  throw Error(
7844
7868
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
7845
7869
  (isomorphicReactPackageVersion +
7846
- "\n - react-dom: 19.2.0-canary-143d3e1b-20250425\nLearn more: https://react.dev/warnings/version-mismatch")
7870
+ "\n - react-dom: 19.2.0-canary-c498bfce-20250426\nLearn more: https://react.dev/warnings/version-mismatch")
7847
7871
  );
7848
7872
  }
7849
7873
  var React = require("react"),
@@ -9521,5 +9545,5 @@
9521
9545
  startWork(request);
9522
9546
  });
9523
9547
  };
9524
- exports.version = "19.2.0-canary-143d3e1b-20250425";
9548
+ exports.version = "19.2.0-canary-c498bfce-20250426";
9525
9549
  })();