react-router 0.0.0-experimental-98367e499 → 0.0.0-experimental-bafa092e7

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8796,7 +8796,7 @@ function mergeRefs(...refs) {
8796
8796
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8797
8797
  try {
8798
8798
  if (isBrowser) {
8799
- window.__reactRouterVersion = "0.0.0-experimental-98367e499";
8799
+ window.__reactRouterVersion = "0.0.0-experimental-bafa092e7";
8800
8800
  }
8801
8801
  } catch (e) {
8802
8802
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -26,7 +26,7 @@ import {
26
26
  invariant,
27
27
  mapRouteProperties,
28
28
  useFogOFWarDiscovery
29
- } from "./chunk-5SSRSIGF.mjs";
29
+ } from "./chunk-Q2DCDB5W.mjs";
30
30
 
31
31
  // lib/dom-export/dom-router-provider.tsx
32
32
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8955,7 +8955,7 @@ function mergeRefs(...refs) {
8955
8955
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8956
8956
  try {
8957
8957
  if (isBrowser) {
8958
- window.__reactRouterVersion = "0.0.0-experimental-98367e499";
8958
+ window.__reactRouterVersion = "0.0.0-experimental-bafa092e7";
8959
8959
  }
8960
8960
  } catch (e) {
8961
8961
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -134,7 +134,7 @@ import {
134
134
  withComponentProps,
135
135
  withErrorBoundaryProps,
136
136
  withHydrateFallbackProps
137
- } from "./chunk-5SSRSIGF.mjs";
137
+ } from "./chunk-Q2DCDB5W.mjs";
138
138
  export {
139
139
  Await,
140
140
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
25
25
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
26
 
27
27
  /**
28
- * react-router v0.0.0-experimental-98367e499
28
+ * react-router v0.0.0-experimental-bafa092e7
29
29
  *
30
30
  * Copyright (c) Remix Software Inc.
31
31
  *
@@ -2540,6 +2540,9 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2540
2540
  headers: request.headers,
2541
2541
  signal: request.signal
2542
2542
  });
2543
+ const isFormRequest = canDecodeWithFormData(
2544
+ request.headers.get("Content-Type")
2545
+ );
2543
2546
  const actionId = request.headers.get("rsc-action-id");
2544
2547
  if (actionId) {
2545
2548
  if (!decodeCallServer) {
@@ -2547,7 +2550,7 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2547
2550
  "Cannot handle enhanced server action without a decodeCallServer function"
2548
2551
  );
2549
2552
  }
2550
- const reply = canDecodeWithFormData(request.headers.get("Content-Type")) ? await request.formData() : await request.text();
2553
+ const reply = isFormRequest ? await request.formData() : await request.text();
2551
2554
  const serverAction = await decodeCallServer(actionId, reply);
2552
2555
  let actionResult = Promise.resolve(serverAction());
2553
2556
  try {
@@ -2562,31 +2565,28 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2562
2565
  actionResult,
2563
2566
  revalidationRequest: getRevalidationRequest()
2564
2567
  };
2565
- }
2566
- const clone = request.clone();
2567
- const formData = await request.formData();
2568
- if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2569
- if (!decodeFormAction) {
2570
- throw new Error(
2571
- "Cannot handle form actions without a decodeFormAction function"
2572
- );
2573
- }
2574
- const action = await decodeFormAction(formData);
2575
- try {
2576
- await action();
2577
- } catch (error) {
2578
- if (isResponse(error)) {
2579
- return error;
2568
+ } else if (isFormRequest) {
2569
+ const formData = await request.clone().formData();
2570
+ if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2571
+ if (!decodeFormAction) {
2572
+ throw new Error(
2573
+ "Cannot handle form actions without a decodeFormAction function"
2574
+ );
2580
2575
  }
2581
- onError?.(error);
2576
+ const action = await decodeFormAction(formData);
2577
+ try {
2578
+ await action();
2579
+ } catch (error) {
2580
+ if (isResponse(error)) {
2581
+ return error;
2582
+ }
2583
+ onError?.(error);
2584
+ }
2585
+ return {
2586
+ revalidationRequest: getRevalidationRequest()
2587
+ };
2582
2588
  }
2583
- return {
2584
- revalidationRequest: getRevalidationRequest()
2585
- };
2586
2589
  }
2587
- return {
2588
- revalidationRequest: clone
2589
- };
2590
2590
  }
2591
2591
  async function generateResourceResponse(request, routes, routeId, onError) {
2592
2592
  let result;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { splitCookiesString } from 'set-cookie-parser';
4
4
 
5
5
  /**
6
- * react-router v0.0.0-experimental-98367e499
6
+ * react-router v0.0.0-experimental-bafa092e7
7
7
  *
8
8
  * Copyright (c) Remix Software Inc.
9
9
  *
@@ -2518,6 +2518,9 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2518
2518
  headers: request.headers,
2519
2519
  signal: request.signal
2520
2520
  });
2521
+ const isFormRequest = canDecodeWithFormData(
2522
+ request.headers.get("Content-Type")
2523
+ );
2521
2524
  const actionId = request.headers.get("rsc-action-id");
2522
2525
  if (actionId) {
2523
2526
  if (!decodeCallServer) {
@@ -2525,7 +2528,7 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2525
2528
  "Cannot handle enhanced server action without a decodeCallServer function"
2526
2529
  );
2527
2530
  }
2528
- const reply = canDecodeWithFormData(request.headers.get("Content-Type")) ? await request.formData() : await request.text();
2531
+ const reply = isFormRequest ? await request.formData() : await request.text();
2529
2532
  const serverAction = await decodeCallServer(actionId, reply);
2530
2533
  let actionResult = Promise.resolve(serverAction());
2531
2534
  try {
@@ -2540,31 +2543,28 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2540
2543
  actionResult,
2541
2544
  revalidationRequest: getRevalidationRequest()
2542
2545
  };
2543
- }
2544
- const clone = request.clone();
2545
- const formData = await request.formData();
2546
- if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2547
- if (!decodeFormAction) {
2548
- throw new Error(
2549
- "Cannot handle form actions without a decodeFormAction function"
2550
- );
2551
- }
2552
- const action = await decodeFormAction(formData);
2553
- try {
2554
- await action();
2555
- } catch (error) {
2556
- if (isResponse(error)) {
2557
- return error;
2546
+ } else if (isFormRequest) {
2547
+ const formData = await request.clone().formData();
2548
+ if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2549
+ if (!decodeFormAction) {
2550
+ throw new Error(
2551
+ "Cannot handle form actions without a decodeFormAction function"
2552
+ );
2558
2553
  }
2559
- onError?.(error);
2554
+ const action = await decodeFormAction(formData);
2555
+ try {
2556
+ await action();
2557
+ } catch (error) {
2558
+ if (isResponse(error)) {
2559
+ return error;
2560
+ }
2561
+ onError?.(error);
2562
+ }
2563
+ return {
2564
+ revalidationRequest: getRevalidationRequest()
2565
+ };
2560
2566
  }
2561
- return {
2562
- revalidationRequest: getRevalidationRequest()
2563
- };
2564
2567
  }
2565
- return {
2566
- revalidationRequest: clone
2567
- };
2568
2568
  }
2569
2569
  async function generateResourceResponse(request, routes, routeId, onError) {
2570
2570
  let result;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8796,7 +8796,7 @@ function mergeRefs(...refs) {
8796
8796
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8797
8797
  try {
8798
8798
  if (isBrowser) {
8799
- window.__reactRouterVersion = "0.0.0-experimental-98367e499";
8799
+ window.__reactRouterVersion = "0.0.0-experimental-bafa092e7";
8800
8800
  }
8801
8801
  } catch (e) {
8802
8802
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -26,7 +26,7 @@ import {
26
26
  invariant,
27
27
  mapRouteProperties,
28
28
  useFogOFWarDiscovery
29
- } from "./chunk-6YOGVME4.mjs";
29
+ } from "./chunk-PBF6AAQR.mjs";
30
30
 
31
31
  // lib/dom-export/dom-router-provider.tsx
32
32
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8955,7 +8955,7 @@ function mergeRefs(...refs) {
8955
8955
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8956
8956
  try {
8957
8957
  if (isBrowser) {
8958
- window.__reactRouterVersion = "0.0.0-experimental-98367e499";
8958
+ window.__reactRouterVersion = "0.0.0-experimental-bafa092e7";
8959
8959
  }
8960
8960
  } catch (e) {
8961
8961
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -134,7 +134,7 @@ import {
134
134
  withComponentProps,
135
135
  withErrorBoundaryProps,
136
136
  withHydrateFallbackProps
137
- } from "./chunk-6YOGVME4.mjs";
137
+ } from "./chunk-PBF6AAQR.mjs";
138
138
  export {
139
139
  Await,
140
140
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-98367e499
2
+ * react-router v0.0.0-experimental-bafa092e7
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
25
25
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
26
 
27
27
  /**
28
- * react-router v0.0.0-experimental-98367e499
28
+ * react-router v0.0.0-experimental-bafa092e7
29
29
  *
30
30
  * Copyright (c) Remix Software Inc.
31
31
  *
@@ -2540,6 +2540,9 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2540
2540
  headers: request.headers,
2541
2541
  signal: request.signal
2542
2542
  });
2543
+ const isFormRequest = canDecodeWithFormData(
2544
+ request.headers.get("Content-Type")
2545
+ );
2543
2546
  const actionId = request.headers.get("rsc-action-id");
2544
2547
  if (actionId) {
2545
2548
  if (!decodeCallServer) {
@@ -2547,7 +2550,7 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2547
2550
  "Cannot handle enhanced server action without a decodeCallServer function"
2548
2551
  );
2549
2552
  }
2550
- const reply = canDecodeWithFormData(request.headers.get("Content-Type")) ? await request.formData() : await request.text();
2553
+ const reply = isFormRequest ? await request.formData() : await request.text();
2551
2554
  const serverAction = await decodeCallServer(actionId, reply);
2552
2555
  let actionResult = Promise.resolve(serverAction());
2553
2556
  try {
@@ -2562,31 +2565,28 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2562
2565
  actionResult,
2563
2566
  revalidationRequest: getRevalidationRequest()
2564
2567
  };
2565
- }
2566
- const clone = request.clone();
2567
- const formData = await request.formData();
2568
- if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2569
- if (!decodeFormAction) {
2570
- throw new Error(
2571
- "Cannot handle form actions without a decodeFormAction function"
2572
- );
2573
- }
2574
- const action = await decodeFormAction(formData);
2575
- try {
2576
- await action();
2577
- } catch (error) {
2578
- if (isResponse(error)) {
2579
- return error;
2568
+ } else if (isFormRequest) {
2569
+ const formData = await request.clone().formData();
2570
+ if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2571
+ if (!decodeFormAction) {
2572
+ throw new Error(
2573
+ "Cannot handle form actions without a decodeFormAction function"
2574
+ );
2580
2575
  }
2581
- onError?.(error);
2576
+ const action = await decodeFormAction(formData);
2577
+ try {
2578
+ await action();
2579
+ } catch (error) {
2580
+ if (isResponse(error)) {
2581
+ return error;
2582
+ }
2583
+ onError?.(error);
2584
+ }
2585
+ return {
2586
+ revalidationRequest: getRevalidationRequest()
2587
+ };
2582
2588
  }
2583
- return {
2584
- revalidationRequest: getRevalidationRequest()
2585
- };
2586
2589
  }
2587
- return {
2588
- revalidationRequest: clone
2589
- };
2590
2590
  }
2591
2591
  async function generateResourceResponse(request, routes, routeId, onError) {
2592
2592
  let result;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { splitCookiesString } from 'set-cookie-parser';
4
4
 
5
5
  /**
6
- * react-router v0.0.0-experimental-98367e499
6
+ * react-router v0.0.0-experimental-bafa092e7
7
7
  *
8
8
  * Copyright (c) Remix Software Inc.
9
9
  *
@@ -2518,6 +2518,9 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2518
2518
  headers: request.headers,
2519
2519
  signal: request.signal
2520
2520
  });
2521
+ const isFormRequest = canDecodeWithFormData(
2522
+ request.headers.get("Content-Type")
2523
+ );
2521
2524
  const actionId = request.headers.get("rsc-action-id");
2522
2525
  if (actionId) {
2523
2526
  if (!decodeCallServer) {
@@ -2525,7 +2528,7 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2525
2528
  "Cannot handle enhanced server action without a decodeCallServer function"
2526
2529
  );
2527
2530
  }
2528
- const reply = canDecodeWithFormData(request.headers.get("Content-Type")) ? await request.formData() : await request.text();
2531
+ const reply = isFormRequest ? await request.formData() : await request.text();
2529
2532
  const serverAction = await decodeCallServer(actionId, reply);
2530
2533
  let actionResult = Promise.resolve(serverAction());
2531
2534
  try {
@@ -2540,31 +2543,28 @@ async function processServerAction(request, decodeCallServer, decodeFormAction,
2540
2543
  actionResult,
2541
2544
  revalidationRequest: getRevalidationRequest()
2542
2545
  };
2543
- }
2544
- const clone = request.clone();
2545
- const formData = await request.formData();
2546
- if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2547
- if (!decodeFormAction) {
2548
- throw new Error(
2549
- "Cannot handle form actions without a decodeFormAction function"
2550
- );
2551
- }
2552
- const action = await decodeFormAction(formData);
2553
- try {
2554
- await action();
2555
- } catch (error) {
2556
- if (isResponse(error)) {
2557
- return error;
2546
+ } else if (isFormRequest) {
2547
+ const formData = await request.clone().formData();
2548
+ if (Array.from(formData.keys()).some((k) => k.startsWith("$ACTION_"))) {
2549
+ if (!decodeFormAction) {
2550
+ throw new Error(
2551
+ "Cannot handle form actions without a decodeFormAction function"
2552
+ );
2558
2553
  }
2559
- onError?.(error);
2554
+ const action = await decodeFormAction(formData);
2555
+ try {
2556
+ await action();
2557
+ } catch (error) {
2558
+ if (isResponse(error)) {
2559
+ return error;
2560
+ }
2561
+ onError?.(error);
2562
+ }
2563
+ return {
2564
+ revalidationRequest: getRevalidationRequest()
2565
+ };
2560
2566
  }
2561
- return {
2562
- revalidationRequest: getRevalidationRequest()
2563
- };
2564
2567
  }
2565
- return {
2566
- revalidationRequest: clone
2567
- };
2568
2568
  }
2569
2569
  async function generateResourceResponse(request, routes, routeId, onError) {
2570
2570
  let result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "0.0.0-experimental-98367e499",
3
+ "version": "0.0.0-experimental-bafa092e7",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",