react-router 7.13.2 → 7.14.0
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.
- package/CHANGELOG.md +67 -0
- package/dist/development/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
- package/dist/development/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
- package/dist/development/{chunk-UALY5CBT.mjs → chunk-2UH5WJXA.mjs} +21 -7
- package/dist/development/{chunk-GO74ODU3.js → chunk-IK6APEEG.js} +191 -118
- package/dist/development/{chunk-HPFFRPKK.js → chunk-NXTEWSJO.js} +99 -99
- package/dist/development/{chunk-UVKPFVEO.mjs → chunk-QFMPRPBF.mjs} +192 -119
- package/dist/development/{chunk-LLP6DRWX.js → chunk-WAVMRYR2.js} +7 -7
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.d.ts +1 -1
- package/dist/development/dom-export.js +65 -54
- package/dist/development/dom-export.mjs +34 -23
- package/dist/{production/index-react-server-client-BcrVT7Dd.d.mts → development/index-react-server-client-BwWaHAr3.d.mts} +7 -5
- package/dist/development/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
- package/dist/development/index-react-server-client.d.mts +1 -1
- package/dist/development/index-react-server-client.d.ts +1 -1
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +12 -3
- package/dist/development/index-react-server.d.ts +12 -3
- package/dist/development/index-react-server.js +58 -18
- package/dist/development/index-react-server.mjs +58 -18
- package/dist/development/index.d.mts +4 -4
- package/dist/development/index.d.ts +4 -4
- package/dist/development/index.js +101 -87
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +10 -10
- package/dist/development/lib/types/internal.d.ts +10 -10
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
- package/dist/production/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
- package/dist/production/{chunk-CAFVLUDY.js → chunk-355DUZMC.js} +7 -7
- package/dist/production/{chunk-LKUVSIBA.js → chunk-4TJ7T2OQ.js} +191 -118
- package/dist/production/{chunk-XAAX7KIK.js → chunk-FPT5DLVJ.js} +99 -99
- package/dist/production/{chunk-2BDJPJTA.mjs → chunk-HZQGQD2X.mjs} +192 -119
- package/dist/production/{chunk-PY35PE22.mjs → chunk-X5LK27NZ.mjs} +21 -7
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.d.ts +1 -1
- package/dist/production/dom-export.js +65 -54
- package/dist/production/dom-export.mjs +34 -23
- package/dist/{development/index-react-server-client-BcrVT7Dd.d.mts → production/index-react-server-client-BwWaHAr3.d.mts} +7 -5
- package/dist/production/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
- package/dist/production/index-react-server-client.d.mts +1 -1
- package/dist/production/index-react-server-client.d.ts +1 -1
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +12 -3
- package/dist/production/index-react-server.d.ts +12 -3
- package/dist/production/index-react-server.js +58 -18
- package/dist/production/index-react-server.mjs +58 -18
- package/dist/production/index.d.mts +4 -4
- package/dist/production/index.d.ts +4 -4
- package/dist/production/index.js +101 -87
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +10 -10
- package/dist/production/lib/types/internal.d.ts +10 -10
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -7181,7 +7181,10 @@ function createLineSplittingTransform() {
|
|
|
7181
7181
|
}
|
|
7182
7182
|
|
|
7183
7183
|
// vendor/turbo-stream-v2/flatten.ts
|
|
7184
|
-
|
|
7184
|
+
var TIME_LIMIT_MS = 1;
|
|
7185
|
+
var getNow = () => Date.now();
|
|
7186
|
+
var yieldToMain = () => new Promise((resolve) => setTimeout(resolve, 0));
|
|
7187
|
+
async function flatten(input) {
|
|
7185
7188
|
const { indices } = this;
|
|
7186
7189
|
const existing = indices.get(input);
|
|
7187
7190
|
if (existing) return [existing];
|
|
@@ -7193,55 +7196,76 @@ function flatten(input) {
|
|
|
7193
7196
|
if (input === 0 && 1 / input < 0) return NEGATIVE_ZERO;
|
|
7194
7197
|
const index = this.index++;
|
|
7195
7198
|
indices.set(input, index);
|
|
7196
|
-
|
|
7199
|
+
const stack = [[input, index]];
|
|
7200
|
+
await stringify.call(this, stack);
|
|
7197
7201
|
return index;
|
|
7198
7202
|
}
|
|
7199
|
-
function stringify(
|
|
7200
|
-
const { deferred, plugins, postPlugins } = this;
|
|
7203
|
+
async function stringify(stack) {
|
|
7204
|
+
const { deferred, indices, plugins, postPlugins } = this;
|
|
7201
7205
|
const str = this.stringified;
|
|
7202
|
-
|
|
7206
|
+
let lastYieldTime = getNow();
|
|
7207
|
+
const flattenValue = (value) => {
|
|
7208
|
+
const existing = indices.get(value);
|
|
7209
|
+
if (existing) return [existing];
|
|
7210
|
+
if (value === void 0) return UNDEFINED;
|
|
7211
|
+
if (value === null) return NULL;
|
|
7212
|
+
if (Number.isNaN(value)) return NAN;
|
|
7213
|
+
if (value === Number.POSITIVE_INFINITY) return POSITIVE_INFINITY;
|
|
7214
|
+
if (value === Number.NEGATIVE_INFINITY) return NEGATIVE_INFINITY;
|
|
7215
|
+
if (value === 0 && 1 / value < 0) return NEGATIVE_ZERO;
|
|
7216
|
+
const index = this.index++;
|
|
7217
|
+
indices.set(value, index);
|
|
7218
|
+
stack.push([value, index]);
|
|
7219
|
+
return index;
|
|
7220
|
+
};
|
|
7221
|
+
let i = 0;
|
|
7203
7222
|
while (stack.length > 0) {
|
|
7204
|
-
const
|
|
7205
|
-
|
|
7223
|
+
const now = getNow();
|
|
7224
|
+
if (++i % 6e3 === 0 && now - lastYieldTime >= TIME_LIMIT_MS) {
|
|
7225
|
+
await yieldToMain();
|
|
7226
|
+
lastYieldTime = getNow();
|
|
7227
|
+
}
|
|
7228
|
+
const [input, index] = stack.pop();
|
|
7229
|
+
const partsForObj = (obj) => Object.keys(obj).map((k) => `"_${flattenValue(k)}":${flattenValue(obj[k])}`).join(",");
|
|
7206
7230
|
let error = null;
|
|
7207
|
-
switch (typeof
|
|
7231
|
+
switch (typeof input) {
|
|
7208
7232
|
case "boolean":
|
|
7209
7233
|
case "number":
|
|
7210
7234
|
case "string":
|
|
7211
|
-
str[
|
|
7235
|
+
str[index] = JSON.stringify(input);
|
|
7212
7236
|
break;
|
|
7213
7237
|
case "bigint":
|
|
7214
|
-
str[
|
|
7238
|
+
str[index] = `["${TYPE_BIGINT}","${input}"]`;
|
|
7215
7239
|
break;
|
|
7216
7240
|
case "symbol": {
|
|
7217
|
-
const keyFor = Symbol.keyFor(
|
|
7241
|
+
const keyFor = Symbol.keyFor(input);
|
|
7218
7242
|
if (!keyFor) {
|
|
7219
7243
|
error = new Error(
|
|
7220
7244
|
"Cannot encode symbol unless created with Symbol.for()"
|
|
7221
7245
|
);
|
|
7222
7246
|
} else {
|
|
7223
|
-
str[
|
|
7247
|
+
str[index] = `["${TYPE_SYMBOL}",${JSON.stringify(keyFor)}]`;
|
|
7224
7248
|
}
|
|
7225
7249
|
break;
|
|
7226
7250
|
}
|
|
7227
7251
|
case "object": {
|
|
7228
|
-
if (!
|
|
7229
|
-
str[
|
|
7252
|
+
if (!input) {
|
|
7253
|
+
str[index] = `${NULL}`;
|
|
7230
7254
|
break;
|
|
7231
7255
|
}
|
|
7232
|
-
const isArray = Array.isArray(
|
|
7256
|
+
const isArray = Array.isArray(input);
|
|
7233
7257
|
let pluginHandled = false;
|
|
7234
7258
|
if (!isArray && plugins) {
|
|
7235
7259
|
for (const plugin of plugins) {
|
|
7236
|
-
const pluginResult = plugin(
|
|
7260
|
+
const pluginResult = plugin(input);
|
|
7237
7261
|
if (Array.isArray(pluginResult)) {
|
|
7238
7262
|
pluginHandled = true;
|
|
7239
7263
|
const [pluginIdentifier, ...rest] = pluginResult;
|
|
7240
|
-
str[
|
|
7264
|
+
str[index] = `[${JSON.stringify(pluginIdentifier)}`;
|
|
7241
7265
|
if (rest.length > 0) {
|
|
7242
|
-
str[
|
|
7266
|
+
str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
|
|
7243
7267
|
}
|
|
7244
|
-
str[
|
|
7268
|
+
str[index] += "]";
|
|
7245
7269
|
break;
|
|
7246
7270
|
}
|
|
7247
7271
|
}
|
|
@@ -7249,46 +7273,43 @@ function stringify(input, index) {
|
|
|
7249
7273
|
if (!pluginHandled) {
|
|
7250
7274
|
let result = isArray ? "[" : "{";
|
|
7251
7275
|
if (isArray) {
|
|
7252
|
-
for (let
|
|
7253
|
-
result += (
|
|
7254
|
-
str[
|
|
7255
|
-
} else if (
|
|
7256
|
-
const dateTime =
|
|
7257
|
-
str[
|
|
7258
|
-
} else if (
|
|
7259
|
-
str[
|
|
7260
|
-
} else if (
|
|
7261
|
-
str[
|
|
7262
|
-
|
|
7263
|
-
)},${JSON.stringify(
|
|
7264
|
-
} else if (
|
|
7265
|
-
if (
|
|
7266
|
-
str[
|
|
7276
|
+
for (let i2 = 0; i2 < input.length; i2++)
|
|
7277
|
+
result += (i2 ? "," : "") + (i2 in input ? flattenValue(input[i2]) : HOLE);
|
|
7278
|
+
str[index] = `${result}]`;
|
|
7279
|
+
} else if (input instanceof Date) {
|
|
7280
|
+
const dateTime = input.getTime();
|
|
7281
|
+
str[index] = `["${TYPE_DATE}",${Number.isNaN(dateTime) ? JSON.stringify("invalid") : dateTime}]`;
|
|
7282
|
+
} else if (input instanceof URL) {
|
|
7283
|
+
str[index] = `["${TYPE_URL}",${JSON.stringify(input.href)}]`;
|
|
7284
|
+
} else if (input instanceof RegExp) {
|
|
7285
|
+
str[index] = `["${TYPE_REGEXP}",${JSON.stringify(
|
|
7286
|
+
input.source
|
|
7287
|
+
)},${JSON.stringify(input.flags)}]`;
|
|
7288
|
+
} else if (input instanceof Set) {
|
|
7289
|
+
if (input.size > 0) {
|
|
7290
|
+
str[index] = `["${TYPE_SET}",${[...input].map((val) => flattenValue(val)).join(",")}]`;
|
|
7267
7291
|
} else {
|
|
7268
|
-
str[
|
|
7292
|
+
str[index] = `["${TYPE_SET}"]`;
|
|
7269
7293
|
}
|
|
7270
|
-
} else if (
|
|
7271
|
-
if (
|
|
7272
|
-
str[
|
|
7273
|
-
flatten.call(this, k),
|
|
7274
|
-
flatten.call(this, v)
|
|
7275
|
-
]).join(",")}]`;
|
|
7294
|
+
} else if (input instanceof Map) {
|
|
7295
|
+
if (input.size > 0) {
|
|
7296
|
+
str[index] = `["${TYPE_MAP}",${[...input].flatMap(([k, v]) => [flattenValue(k), flattenValue(v)]).join(",")}]`;
|
|
7276
7297
|
} else {
|
|
7277
|
-
str[
|
|
7298
|
+
str[index] = `["${TYPE_MAP}"]`;
|
|
7278
7299
|
}
|
|
7279
|
-
} else if (
|
|
7280
|
-
str[
|
|
7281
|
-
deferred[
|
|
7282
|
-
} else if (
|
|
7283
|
-
str[
|
|
7284
|
-
if (
|
|
7285
|
-
str[
|
|
7300
|
+
} else if (input instanceof Promise) {
|
|
7301
|
+
str[index] = `["${TYPE_PROMISE}",${index}]`;
|
|
7302
|
+
deferred[index] = input;
|
|
7303
|
+
} else if (input instanceof Error) {
|
|
7304
|
+
str[index] = `["${TYPE_ERROR}",${JSON.stringify(input.message)}`;
|
|
7305
|
+
if (input.name !== "Error") {
|
|
7306
|
+
str[index] += `,${JSON.stringify(input.name)}`;
|
|
7286
7307
|
}
|
|
7287
|
-
str[
|
|
7288
|
-
} else if (Object.getPrototypeOf(
|
|
7289
|
-
str[
|
|
7290
|
-
} else if (isPlainObject2(
|
|
7291
|
-
str[
|
|
7308
|
+
str[index] += "]";
|
|
7309
|
+
} else if (Object.getPrototypeOf(input) === null) {
|
|
7310
|
+
str[index] = `["${TYPE_NULL_OBJECT}",{${partsForObj(input)}}]`;
|
|
7311
|
+
} else if (isPlainObject2(input)) {
|
|
7312
|
+
str[index] = `{${partsForObj(input)}}`;
|
|
7292
7313
|
} else {
|
|
7293
7314
|
error = new Error("Cannot encode object with prototype");
|
|
7294
7315
|
}
|
|
@@ -7296,19 +7317,19 @@ function stringify(input, index) {
|
|
|
7296
7317
|
break;
|
|
7297
7318
|
}
|
|
7298
7319
|
default: {
|
|
7299
|
-
const isArray = Array.isArray(
|
|
7320
|
+
const isArray = Array.isArray(input);
|
|
7300
7321
|
let pluginHandled = false;
|
|
7301
7322
|
if (!isArray && plugins) {
|
|
7302
7323
|
for (const plugin of plugins) {
|
|
7303
|
-
const pluginResult = plugin(
|
|
7324
|
+
const pluginResult = plugin(input);
|
|
7304
7325
|
if (Array.isArray(pluginResult)) {
|
|
7305
7326
|
pluginHandled = true;
|
|
7306
7327
|
const [pluginIdentifier, ...rest] = pluginResult;
|
|
7307
|
-
str[
|
|
7328
|
+
str[index] = `[${JSON.stringify(pluginIdentifier)}`;
|
|
7308
7329
|
if (rest.length > 0) {
|
|
7309
|
-
str[
|
|
7330
|
+
str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
|
|
7310
7331
|
}
|
|
7311
|
-
str[
|
|
7332
|
+
str[index] += "]";
|
|
7312
7333
|
break;
|
|
7313
7334
|
}
|
|
7314
7335
|
}
|
|
@@ -7322,15 +7343,15 @@ function stringify(input, index) {
|
|
|
7322
7343
|
let pluginHandled = false;
|
|
7323
7344
|
if (postPlugins) {
|
|
7324
7345
|
for (const plugin of postPlugins) {
|
|
7325
|
-
const pluginResult = plugin(
|
|
7346
|
+
const pluginResult = plugin(input);
|
|
7326
7347
|
if (Array.isArray(pluginResult)) {
|
|
7327
7348
|
pluginHandled = true;
|
|
7328
7349
|
const [pluginIdentifier, ...rest] = pluginResult;
|
|
7329
|
-
str[
|
|
7350
|
+
str[index] = `[${JSON.stringify(pluginIdentifier)}`;
|
|
7330
7351
|
if (rest.length > 0) {
|
|
7331
|
-
str[
|
|
7352
|
+
str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
|
|
7332
7353
|
}
|
|
7333
|
-
str[
|
|
7354
|
+
str[index] += "]";
|
|
7334
7355
|
break;
|
|
7335
7356
|
}
|
|
7336
7357
|
}
|
|
@@ -7667,7 +7688,7 @@ async function decodeDeferred(reader) {
|
|
|
7667
7688
|
}
|
|
7668
7689
|
}
|
|
7669
7690
|
function encode(input, options) {
|
|
7670
|
-
const { plugins, postPlugins, signal
|
|
7691
|
+
const { onComplete, plugins, postPlugins, signal } = options ?? {};
|
|
7671
7692
|
const encoder = {
|
|
7672
7693
|
deferred: {},
|
|
7673
7694
|
index: 0,
|
|
@@ -7681,7 +7702,7 @@ function encode(input, options) {
|
|
|
7681
7702
|
let lastSentIndex = 0;
|
|
7682
7703
|
const readable = new ReadableStream({
|
|
7683
7704
|
async start(controller) {
|
|
7684
|
-
const id = flatten.call(encoder, input);
|
|
7705
|
+
const id = await flatten.call(encoder, input);
|
|
7685
7706
|
if (Array.isArray(id)) {
|
|
7686
7707
|
throw new Error("This should never happen");
|
|
7687
7708
|
}
|
|
@@ -7696,6 +7717,7 @@ function encode(input, options) {
|
|
|
7696
7717
|
lastSentIndex = encoder.stringified.length - 1;
|
|
7697
7718
|
}
|
|
7698
7719
|
const seenPromises = /* @__PURE__ */ new WeakSet();
|
|
7720
|
+
let processingChain = Promise.resolve();
|
|
7699
7721
|
if (Object.keys(encoder.deferred).length) {
|
|
7700
7722
|
let raceDone;
|
|
7701
7723
|
const racePromise = new Promise((resolve, reject) => {
|
|
@@ -7723,65 +7745,71 @@ function encode(input, options) {
|
|
|
7723
7745
|
deferred
|
|
7724
7746
|
]).then(
|
|
7725
7747
|
(resolved) => {
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7748
|
+
processingChain = processingChain.then(async () => {
|
|
7749
|
+
const id2 = await flatten.call(encoder, resolved);
|
|
7750
|
+
if (Array.isArray(id2)) {
|
|
7751
|
+
controller.enqueue(
|
|
7752
|
+
textEncoder.encode(
|
|
7753
|
+
`${TYPE_PROMISE}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
7731
7754
|
`
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7755
|
+
)
|
|
7756
|
+
);
|
|
7757
|
+
encoder.index++;
|
|
7758
|
+
lastSentIndex++;
|
|
7759
|
+
} else if (id2 < 0) {
|
|
7760
|
+
controller.enqueue(
|
|
7761
|
+
textEncoder.encode(
|
|
7762
|
+
`${TYPE_PROMISE}${deferredId}:${id2}
|
|
7740
7763
|
`
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7764
|
+
)
|
|
7765
|
+
);
|
|
7766
|
+
} else {
|
|
7767
|
+
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
7768
|
+
controller.enqueue(
|
|
7769
|
+
textEncoder.encode(
|
|
7770
|
+
`${TYPE_PROMISE}${deferredId}:[${values}]
|
|
7748
7771
|
`
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7772
|
+
)
|
|
7773
|
+
);
|
|
7774
|
+
lastSentIndex = encoder.stringified.length - 1;
|
|
7775
|
+
}
|
|
7776
|
+
});
|
|
7777
|
+
return processingChain;
|
|
7753
7778
|
},
|
|
7754
7779
|
(reason) => {
|
|
7755
|
-
|
|
7756
|
-
reason
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7780
|
+
processingChain = processingChain.then(async () => {
|
|
7781
|
+
if (!reason || typeof reason !== "object" || !(reason instanceof Error)) {
|
|
7782
|
+
reason = new Error("An unknown error occurred");
|
|
7783
|
+
}
|
|
7784
|
+
const id2 = await flatten.call(encoder, reason);
|
|
7785
|
+
if (Array.isArray(id2)) {
|
|
7786
|
+
controller.enqueue(
|
|
7787
|
+
textEncoder.encode(
|
|
7788
|
+
`${TYPE_ERROR}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
7763
7789
|
`
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7790
|
+
)
|
|
7791
|
+
);
|
|
7792
|
+
encoder.index++;
|
|
7793
|
+
lastSentIndex++;
|
|
7794
|
+
} else if (id2 < 0) {
|
|
7795
|
+
controller.enqueue(
|
|
7796
|
+
textEncoder.encode(
|
|
7797
|
+
`${TYPE_ERROR}${deferredId}:${id2}
|
|
7772
7798
|
`
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7799
|
+
)
|
|
7800
|
+
);
|
|
7801
|
+
} else {
|
|
7802
|
+
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
7803
|
+
controller.enqueue(
|
|
7804
|
+
textEncoder.encode(
|
|
7805
|
+
`${TYPE_ERROR}${deferredId}:[${values}]
|
|
7780
7806
|
`
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7807
|
+
)
|
|
7808
|
+
);
|
|
7809
|
+
lastSentIndex = encoder.stringified.length - 1;
|
|
7810
|
+
}
|
|
7811
|
+
});
|
|
7812
|
+
return processingChain;
|
|
7785
7813
|
}
|
|
7786
7814
|
).finally(() => {
|
|
7787
7815
|
delete encoder.deferred[Number(deferredId)];
|
|
@@ -7793,8 +7821,9 @@ function encode(input, options) {
|
|
|
7793
7821
|
raceDone();
|
|
7794
7822
|
}
|
|
7795
7823
|
await Promise.all(Object.values(encoder.deferred));
|
|
7796
|
-
|
|
7824
|
+
await processingChain;
|
|
7797
7825
|
controller.close();
|
|
7826
|
+
onComplete?.();
|
|
7798
7827
|
}
|
|
7799
7828
|
});
|
|
7800
7829
|
return readable;
|
|
@@ -9391,6 +9420,7 @@ function Links({ nonce, crossOrigin }) {
|
|
|
9391
9420
|
));
|
|
9392
9421
|
}
|
|
9393
9422
|
function PrefetchPageLinks({ page, ...linkProps }) {
|
|
9423
|
+
let rsc = useIsRSCRouterContext();
|
|
9394
9424
|
let { router } = useDataRouterContext2();
|
|
9395
9425
|
let matches = React8.useMemo(
|
|
9396
9426
|
() => matchRoutes(router.routes, page, router.basename),
|
|
@@ -9399,6 +9429,9 @@ function PrefetchPageLinks({ page, ...linkProps }) {
|
|
|
9399
9429
|
if (!matches) {
|
|
9400
9430
|
return null;
|
|
9401
9431
|
}
|
|
9432
|
+
if (rsc) {
|
|
9433
|
+
return /* @__PURE__ */ React8.createElement(RSCPrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
9434
|
+
}
|
|
9402
9435
|
return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
9403
9436
|
}
|
|
9404
9437
|
function useKeyedPrefetchLinks(matches) {
|
|
@@ -9419,6 +9452,46 @@ function useKeyedPrefetchLinks(matches) {
|
|
|
9419
9452
|
}, [matches, manifest, routeModules]);
|
|
9420
9453
|
return keyedPrefetchLinks;
|
|
9421
9454
|
}
|
|
9455
|
+
function RSCPrefetchPageLinksImpl({
|
|
9456
|
+
page,
|
|
9457
|
+
matches: nextMatches,
|
|
9458
|
+
...linkProps
|
|
9459
|
+
}) {
|
|
9460
|
+
let location = useLocation();
|
|
9461
|
+
let { future } = useFrameworkContext();
|
|
9462
|
+
let { basename } = useDataRouterContext2();
|
|
9463
|
+
let dataHrefs = React8.useMemo(() => {
|
|
9464
|
+
if (page === location.pathname + location.search + location.hash) {
|
|
9465
|
+
return [];
|
|
9466
|
+
}
|
|
9467
|
+
let url = singleFetchUrl(
|
|
9468
|
+
page,
|
|
9469
|
+
basename,
|
|
9470
|
+
future.unstable_trailingSlashAwareDataRequests,
|
|
9471
|
+
"rsc"
|
|
9472
|
+
);
|
|
9473
|
+
let hasSomeRoutesWithShouldRevalidate = false;
|
|
9474
|
+
let targetRoutes = [];
|
|
9475
|
+
for (let match of nextMatches) {
|
|
9476
|
+
if (typeof match.route.shouldRevalidate === "function") {
|
|
9477
|
+
hasSomeRoutesWithShouldRevalidate = true;
|
|
9478
|
+
} else {
|
|
9479
|
+
targetRoutes.push(match.route.id);
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
if (hasSomeRoutesWithShouldRevalidate && targetRoutes.length > 0) {
|
|
9483
|
+
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
9484
|
+
}
|
|
9485
|
+
return [url.pathname + url.search];
|
|
9486
|
+
}, [
|
|
9487
|
+
basename,
|
|
9488
|
+
future.unstable_trailingSlashAwareDataRequests,
|
|
9489
|
+
page,
|
|
9490
|
+
location,
|
|
9491
|
+
nextMatches
|
|
9492
|
+
]);
|
|
9493
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })));
|
|
9494
|
+
}
|
|
9422
9495
|
function PrefetchPageLinksImpl({
|
|
9423
9496
|
page,
|
|
9424
9497
|
matches: nextMatches,
|
|
@@ -9897,7 +9970,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un
|
|
|
9897
9970
|
try {
|
|
9898
9971
|
if (isBrowser2) {
|
|
9899
9972
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9900
|
-
"7.
|
|
9973
|
+
"7.14.0";
|
|
9901
9974
|
}
|
|
9902
9975
|
} catch (e) {
|
|
9903
9976
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkIK6APEEGjs = require('./chunk-IK6APEEG.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunkIK6APEEGjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunkIK6APEEGjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunkIK6APEEGjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunkIK6APEEGjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunkIK6APEEGjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { a as RouterProviderProps$1, R as RouterInit, u as unstable_ClientInstrumentation, C as ClientOnErrorFunction } from './context-phCt_zmH.mjs';
|
|
3
|
-
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-
|
|
3
|
+
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-vtIR1Kpe.mjs';
|
|
4
4
|
import './routeModules-BRrCYrSL.mjs';
|
|
5
5
|
|
|
6
6
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RouterProviderProps as RouterProviderProps$1, RouterInit, ClientOnErrorFunction } from 'react-router';
|
|
3
3
|
import { u as unstable_ClientInstrumentation } from './instrumentation-BYr6ff5D.js';
|
|
4
|
-
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-
|
|
4
|
+
export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-C9Ar1yxG.js';
|
|
5
5
|
import './routeModules-CA7kSxJJ.js';
|
|
6
6
|
|
|
7
7
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|