Skip to content

Commit 2bd5c46

Browse files
Upgrade react-server-dom-webpack to v19.0.3 - Security Patches for CVE-2025-55183, CVE-2025-55184, CVE-2025-67779 (#12)
* Update react-server-dom-webpack to React 19.0.3 * [RSC-REPLACE] Replace react-server-dom-webpack with react-on-rails-rsc
1 parent 1e5469d commit 2bd5c46

21 files changed

+1475
-1471
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"webpack": "^5.98.0"
8484
},
8585
"peerDependencies": {
86-
"react": "^19.0.1",
87-
"react-dom": "^19.0.1",
86+
"react": "^19.0.3",
87+
"react-dom": "^19.0.3",
8888
"webpack": "^5.59.0"
8989
},
9090
"dependencies": {

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,23 @@
507507
pendingParts--;
508508
}
509509
}
510+
parentReference = writtenObjects.get(value);
510511
if ("function" === typeof value.then) {
512+
if (void 0 !== parentReference)
513+
if (modelRoot === value) modelRoot = null;
514+
else return parentReference;
511515
null === formData && (formData = new FormData());
512516
pendingParts++;
513517
var promiseId = nextPartId++;
518+
key = "$@" + promiseId.toString(16);
519+
writtenObjects.set(value, key);
514520
value.then(function (partValue) {
515521
try {
516-
var _partJSON3 = serializeModel(partValue, promiseId);
522+
var previousReference = writtenObjects.get(partValue);
523+
var _partJSON3 =
524+
void 0 !== previousReference
525+
? JSON.stringify(previousReference)
526+
: serializeModel(partValue, promiseId);
517527
partValue = formData;
518528
partValue.append(formFieldPrefix + promiseId, _partJSON3);
519529
pendingParts--;
@@ -522,9 +532,8 @@
522532
reject(reason);
523533
}
524534
}, reject);
525-
return "$@" + promiseId.toString(16);
535+
return key;
526536
}
527-
parentReference = writtenObjects.get(value);
528537
if (void 0 !== parentReference)
529538
if (modelRoot === value) modelRoot = null;
530539
else return parentReference;
@@ -679,7 +688,7 @@
679688
null === formData && (formData = new FormData()),
680689
(parentReference = nextPartId++),
681690
formData.set(formFieldPrefix + parentReference, key),
682-
"$F" + parentReference.toString(16)
691+
"$h" + parentReference.toString(16)
683692
);
684693
if (
685694
void 0 !== temporaryReferences &&
@@ -1370,7 +1379,7 @@
13701379
return getChunk(response, parentObject);
13711380
case "S":
13721381
return Symbol.for(value.slice(2));
1373-
case "F":
1382+
case "h":
13741383
return (
13751384
(value = value.slice(2)),
13761385
getOutlinedModel(
@@ -2464,10 +2473,10 @@
24642473
return hook.checkDCE ? !0 : !1;
24652474
})({
24662475
bundleType: 1,
2467-
version: "19.0.1",
2476+
version: "19.0.3",
24682477
rendererPackageName: "react-server-dom-webpack",
24692478
currentDispatcherRef: ReactSharedInternals,
2470-
reconcilerVersion: "19.0.1",
2479+
reconcilerVersion: "19.0.3",
24712480
getCurrentComponentInfo: function () {
24722481
return currentOwnerInDEV;
24732482
}

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,23 @@ function processReply(
303303
pendingParts--;
304304
}
305305
}
306+
parentReference = writtenObjects.get(value);
306307
if ("function" === typeof value.then) {
308+
if (void 0 !== parentReference)
309+
if (modelRoot === value) modelRoot = null;
310+
else return parentReference;
307311
null === formData && (formData = new FormData());
308312
pendingParts++;
309313
var promiseId = nextPartId++;
314+
key = "$@" + promiseId.toString(16);
315+
writtenObjects.set(value, key);
310316
value.then(function (partValue) {
311317
try {
312-
var partJSON$28 = serializeModel(partValue, promiseId);
318+
var previousReference = writtenObjects.get(partValue);
319+
var partJSON$28 =
320+
void 0 !== previousReference
321+
? JSON.stringify(previousReference)
322+
: serializeModel(partValue, promiseId);
313323
partValue = formData;
314324
partValue.append(formFieldPrefix + promiseId, partJSON$28);
315325
pendingParts--;
@@ -318,9 +328,8 @@ function processReply(
318328
reject(reason);
319329
}
320330
}, reject);
321-
return "$@" + promiseId.toString(16);
331+
return key;
322332
}
323-
parentReference = writtenObjects.get(value);
324333
if (void 0 !== parentReference)
325334
if (modelRoot === value) modelRoot = null;
326335
else return parentReference;
@@ -441,7 +450,7 @@ function processReply(
441450
null === formData && (formData = new FormData()),
442451
(parentReference = nextPartId++),
443452
formData.set(formFieldPrefix + parentReference, key),
444-
"$F" + parentReference.toString(16)
453+
"$h" + parentReference.toString(16)
445454
);
446455
if (
447456
void 0 !== temporaryReferences &&
@@ -934,7 +943,7 @@ function parseModelString(response, parentObject, key, value) {
934943
return getChunk(response, parentObject);
935944
case "S":
936945
return Symbol.for(value.slice(2));
937-
case "F":
946+
case "h":
938947
return (
939948
(value = value.slice(2)),
940949
getOutlinedModel(

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,23 @@
528528
pendingParts--;
529529
}
530530
}
531+
parentReference = writtenObjects.get(value);
531532
if ("function" === typeof value.then) {
533+
if (void 0 !== parentReference)
534+
if (modelRoot === value) modelRoot = null;
535+
else return parentReference;
532536
null === formData && (formData = new FormData());
533537
pendingParts++;
534538
var promiseId = nextPartId++;
539+
key = "$@" + promiseId.toString(16);
540+
writtenObjects.set(value, key);
535541
value.then(function (partValue) {
536542
try {
537-
var _partJSON3 = serializeModel(partValue, promiseId);
543+
var previousReference = writtenObjects.get(partValue);
544+
var _partJSON3 =
545+
void 0 !== previousReference
546+
? JSON.stringify(previousReference)
547+
: serializeModel(partValue, promiseId);
538548
partValue = formData;
539549
partValue.append(formFieldPrefix + promiseId, _partJSON3);
540550
pendingParts--;
@@ -543,9 +553,8 @@
543553
reject(reason);
544554
}
545555
}, reject);
546-
return "$@" + promiseId.toString(16);
556+
return key;
547557
}
548-
parentReference = writtenObjects.get(value);
549558
if (void 0 !== parentReference)
550559
if (modelRoot === value) modelRoot = null;
551560
else return parentReference;
@@ -700,7 +709,7 @@
700709
null === formData && (formData = new FormData()),
701710
(parentReference = nextPartId++),
702711
formData.set(formFieldPrefix + parentReference, key),
703-
"$F" + parentReference.toString(16)
712+
"$h" + parentReference.toString(16)
704713
);
705714
if (
706715
void 0 !== temporaryReferences &&
@@ -1574,7 +1583,7 @@
15741583
return getChunk(response, parentObject);
15751584
case "S":
15761585
return Symbol.for(value.slice(2));
1577-
case "F":
1586+
case "h":
15781587
return (
15791588
(value = value.slice(2)),
15801589
getOutlinedModel(

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,23 @@ function processReply(
315315
pendingParts--;
316316
}
317317
}
318+
parentReference = writtenObjects.get(value);
318319
if ("function" === typeof value.then) {
320+
if (void 0 !== parentReference)
321+
if (modelRoot === value) modelRoot = null;
322+
else return parentReference;
319323
null === formData && (formData = new FormData());
320324
pendingParts++;
321325
var promiseId = nextPartId++;
326+
key = "$@" + promiseId.toString(16);
327+
writtenObjects.set(value, key);
322328
value.then(function (partValue) {
323329
try {
324-
var partJSON$28 = serializeModel(partValue, promiseId);
330+
var previousReference = writtenObjects.get(partValue);
331+
var partJSON$28 =
332+
void 0 !== previousReference
333+
? JSON.stringify(previousReference)
334+
: serializeModel(partValue, promiseId);
325335
partValue = formData;
326336
partValue.append(formFieldPrefix + promiseId, partJSON$28);
327337
pendingParts--;
@@ -330,9 +340,8 @@ function processReply(
330340
reject(reason);
331341
}
332342
}, reject);
333-
return "$@" + promiseId.toString(16);
343+
return key;
334344
}
335-
parentReference = writtenObjects.get(value);
336345
if (void 0 !== parentReference)
337346
if (modelRoot === value) modelRoot = null;
338347
else return parentReference;
@@ -453,7 +462,7 @@ function processReply(
453462
null === formData && (formData = new FormData()),
454463
(parentReference = nextPartId++),
455464
formData.set(formFieldPrefix + parentReference, key),
456-
"$F" + parentReference.toString(16)
465+
"$h" + parentReference.toString(16)
457466
);
458467
if (
459468
void 0 !== temporaryReferences &&
@@ -1092,7 +1101,7 @@ function parseModelString(response, parentObject, key, value) {
10921101
return getChunk(response, parentObject);
10931102
case "S":
10941103
return Symbol.for(value.slice(2));
1095-
case "F":
1104+
case "h":
10961105
return (
10971106
(value = value.slice(2)),
10981107
getOutlinedModel(

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,23 @@
528528
pendingParts--;
529529
}
530530
}
531+
parentReference = writtenObjects.get(value);
531532
if ("function" === typeof value.then) {
533+
if (void 0 !== parentReference)
534+
if (modelRoot === value) modelRoot = null;
535+
else return parentReference;
532536
null === formData && (formData = new FormData());
533537
pendingParts++;
534538
var promiseId = nextPartId++;
539+
key = "$@" + promiseId.toString(16);
540+
writtenObjects.set(value, key);
535541
value.then(function (partValue) {
536542
try {
537-
var _partJSON3 = serializeModel(partValue, promiseId);
543+
var previousReference = writtenObjects.get(partValue);
544+
var _partJSON3 =
545+
void 0 !== previousReference
546+
? JSON.stringify(previousReference)
547+
: serializeModel(partValue, promiseId);
538548
partValue = formData;
539549
partValue.append(formFieldPrefix + promiseId, _partJSON3);
540550
pendingParts--;
@@ -543,9 +553,8 @@
543553
reject(reason);
544554
}
545555
}, reject);
546-
return "$@" + promiseId.toString(16);
556+
return key;
547557
}
548-
parentReference = writtenObjects.get(value);
549558
if (void 0 !== parentReference)
550559
if (modelRoot === value) modelRoot = null;
551560
else return parentReference;
@@ -700,7 +709,7 @@
700709
null === formData && (formData = new FormData()),
701710
(parentReference = nextPartId++),
702711
formData.set(formFieldPrefix + parentReference, key),
703-
"$F" + parentReference.toString(16)
712+
"$h" + parentReference.toString(16)
704713
);
705714
if (
706715
void 0 !== temporaryReferences &&
@@ -1574,7 +1583,7 @@
15741583
return getChunk(response, parentObject);
15751584
case "S":
15761585
return Symbol.for(value.slice(2));
1577-
case "F":
1586+
case "h":
15781587
return (
15791588
(value = value.slice(2)),
15801589
getOutlinedModel(

src/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,23 @@ function processReply(
316316
pendingParts--;
317317
}
318318
}
319+
parentReference = writtenObjects.get(value);
319320
if ("function" === typeof value.then) {
321+
if (void 0 !== parentReference)
322+
if (modelRoot === value) modelRoot = null;
323+
else return parentReference;
320324
null === formData && (formData = new FormData());
321325
pendingParts++;
322326
var promiseId = nextPartId++;
327+
key = "$@" + promiseId.toString(16);
328+
writtenObjects.set(value, key);
323329
value.then(function (partValue) {
324330
try {
325-
var partJSON$28 = serializeModel(partValue, promiseId);
331+
var previousReference = writtenObjects.get(partValue);
332+
var partJSON$28 =
333+
void 0 !== previousReference
334+
? JSON.stringify(previousReference)
335+
: serializeModel(partValue, promiseId);
326336
partValue = formData;
327337
partValue.append(formFieldPrefix + promiseId, partJSON$28);
328338
pendingParts--;
@@ -331,9 +341,8 @@ function processReply(
331341
reject(reason);
332342
}
333343
}, reject);
334-
return "$@" + promiseId.toString(16);
344+
return key;
335345
}
336-
parentReference = writtenObjects.get(value);
337346
if (void 0 !== parentReference)
338347
if (modelRoot === value) modelRoot = null;
339348
else return parentReference;
@@ -454,7 +463,7 @@ function processReply(
454463
null === formData && (formData = new FormData()),
455464
(parentReference = nextPartId++),
456465
formData.set(formFieldPrefix + parentReference, key),
457-
"$F" + parentReference.toString(16)
466+
"$h" + parentReference.toString(16)
458467
);
459468
if (
460469
void 0 !== temporaryReferences &&
@@ -1093,7 +1102,7 @@ function parseModelString(response, parentObject, key, value) {
10931102
return getChunk(response, parentObject);
10941103
case "S":
10951104
return Symbol.for(value.slice(2));
1096-
case "F":
1105+
case "h":
10971106
return (
10981107
(value = value.slice(2)),
10991108
getOutlinedModel(

0 commit comments

Comments
 (0)