react-router 7.13.2 → 7.14.0-pre.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +75 -24
  2. package/dist/development/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
  3. package/dist/development/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
  4. package/dist/development/{chunk-UVKPFVEO.mjs → chunk-47HDNIOI.mjs} +192 -119
  5. package/dist/development/{chunk-UALY5CBT.mjs → chunk-D73YQQSY.mjs} +21 -7
  6. package/dist/development/{chunk-GO74ODU3.js → chunk-GE4J47XT.js} +191 -118
  7. package/dist/{production/chunk-XAAX7KIK.js → development/chunk-KLEV7K4H.js} +99 -99
  8. package/dist/development/{chunk-LLP6DRWX.js → chunk-MA52INJ5.js} +7 -7
  9. package/dist/development/dom-export.d.mts +1 -1
  10. package/dist/development/dom-export.d.ts +1 -1
  11. package/dist/development/dom-export.js +65 -54
  12. package/dist/development/dom-export.mjs +34 -23
  13. package/dist/{production/index-react-server-client-BcrVT7Dd.d.mts → development/index-react-server-client-BwWaHAr3.d.mts} +7 -5
  14. package/dist/development/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
  15. package/dist/development/index-react-server-client.d.mts +1 -1
  16. package/dist/development/index-react-server-client.d.ts +1 -1
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +12 -3
  20. package/dist/development/index-react-server.d.ts +12 -3
  21. package/dist/development/index-react-server.js +58 -18
  22. package/dist/development/index-react-server.mjs +58 -18
  23. package/dist/development/index.d.mts +4 -4
  24. package/dist/development/index.d.ts +4 -4
  25. package/dist/development/index.js +101 -87
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/development/lib/types/internal.d.mts +10 -10
  28. package/dist/development/lib/types/internal.d.ts +10 -10
  29. package/dist/development/lib/types/internal.js +1 -1
  30. package/dist/development/lib/types/internal.mjs +1 -1
  31. package/dist/production/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
  32. package/dist/production/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
  33. package/dist/production/{chunk-CAFVLUDY.js → chunk-G3YAUWGC.js} +7 -7
  34. package/dist/production/{chunk-2BDJPJTA.mjs → chunk-MQKMC5YB.mjs} +192 -119
  35. package/dist/production/{chunk-LKUVSIBA.js → chunk-OBXCYSYK.js} +191 -118
  36. package/dist/{development/chunk-HPFFRPKK.js → production/chunk-QIHLB25G.js} +99 -99
  37. package/dist/production/{chunk-PY35PE22.mjs → chunk-XM7AQRW7.mjs} +21 -7
  38. package/dist/production/dom-export.d.mts +1 -1
  39. package/dist/production/dom-export.d.ts +1 -1
  40. package/dist/production/dom-export.js +65 -54
  41. package/dist/production/dom-export.mjs +34 -23
  42. package/dist/{development/index-react-server-client-BcrVT7Dd.d.mts → production/index-react-server-client-BwWaHAr3.d.mts} +7 -5
  43. package/dist/production/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
  44. package/dist/production/index-react-server-client.d.mts +1 -1
  45. package/dist/production/index-react-server-client.d.ts +1 -1
  46. package/dist/production/index-react-server-client.js +4 -4
  47. package/dist/production/index-react-server-client.mjs +2 -2
  48. package/dist/production/index-react-server.d.mts +12 -3
  49. package/dist/production/index-react-server.d.ts +12 -3
  50. package/dist/production/index-react-server.js +58 -18
  51. package/dist/production/index-react-server.mjs +58 -18
  52. package/dist/production/index.d.mts +4 -4
  53. package/dist/production/index.d.ts +4 -4
  54. package/dist/production/index.js +101 -87
  55. package/dist/production/index.mjs +3 -3
  56. package/dist/production/lib/types/internal.d.mts +10 -10
  57. package/dist/production/lib/types/internal.d.ts +10 -10
  58. package/dist/production/lib/types/internal.js +1 -1
  59. package/dist/production/lib/types/internal.mjs +1 -1
  60. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.13.2
2
+ * react-router v7.14.0-pre.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
- function flatten(input) {
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
- stringify.call(this, input, index);
7199
+ const stack = [[input, index]];
7200
+ await stringify.call(this, stack);
7197
7201
  return index;
7198
7202
  }
