react-server-dom-webpack 19.1.7 → 19.1.8

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.
@@ -2745,10 +2745,10 @@
2745
2745
  return hook.checkDCE ? !0 : !1;
2746
2746
  })({
2747
2747
  bundleType: 1,
2748
- version: "19.1.7",
2748
+ version: "19.1.8",
2749
2749
  rendererPackageName: "react-server-dom-webpack",
2750
2750
  currentDispatcherRef: ReactSharedInternals,
2751
- reconcilerVersion: "19.1.7",
2751
+ reconcilerVersion: "19.1.8",
2752
2752
  getCurrentComponentInfo: function () {
2753
2753
  return currentOwnerInDEV;
2754
2754
  }
@@ -4555,20 +4555,58 @@
4555
4555
  webpackMap,
4556
4556
  options
4557
4557
  ) {
4558
- var response = createResponse(
4558
+ function flush() {
4559
+ for (; null !== head; ) {
4560
+ var current = head;
4561
+ if (!current.complete) return;
4562
+ try {
4563
+ var response = response$jscomp$0,
4564
+ key = current.name,
4565
+ handle = current.file,
4566
+ blob = new Blob(handle.chunks, { type: handle.mime }),
4567
+ backingStore = response._formData;
4568
+ response = key;
4569
+ backingStore.data.append(response, blob, handle.filename);
4570
+ var keys = backingStore.keys;
4571
+ null === keys
4572
+ ? ((backingStore.keys = Array.from(backingStore.data.keys())),
4573
+ (backingStore.keyPointer = 0))
4574
+ : keys.push(response);
4575
+ var queuedFields = current.queuedFields;
4576
+ if (null !== queuedFields)
4577
+ for (response = 0; response < queuedFields.length; response += 2)
4578
+ resolveField(
4579
+ response$jscomp$0,
4580
+ queuedFields[response],
4581
+ queuedFields[response + 1]
4582
+ );
4583
+ } catch (error) {
4584
+ busboyStream.destroy(error);
4585
+ return;
4586
+ }
4587
+ head = current.next;
4588
+ }
4589
+ tail = null;
4590
+ bodyFinished && !closed && ((closed = !0), close(response$jscomp$0));
4591
+ }
4592
+ var response$jscomp$0 = createResponse(
4559
4593
  webpackMap,
4560
4594
  "",
4561
4595
  options ? options.temporaryReferences : void 0,
4562
4596
  void 0,
4563
4597
  options ? options.arraySizeLimit : void 0
4564
4598
  ),
4565
- pendingFiles = 0,
4566
- queuedFields = [];
4599
+ head = null,
4600
+ tail = null,
4601
+ bodyFinished = !1,
4602
+ closed = !1;
4567
4603
  busboyStream.on("field", function (name, value) {
4568
- if (0 < pendingFiles) queuedFields.push(name, value);
4604
+ if (null !== tail)
4605
+ null === tail.queuedFields && (tail.queuedFields = []),
4606
+ tail.queuedFields.push(name, value);
4569
4607
  else
4570
4608
  try {
4571
- resolveField(response, name, value);
4609
+ resolveField(response$jscomp$0, name, value);
4572
4610
  } catch (error) {
4573
4611
  busboyStream.destroy(error);
4574
4612
  }
@@ -4583,46 +4621,45 @@
4583
4621
  )
4584
4622
  );
4585
4623
  else {
4586
- pendingFiles++;
4587
- var JSCompiler_object_inline_chunks_174 = [];
4624
+ var file = { chunks: [], filename: filename, mime: mimeType },
4625
+ pendingFile = {
4626
+ name: name,
4627
+ file: file,
4628
+ complete: !1,
4629
+ queuedFields: null,
4630
+ next: null
4631
+ };
4632
+ null === tail ? (head = pendingFile) : (tail.next = pendingFile);
4633
+ tail = pendingFile;
4588
4634
  value.on("data", function (chunk) {
4589
- JSCompiler_object_inline_chunks_174.push(chunk);
4590
- });
4591
- value.on("end", function () {
4592
4635
  try {
4593
- var blob = new Blob(JSCompiler_object_inline_chunks_174, {
4594
- type: mimeType
4595
- }),
4596
- backingStore = response._formData;
4597
- backingStore.data.append(name, blob, filename);
4598
- var keys = backingStore.keys;
4599
- null === keys
4600
- ? ((backingStore.keys = Array.from(backingStore.data.keys())),
4601
- (backingStore.keyPointer = 0))
4602
- : keys.push(name);
4603
- pendingFiles--;
4604
- if (0 === pendingFiles) {
4605
- for (blob = 0; blob < queuedFields.length; blob += 2)
4606
- resolveField(
4607
- response,
4608
- queuedFields[blob],
4609
- queuedFields[blob + 1]
4610
- );
4611
- queuedFields.length = 0;
4612
- }
4636
+ file.chunks.push(chunk);
4613
4637
  } catch (error) {
4614
4638
  busboyStream.destroy(error);
4615
4639
  }
4616
4640
  });
4641
+ value.on("error", function (error) {
4642
+ busboyStream.destroy(error);
4643
+ });
4644
+ value.on("end", function () {
4645
+ pendingFile.complete = !0;
4646
+ flush();
4647
+ });
4617
4648
  }
4618
4649
  });
4619
4650
  busboyStream.on("finish", function () {
4620
- close(response);
4651
+ bodyFinished = !0;
4652
+ flush();
4653
+ closed ||
4654
+ reportGlobalError(
4655
+ response$jscomp$0,
4656
+ Error("Reply finished with incomplete file part.")
4657
+ );
4621
4658
  });
4622
4659
  busboyStream.on("error", function (err) {
4623
- reportGlobalError(response, err);
4660
+ reportGlobalError(response$jscomp$0, err);
4624
4661
  });
4625
- return getChunk(response, 0);
4662
+ return getChunk(response$jscomp$0, 0);
4626
4663
  };
