@matthamlin/react-client 0.0.0-experimental-06e89951-20250620 → 0.0.0-experimental-12eaef7e-20250623
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.
@@ -134,11 +134,11 @@ module.exports = function ($$$config) {
|
|
134
134
|
0 === pendingParts && resolve(data);
|
135
135
|
} else
|
136
136
|
try {
|
137
|
-
var partJSON$
|
138
|
-
data.append(formFieldPrefix + streamId, partJSON$
|
137
|
+
var partJSON$0 = JSON.stringify(entry.value, resolveToJSON);
|
138
|
+
data.append(formFieldPrefix + streamId, partJSON$0);
|
139
139
|
iterator.next().then(progress, reject);
|
140
|
-
} catch (x$
|
141
|
-
reject(x$
|
140
|
+
} catch (x$1) {
|
141
|
+
reject(x$1);
|
142
142
|
}
|
143
143
|
}
|
144
144
|
null === formData && (formData = new FormData());
|
@@ -181,20 +181,20 @@ module.exports = function ($$$config) {
|
|
181
181
|
"function" === typeof x.then
|
182
182
|
) {
|
183
183
|
pendingParts++;
|
184
|
-
var lazyId$
|
184
|
+
var lazyId$2 = nextPartId++;
|
185
185
|
parentReference = function () {
|
186
186
|
try {
|
187
|
-
var partJSON$
|
188
|
-
data$
|
189
|
-
data$
|
187
|
+
var partJSON$3 = serializeModel(value, lazyId$2),
|
188
|
+
data$4 = formData;
|
189
|
+
data$4.append(formFieldPrefix + lazyId$2, partJSON$3);
|
190
190
|
pendingParts--;
|
191
|
-
0 === pendingParts && resolve(data$
|
191
|
+
0 === pendingParts && resolve(data$4);
|
192
192
|
} catch (reason) {
|
193
193
|
reject(reason);
|
194
194
|
}
|
195
195
|
};
|
196
196
|
x.then(parentReference, parentReference);
|
197
|
-
return "$" + lazyId$
|
197
|
+
return "$" + lazyId$2.toString(16);
|
198
198
|
}
|
199
199
|
reject(x);
|
200
200
|
return null;
|
@@ -208,9 +208,9 @@ module.exports = function ($$$config) {
|
|
208
208
|
var promiseId = nextPartId++;
|
209
209
|
value.then(function (partValue) {
|
210
210
|
try {
|
211
|
-
var partJSON$
|
211
|
+
var partJSON$6 = serializeModel(partValue, promiseId);
|
212
212
|
partValue = formData;
|
213
|
-
partValue.append(formFieldPrefix + promiseId, partJSON$
|
213
|
+
partValue.append(formFieldPrefix + promiseId, partJSON$6);
|
214
214
|
pendingParts--;
|
215
215
|
0 === pendingParts && resolve(partValue);
|
216
216
|
} catch (reason) {
|
@@ -234,11 +234,11 @@ module.exports = function ($$$config) {
|
|
234
234
|
if (isArrayImpl(value)) return value;
|
235
235
|
if (value instanceof FormData) {
|
236
236
|
null === formData && (formData = new FormData());
|
237
|
-
var data$
|
237
|
+
var data$10 = formData;
|
238
238
|
key = nextPartId++;
|
239
239
|
var prefix = formFieldPrefix + key + "_";
|
240
240
|
value.forEach(function (originalValue, originalKey) {
|
241
|
-
data$
|
241
|
+
data$10.append(prefix + originalKey, originalValue);
|
242
242
|
});
|
243
243
|
return "$K" + key.toString(16);
|
244
244
|
}
|
@@ -557,11 +557,10 @@ module.exports = function ($$$config) {
|
|
557
557
|
registerBoundServerReference(action, id, bound, encodeFormAction);
|
558
558
|
return action;
|
559
559
|
}
|
560
|
-
function ReactPromise(status, value, reason
|
560
|
+
function ReactPromise(status, value, reason) {
|
561
561
|
this.status = status;
|
562
562
|
this.value = value;
|
563
563
|
this.reason = reason;
|
564
|
-
this._response = response;
|
565
564
|
}
|
566
565
|
function readChunk(chunk) {
|
567
566
|
switch (chunk.status) {
|
@@ -576,16 +575,14 @@ module.exports = function ($$$config) {
|
|
576
575
|
return chunk.value;
|
577
576
|
case "pending":
|
578
577
|
case "blocked":
|
578
|
+
case "halted":
|
579
579
|
throw chunk;
|
580
580
|
default:
|
581
581
|
throw chunk.reason;
|
582
582
|
}
|
583
583
|
}
|
584
|
-
function createPendingChunk(response) {
|
585
|
-
return new ReactPromise("pending", null, null, response);
|
586
|
-
}
|
587
584
|
function createErrorChunk(response, error) {
|
588
|
-
return new ReactPromise("rejected", null, error
|
585
|
+
return new ReactPromise("rejected", null, error);
|
589
586
|
}
|
590
587
|
function wakeChunk(listeners, value) {
|
591
588
|
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
|
@@ -629,23 +626,24 @@ module.exports = function ($$$config) {
|
|
629
626
|
return new ReactPromise(
|
630
627
|
"resolved_model",
|
631
628
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
632
|
-
null,
|
633
629
|
response
|
634
630
|
);
|
635
631
|
}
|
636
|
-
function resolveIteratorResultChunk(chunk, value, done) {
|
632
|
+
function resolveIteratorResultChunk(response, chunk, value, done) {
|
637
633
|
resolveModelChunk(
|
634
|
+
response,
|
638
635
|
chunk,
|
639
636
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}"
|
640
637
|
);
|
641
638
|
}
|
642
|
-
function resolveModelChunk(chunk, value) {
|
639
|
+
function resolveModelChunk(response, chunk, value) {
|
643
640
|
if ("pending" !== chunk.status) chunk.reason.enqueueModel(value);
|
644
641
|
else {
|
645
642
|
var resolveListeners = chunk.value,
|
646
643
|
rejectListeners = chunk.reason;
|
647
644
|
chunk.status = "resolved_model";
|
648
645
|
chunk.value = value;
|
646
|
+
chunk.reason = response;
|
649
647
|
null !== resolveListeners &&
|
650
648
|
(initializeModelChunk(chunk),
|
651
649
|
wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
|
@@ -665,12 +663,13 @@ module.exports = function ($$$config) {
|
|
665
663
|
function initializeModelChunk(chunk) {
|
666
664
|
var prevHandler = initializingHandler;
|
667
665
|
initializingHandler = null;
|
668
|
-
var resolvedModel = chunk.value
|
666
|
+
var resolvedModel = chunk.value,
|
667
|
+
response = chunk.reason;
|
669
668
|
chunk.status = "blocked";
|
670
669
|
chunk.value = null;
|
671
670
|
chunk.reason = null;
|
672
671
|
try {
|
673
|
-
var value = JSON.parse(resolvedModel,
|
672
|
+
var value = JSON.parse(resolvedModel, response._fromJSON),
|
674
673
|
resolveListeners = chunk.value;
|
675
674
|
null !== resolveListeners &&
|
676
675
|
((chunk.value = null),
|
@@ -717,7 +716,7 @@ module.exports = function ($$$config) {
|
|
717
716
|
chunk ||
|
718
717
|
((chunk = response._closed
|
719
718
|
? createErrorChunk(response, response._closedReason)
|
720
|
-
:
|
719
|
+
: new ReactPromise("pending", null, null)),
|
721
720
|
chunks.set(id, chunk));
|
722
721
|
return chunk;
|
723
722
|
}
|
@@ -907,6 +906,7 @@ module.exports = function ($$$config) {
|
|
907
906
|
return map(response, value, parentObject, key);
|
908
907
|
case "pending":
|
909
908
|
case "blocked":
|
909
|
+
case "halted":
|
910
910
|
return waitForReference(
|
911
911
|
id,
|
912
912
|
parentObject,
|
@@ -977,9 +977,10 @@ module.exports = function ($$$config) {
|
|
977
977
|
createLazyChunkWrapper(response)
|
978
978
|
);
|
979
979
|
case "@":
|
980
|
-
|
981
|
-
|
982
|
-
|
980
|
+
return (
|
981
|
+
(parentObject = parseInt(value.slice(2), 16)),
|
982
|
+
getChunk(response, parentObject)
|
983
|
+
);
|
983
984
|
case "S":
|
984
985
|
return Symbol.for(value.slice(2));
|
985
986
|
case "F":
|
@@ -1082,11 +1083,11 @@ module.exports = function ($$$config) {
|
|
1082
1083
|
this._fromJSON = createFromJSONCallback(this);
|
1083
1084
|
}
|
1084
1085
|
function resolveBuffer(response, id, buffer) {
|
1085
|
-
|
1086
|
-
|
1086
|
+
response = response._chunks;
|
1087
|
+
var chunk = response.get(id);
|
1087
1088
|
chunk && "pending" !== chunk.status
|
1088
1089
|
? chunk.reason.enqueueValue(buffer)
|
1089
|
-
:
|
1090
|
+
: response.set(id, new ReactPromise("fulfilled", buffer, null));
|
1090
1091
|
}
|
1091
1092
|
function resolveModule(response, id, model) {
|
1092
1093
|
var chunks = response._chunks,
|
@@ -1101,14 +1102,14 @@ module.exports = function ($$$config) {
|
|
1101
1102
|
response._nonce,
|
1102
1103
|
model
|
1103
1104
|
);
|
1104
|
-
if ((
|
1105
|
+
if ((response = preloadModule(clientReference))) {
|
1105
1106
|
if (chunk) {
|
1106
1107
|
var blockedChunk = chunk;
|
1107
1108
|
blockedChunk.status = "blocked";
|
1108
1109
|
} else
|
1109
|
-
(blockedChunk = new ReactPromise("blocked", null, null
|
1110
|
+
(blockedChunk = new ReactPromise("blocked", null, null)),
|
1110
1111
|
chunks.set(id, blockedChunk);
|
1111
|
-
|
1112
|
+
response.then(
|
1112
1113
|
function () {
|
1113
1114
|
return resolveModuleChunk(blockedChunk, clientReference);
|
1114
1115
|
},
|
@@ -1121,23 +1122,20 @@ module.exports = function ($$$config) {
|
|
1121
1122
|
? resolveModuleChunk(chunk, clientReference)
|
1122
1123
|
: chunks.set(
|
1123
1124
|
id,
|
1124
|
-
new ReactPromise("resolved_module", clientReference, null
|
1125
|
+
new ReactPromise("resolved_module", clientReference, null)
|
1125
1126
|
);
|
1126
1127
|
}
|
1127
1128
|
function resolveStream(response, id, stream, controller) {
|
1128
|
-
var chunks = response._chunks
|
1129
|
-
|
1130
|
-
|
1131
|
-
? "pending" ===
|
1132
|
-
((
|
1133
|
-
(
|
1134
|
-
(
|
1135
|
-
(
|
1136
|
-
null !==
|
1137
|
-
: chunks.set(
|
1138
|
-
id,
|
1139
|
-
new ReactPromise("fulfilled", stream, controller, response)
|
1140
|
-
);
|
1129
|
+
var chunks = response._chunks;
|
1130
|
+
response = chunks.get(id);
|
1131
|
+
response
|
1132
|
+
? "pending" === response.status &&
|
1133
|
+
((id = response.value),
|
1134
|
+
(response.status = "fulfilled"),
|
1135
|
+
(response.value = stream),
|
1136
|
+
(response.reason = controller),
|
1137
|
+
null !== id && wakeChunk(id, response.value))
|
1138
|
+
: chunks.set(id, new ReactPromise("fulfilled", stream, controller));
|
1141
1139
|
}
|
1142
1140
|
function startReadableStream(response, id, type) {
|
1143
1141
|
var controller = null;
|
@@ -1158,7 +1156,7 @@ module.exports = function ($$$config) {
|
|
1158
1156
|
},
|
1159
1157
|
enqueueModel: function (json) {
|
1160
1158
|
if (null === previousBlockedChunk) {
|
1161
|
-
var chunk = new ReactPromise("resolved_model", json,
|
1159
|
+
var chunk = new ReactPromise("resolved_model", json, response);
|
1162
1160
|
initializeModelChunk(chunk);
|
1163
1161
|
"fulfilled" === chunk.status
|
1164
1162
|
? controller.enqueue(chunk.value)
|
@@ -1173,8 +1171,8 @@ module.exports = function ($$$config) {
|
|
1173
1171
|
(previousBlockedChunk = chunk));
|
1174
1172
|
} else {
|
1175
1173
|
chunk = previousBlockedChunk;
|
1176
|
-
var chunk$
|
1177
|
-
chunk$
|
1174
|
+
var chunk$30 = new ReactPromise("pending", null, null);
|
1175
|
+
chunk$30.then(
|
1178
1176
|
function (v) {
|
1179
1177
|
return controller.enqueue(v);
|
1180
1178
|
},
|
@@ -1182,10 +1180,10 @@ module.exports = function ($$$config) {
|
|
1182
1180
|
return controller.error(e);
|
1183
1181
|
}
|
1184
1182
|
);
|
1185
|
-
previousBlockedChunk = chunk$
|
1183
|
+
previousBlockedChunk = chunk$30;
|
1186
1184
|
chunk.then(function () {
|
1187
|
-
previousBlockedChunk === chunk$
|
1188
|
-
resolveModelChunk(chunk$
|
1185
|
+
previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
|
1186
|
+
resolveModelChunk(response, chunk$30, json);
|
1189
1187
|
});
|
1190
1188
|
}
|
1191
1189
|
},
|
@@ -1223,38 +1221,34 @@ module.exports = function ($$$config) {
|
|
1223
1221
|
var buffer = [],
|
1224
1222
|
closed = !1,
|
1225
1223
|
nextWriteIndex = 0,
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
if (
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
});
|
1244
|
-
}),
|
1245
|
-
$jscomp$compprop0);
|
1224
|
+
iterable = {};
|
1225
|
+
iterable[ASYNC_ITERATOR] = function () {
|
1226
|
+
var nextReadIndex = 0;
|
1227
|
+
return createIterator(function (arg) {
|
1228
|
+
if (void 0 !== arg) throw Error(formatProdErrorMessage(524));
|
1229
|
+
if (nextReadIndex === buffer.length) {
|
1230
|
+
if (closed)
|
1231
|
+
return new ReactPromise(
|
1232
|
+
"fulfilled",
|
1233
|
+
{ done: !0, value: void 0 },
|
1234
|
+
null
|
1235
|
+
);
|
1236
|
+
buffer[nextReadIndex] = new ReactPromise("pending", null, null);
|
1237
|
+
}
|
1238
|
+
return buffer[nextReadIndex++];
|
1239
|
+
});
|
1240
|
+
};
|
1246
1241
|
resolveStream(
|
1247
1242
|
response,
|
1248
1243
|
id,
|
1249
|
-
iterator ?
|
1244
|
+
iterator ? iterable[ASYNC_ITERATOR]() : iterable,
|
1250
1245
|
{
|
1251
1246
|
enqueueValue: function (value) {
|
1252
1247
|
if (nextWriteIndex === buffer.length)
|
1253
1248
|
buffer[nextWriteIndex] = new ReactPromise(
|
1254
1249
|
"fulfilled",
|
1255
1250
|
{ done: !1, value: value },
|
1256
|
-
null
|
1257
|
-
response
|
1251
|
+
null
|
1258
1252
|
);
|
1259
1253
|
else {
|
1260
1254
|
var chunk = buffer[nextWriteIndex],
|
@@ -1274,7 +1268,12 @@ module.exports = function ($$$config) {
|
|
1274
1268
|
value,
|
1275
1269
|
!1
|
1276
1270
|
))
|
1277
|
-
: resolveIteratorResultChunk(
|
1271
|
+
: resolveIteratorResultChunk(
|
1272
|
+
response,
|
1273
|
+
buffer[nextWriteIndex],
|
1274
|
+
value,
|
1275
|
+
!1
|
1276
|
+
);
|
1278
1277
|
nextWriteIndex++;
|
1279
1278
|
},
|
1280
1279
|
close: function (value) {
|
@@ -1285,9 +1284,15 @@ module.exports = function ($$$config) {
|
|
1285
1284
|
value,
|
1286
1285
|
!0
|
1287
1286
|
))
|
1288
|
-
: resolveIteratorResultChunk(
|
1287
|
+
: resolveIteratorResultChunk(
|
1288
|
+
response,
|
1289
|
+
buffer[nextWriteIndex],
|
1290
|
+
value,
|
1291
|
+
!0
|
1292
|
+
);
|
1289
1293
|
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
1290
1294
|
resolveIteratorResultChunk(
|
1295
|
+
response,
|
1291
1296
|
buffer[nextWriteIndex++],
|
1292
1297
|
'"$undefined"',
|
1293
1298
|
!0
|
@@ -1297,7 +1302,7 @@ module.exports = function ($$$config) {
|
|
1297
1302
|
closed = !0;
|
1298
1303
|
for (
|
1299
1304
|
nextWriteIndex === buffer.length &&
|
1300
|
-
(buffer[nextWriteIndex] =
|
1305
|
+
(buffer[nextWriteIndex] = new ReactPromise("pending", null, null));
|
1301
1306
|
nextWriteIndex < buffer.length;
|
1302
1307
|
|
1303
1308
|
)
|
@@ -1319,8 +1324,8 @@ module.exports = function ($$$config) {
|
|
1319
1324
|
)
|
1320
1325
|
byteLength += buffer[i].byteLength;
|
1321
1326
|
byteLength = new Uint8Array(byteLength);
|
1322
|
-
for (var i$
|
1323
|
-
var chunk = buffer[i$
|
1327
|
+
for (var i$31 = (i = 0); i$31 < l; i$31++) {
|
1328
|
+
var chunk = buffer[i$31];
|
1324
1329
|
byteLength.set(chunk, i);
|
1325
1330
|
i += chunk.byteLength;
|
1326
1331
|
}
|
@@ -1423,10 +1428,10 @@ module.exports = function ($$$config) {
|
|
1423
1428
|
: tag.set(id, createErrorChunk(response, row));
|
1424
1429
|
break;
|
1425
1430
|
case 84:
|
1426
|
-
|
1427
|
-
(
|
1428
|
-
?
|
1429
|
-
:
|
1431
|
+
response = response._chunks;
|
1432
|
+
(tag = response.get(id)) && "pending" !== tag.status
|
1433
|
+
? tag.reason.enqueueValue(row)
|
1434
|
+
: response.set(id, new ReactPromise("fulfilled", row, null));
|
1430
1435
|
break;
|
1431
1436
|
case 78:
|
1432
1437
|
case 68:
|
@@ -1462,11 +1467,8 @@ module.exports = function ($$$config) {
|
|
1462
1467
|
default:
|
1463
1468
|
(tag = response._chunks),
|
1464
1469
|
(chunk = tag.get(id))
|
1465
|
-
? resolveModelChunk(chunk, row)
|
1466
|
-
: tag.set(
|
1467
|
-
id,
|
1468
|
-
new ReactPromise("resolved_model", row, null, response)
|
1469
|
-
);
|
1470
|
+
? resolveModelChunk(response, chunk, row)
|
1471
|
+
: tag.set(id, new ReactPromise("resolved_model", row, response));
|
1470
1472
|
}
|
1471
1473
|
}
|
1472
1474
|
function createFromJSONCallback(response) {
|
@@ -1493,12 +1495,7 @@ module.exports = function ($$$config) {
|
|
1493
1495
|
(key = createErrorChunk(response, value.value)),
|
1494
1496
|
(key = createLazyChunkWrapper(key));
|
1495
1497
|
else if (0 < value.deps) {
|
1496
|
-
var blockedChunk = new ReactPromise(
|
1497
|
-
"blocked",
|
1498
|
-
null,
|
1499
|
-
null,
|
1500
|
-
response
|
1501
|
-
);
|
1498
|
+
var blockedChunk = new ReactPromise("blocked", null, null);
|
1502
1499
|
value.value = key;
|
1503
1500
|
value.chunk = blockedChunk;
|
1504
1501
|
key = createLazyChunkWrapper(blockedChunk);
|
@@ -1565,6 +1562,8 @@ module.exports = function ($$$config) {
|
|
1565
1562
|
(null === this.reason && (this.reason = []),
|
1566
1563
|
this.reason.push(reject));
|
1567
1564
|
break;
|
1565
|
+
case "halted":
|
1566
|
+
break;
|
1568
1567
|
default:
|
1569
1568
|
reject && reject(this.reason);
|
1570
1569
|
}
|
@@ -1601,7 +1600,7 @@ module.exports = function ($$$config) {
|
|
1601
1600
|
version: rendererVersion,
|
1602
1601
|
rendererPackageName: rendererPackageName,
|
1603
1602
|
currentDispatcherRef: ReactSharedInternals,
|
1604
|
-
reconcilerVersion: "19.2.0-experimental-
|
1603
|
+
reconcilerVersion: "19.2.0-experimental-12eaef7e-20250623",
|
1605
1604
|
getCurrentComponentInfo: getCurrentOwnerInDEV
|
1606
1605
|
};
|
1607
1606
|
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@matthamlin/react-client",
|
3
3
|
"description": "React package for consuming streaming models.",
|
4
|
-
"version": "0.0.0-experimental-
|
4
|
+
"version": "0.0.0-experimental-12eaef7e-20250623",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -23,6 +23,6 @@
|
|
23
23
|
"node": ">=0.10.0"
|
24
24
|
},
|
25
25
|
"peerDependencies": {
|
26
|
-
"react": "0.0.0-experimental-
|
26
|
+
"react": "0.0.0-experimental-12eaef7e-20250623"
|
27
27
|
}
|
28
28
|
}
|