7199
- function stringify(input, index) {
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
- const stack = [[input, index]];
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 [input2, index2] = stack.pop();
7205
- const partsForObj = (obj) => Object.keys(obj).map((k) => `"_${flatten.call(this, k)}":${flatten.call(this, obj[k])}`).join(",");
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 input2) {
7231
+ switch (typeof input) {
7208
7232
  case "boolean":
7209
7233
  case "number":
7210
7234
  case "string":
7211
- str[index2] = JSON.stringify(input2);
7235
+ str[index] = JSON.stringify(input);
7212
7236
  break;
7213
7237
  case "bigint":
7214
- str[index2] = `["${TYPE_BIGINT}","${input2}"]`;
7238
+ str[index] = `["${TYPE_BIGINT}","${input}"]`;
7215
7239
  break;
7216
7240
  case "symbol": {
7217
- const keyFor = Symbol.keyFor(input2);
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[index2] = `["${TYPE_SYMBOL}",${JSON.stringify(keyFor)}]`;
7247
+ str[index] = `["${TYPE_SYMBOL}",${JSON.stringify(keyFor)}]`;
7224
7248
  }
7225
7249
  break;
7226
7250
  }
7227
7251
  case "object": {
7228
- if (!input2) {
7229
- str[index2] = `${NULL}`;
7252
+ if (!input) {
7253
+ str[index] = `${NULL}`;
7230
7254
  break;
7231
7255
  }
7232
- const isArray = Array.isArray(input2);
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(input2);
7260
+ const pluginResult = plugin(input);
7237
7261
  if (Array.isArray(pluginResult)) {
7238
7262
  pluginHandled = true;
7239
7263
  const [pluginIdentifier, ...rest] = pluginResult;
7240
- str[index2] = `[${JSON.stringify(pluginIdentifier)}`;
7264
+ str[index] = `[${JSON.stringify(pluginIdentifier)}`;
7241
7265
  if (rest.length > 0) {
7242
- str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(",")}`;
7266
+ str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
7243
7267
  }
7244
- str[index2] += "]";
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 i = 0; i < input2.length; i++)
7253
- result += (i ? "," : "") + (i in input2 ? flatten.call(this, input2[i]) : HOLE);
7254
- str[index2] = `${result}]`;
7255
- } else if (input2 instanceof Date) {
7256
- const dateTime = input2.getTime();
7257
- str[index2] = `["${TYPE_DATE}",${Number.isNaN(dateTime) ? JSON.stringify("invalid") : dateTime}]`;
7258
- } else if (input2 instanceof URL) {
7259
- str[index2] = `["${TYPE_URL}",${JSON.stringify(input2.href)}]`;
7260
- } else if (input2 instanceof RegExp) {
7261
- str[index2] = `["${TYPE_REGEXP}",${JSON.stringify(
7262
- input2.source
7263
- )},${JSON.stringify(input2.flags)}]`;
7264
- } else if (input2 instanceof Set) {
7265
- if (input2.size > 0) {
7266
- str[index2] = `["${TYPE_SET}",${[...input2].map((val) => flatten.call(this, val)).join(",")}]`;
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[index2] = `["${TYPE_SET}"]`;
7292
+ str[index] = `["${TYPE_SET}"]`;
7269
7293
  }
7270
- } else if (input2 instanceof Map) {
7271
- if (input2.size > 0) {
7272
- str[index2] = `["${TYPE_MAP}",${[...input2].flatMap(([k, v]) => [
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[index2] = `["${TYPE_MAP}"]`;
7298
+ str[index] = `["${TYPE_MAP}"]`;
7278
7299
  }
7279
- } else if (input2 instanceof Promise) {
7280
- str[index2] = `["${TYPE_PROMISE}",${index2}]`;
7281
- deferred[index2] = input2;
7282
- } else if (input2 instanceof Error) {
7283
- str[index2] = `["${TYPE_ERROR}",${JSON.stringify(input2.message)}`;
7284
- if (input2.name !== "Error") {
7285
- str[index2] += `,${JSON.stringify(input2.name)}`;
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[index2] += "]";
7288
- } else if (Object.getPrototypeOf(input2) === null) {
7289
- str[index2] = `["${TYPE_NULL_OBJECT}",{${partsForObj(input2)}}]`;
7290
- } else if (isPlainObject2(input2)) {
7291
- str[index2] = `{${partsForObj(input2)}}`;
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(input2);
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(input2);
7324
+ const pluginResult = plugin(input);
7304
7325
  if (Array.isArray(pluginResult)) {
7305
7326
  pluginHandled = true;
7306
7327
  const [pluginIdentifier, ...rest] = pluginResult;
7307
- str[index2] = `[${JSON.stringify(pluginIdentifier)}`;
7328
+ str[index] = `[${JSON.stringify(pluginIdentifier)}`;
7308
7329
  if (rest.length > 0) {
7309
- str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(",")}`;
7330
+ str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
7310
7331
  }
7311
- str[index2] += "]";
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(input2);
7346
+ const pluginResult = plugin(input);
7326
7347
  if (Array.isArray(pluginResult)) {
7327
7348
  pluginHandled = true;
7328
7349
  const [pluginIdentifier, ...rest] = pluginResult;
7329
- str[index2] = `[${JSON.stringify(pluginIdentifier)}`;
7350
+ str[index] = `[${JSON.stringify(pluginIdentifier)}`;
7330
7351
  if (rest.length > 0) {
7331
- str[index2] += `,${rest.map((v) => flatten.call(this, v)).join(",")}`;
7352
+ str[index] += `,${rest.map((v) => flattenValue(v)).join(",")}`;
7332
7353
  }
7333
- str[index2] += "]";
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, onComplete } = options ?? {};
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
- const id2 = flatten.call(encoder, resolved);
7727
- if (Array.isArray(id2)) {
7728
- controller.enqueue(
7729
- textEncoder.encode(
7730
- `${TYPE_PROMISE}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
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
- encoder.index++;
7735
- lastSentIndex++;
7736
- } else if (id2 < 0) {
7737
- controller.enqueue(
7738
- textEncoder.encode(
7739
- `${TYPE_PROMISE}${deferredId}:${id2}
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
- } else {
7744
- const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
7745
- controller.enqueue(
7746
- textEncoder.encode(
7747
- `${TYPE_PROMISE}${deferredId}:[${values}]
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
- lastSentIndex = encoder.stringified.length - 1;
7752
- }
7772
+ )
7773
+ );
7774
+ lastSentIndex = encoder.stringified.length - 1;
7775
+ }
7776
+ });
7777
+ return processingChain;
7753
7778
  },
7754
7779
  (reason) => {
7755
- if (!reason || typeof reason !== "object" || !(reason instanceof Error)) {
7756
- reason = new Error("An unknown error occurred");
7757
- }
7758
- const id2 = flatten.call(encoder, reason);
7759
- if (Array.isArray(id2)) {
7760
- controller.enqueue(
7761
- textEncoder.encode(
7762
- `${TYPE_ERROR}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
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
- encoder.index++;
7767
- lastSentIndex++;
7768
- } else if (id2 < 0) {
7769
- controller.enqueue(
7770
- textEncoder.encode(
7771
- `${TYPE_ERROR}${deferredId}:${id2}
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
- } else {
7776
- const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
7777
- controller.enqueue(
7778
- textEncoder.encode(
7779
- `${TYPE_ERROR}${deferredId}:[${values}]
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
- lastSentIndex = encoder.stringified.length - 1;
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
- onComplete?.();
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.13.2";
9973
+ "7.14.0-pre.0";
9901
9974
  }
9902
9975
  } catch (e) {
9903
9976
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.13.2
2
+ * react-router v7.14.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -51,7 +51,7 @@ import {
51
51
  withComponentProps,
52
52
  withErrorBoundaryProps,
53
53
  withHydrateFallbackProps
54
- } from "./chunk-UVKPFVEO.mjs";
54
+ } from "./chunk-47HDNIOI.mjs";
55
55
 
56
56
  // lib/dom/ssr/server.tsx
57
57
  import * as React from "react";
@@ -1096,14 +1096,24 @@ function getSingleFetchRedirect(status, headers, basename) {
1096
1096
  function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
1097
1097
  let controller = new AbortController();
1098
1098
  let timeoutId = setTimeout(
1099
- () => controller.abort(new Error("Server Timeout")),
1099
+ () => {
1100
+ controller.abort(new Error("Server Timeout"));
1101
+ cleanupCallbacks();
1102
+ },
1100
1103
  typeof streamTimeout === "number" ? streamTimeout : 4950
1101
1104
  );
1102
- let clearStreamTimeout = () => clearTimeout(timeoutId);
1103
- requestSignal.addEventListener("abort", clearStreamTimeout);
1105
+ let abortControllerOnRequestAbort = () => {
1106
+ controller.abort(requestSignal.reason);
1107
+ cleanupCallbacks();
1108
+ };
1109
+ requestSignal.addEventListener("abort", abortControllerOnRequestAbort);
1110
+ let cleanupCallbacks = () => {
1111
+ clearTimeout(timeoutId);
1112
+ requestSignal.removeEventListener("abort", abortControllerOnRequestAbort);
1113
+ };
1104
1114
  return encode(data2, {
1105
1115
  signal: controller.signal,
1106
- onComplete: clearStreamTimeout,
1116
+ onComplete: cleanupCallbacks,
1107
1117
  plugins: [
1108
1118
  (value) => {
1109
1119
  if (value instanceof Error) {
@@ -2057,6 +2067,7 @@ function populateRSCRouteModules(routeModules, matches) {
2057
2067
  var noopComponent = () => null;
2058
2068
 
2059
2069
  // lib/rsc/server.ssr.tsx
2070
+ var defaultManifestPath = "/__manifest";
2060
2071
  var REACT_USE = "use";
2061
2072
  var useImpl = React4[REACT_USE];
2062
2073
  function useSafe(promise) {
@@ -2437,7 +2448,10 @@ function RSCStaticRouter({ getPayload }) {
2437
2448
  imports: []
2438
2449
  }
2439
2450
  },
2440
- routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
2451
+ routeDiscovery: payload.routeDiscovery.mode === "initial" ? { mode: "initial", manifestPath: defaultManifestPath } : {
2452
+ mode: "lazy",
2453
+ manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath
2454
+ },
2441
2455
  routeModules: createRSCRouteModules(payload)
2442
2456
  };
2443
2457
  return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(