4627
4664
  exports.registerClientReference = function (
4628
4665
  proxyImplementation,
@@ -3267,6 +3267,43 @@ exports.decodeReply = function (body, webpackMap, options) {
3267
3267
  return webpackMap;
3268
3268
  };
3269
3269
  exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
3270
+ function flush() {
3271
+ for (; null !== head; ) {
3272
+ var current = head;
3273
+ if (!current.complete) return;
3274
+ try {
3275
+ var key = current.name,
3276
+ handle = current.file,
3277
+ blob = new Blob(handle.chunks, { type: handle.mime }),
3278
+ backingStore = response._formData,
3279
+ key$jscomp$0 = key;
3280
+ backingStore.data.append(key$jscomp$0, blob, handle.filename);
3281
+ var keys = backingStore.keys;
3282
+ null === keys
3283
+ ? ((backingStore.keys = Array.from(backingStore.data.keys())),
3284
+ (backingStore.keyPointer = 0))
3285
+ : keys.push(key$jscomp$0);
3286
+ var queuedFields = current.queuedFields;
3287
+ if (null !== queuedFields)
3288
+ for (
3289
+ key$jscomp$0 = 0;
3290
+ key$jscomp$0 < queuedFields.length;
3291
+ key$jscomp$0 += 2
3292
+ )
3293
+ resolveField(
3294
+ response,
3295
+ queuedFields[key$jscomp$0],
3296
+ queuedFields[key$jscomp$0 + 1]
3297
+ );
3298
+ } catch (error) {
3299
+ busboyStream.destroy(error);
3300
+ return;
3301
+ }
3302
+ head = current.next;
3303
+ }
3304
+ tail = null;
3305
+ bodyFinished && !closed && ((closed = !0), close(response));
3306
+ }
3270
3307
  var response = createResponse(
3271
3308
  webpackMap,
3272
3309
  "",
@@ -3274,10 +3311,14 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
3274
3311
  void 0,
3275
3312
  options ? options.arraySizeLimit : void 0
3276
3313
  ),
3277
- pendingFiles = 0,
3278
- queuedFields = [];
3314
+ head = null,
3315
+ tail = null,
3316
+ bodyFinished = !1,
3317
+ closed = !1;
3279
3318
  busboyStream.on("field", function (name, value) {
3280
- if (0 < pendingFiles) queuedFields.push(name, value);
3319
+ if (null !== tail)
3320
+ null === tail.queuedFields && (tail.queuedFields = []),
3321
+ tail.queuedFields.push(name, value);
3281
3322
  else
3282
3323
  try {
3283
3324
  resolveField(response, name, value);
@@ -3295,41 +3336,40 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
3295
3336
  )
3296
3337
  );
3297
3338
  else {
3298
- pendingFiles++;
3299
- var JSCompiler_object_inline_chunks_254 = [];
3339
+ var file = { chunks: [], filename: filename, mime: mimeType },
3340
+ pendingFile = {
3341
+ name: name,
3342
+ file: file,
3343
+ complete: !1,
3344
+ queuedFields: null,
3345
+ next: null
3346
+ };
3347
+ null === tail ? (head = pendingFile) : (tail.next = pendingFile);
3348
+ tail = pendingFile;
3300
3349
  value.on("data", function (chunk) {
3301
- JSCompiler_object_inline_chunks_254.push(chunk);
3302
- });
3303
- value.on("end", function () {
3304
3350
  try {
3305
- var blob = new Blob(JSCompiler_object_inline_chunks_254, {
3306
- type: mimeType
3307
- }),
3308
- backingStore = response._formData;
3309
- backingStore.data.append(name, blob, filename);
3310
- var keys = backingStore.keys;
3311
- null === keys
3312
- ? ((backingStore.keys = Array.from(backingStore.data.keys())),
3313
- (backingStore.keyPointer = 0))
3314
- : keys.push(name);
3315
- pendingFiles--;
3316
- if (0 === pendingFiles) {
3317
- for (blob = 0; blob < queuedFields.length; blob += 2)
3318
- resolveField(
3319
- response,
3320
- queuedFields[blob],
3321
- queuedFields[blob + 1]
3322
- );
3323
- queuedFields.length = 0;
3324
- }
3351
+ file.chunks.push(chunk);
3325
3352
  } catch (error) {
3326
3353
  busboyStream.destroy(error);
3327
3354
  }
3328
3355
  });
3356
+ value.on("error", function (error) {
3357
+ busboyStream.destroy(error);
3358
+ });
3359
+ value.on("end", function () {
3360
+ pendingFile.complete = !0;
3361
+ flush();
3362
+ });
3329
3363
  }
3330
3364
  });
3331
3365
  busboyStream.on("finish", function () {
3332
- close(response);
3366
+ bodyFinished = !0;
3367
+ flush();
3368
+ closed ||
3369
+ reportGlobalError(
3370
+ response,
3371
+ Error("Reply finished with incomplete file part.")
3372
+ );
3333
3373
  });
3334
3374
  busboyStream.on("error", function (err) {
3335
3375
  reportGlobalError(response, err);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-server-dom-webpack",
3
3
  "description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
4
- "version": "19.1.7",
4
+ "version": "19.1.8",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -84,8 +84,8 @@
84
84
  "node": ">=0.10.0"
85
85
  },
86
86
  "peerDependencies": {
87
- "react": "^19.1.7",
88
- "react-dom": "^19.1.7",
87
+ "react": "^19.1.8",
88
+ "react-dom": "^19.1.8",
89
89
  "webpack": "^5.59.0"
90
90
  },
91
91
  "dependencies": {