@fudrouter/fsrouter 0.6.111 → 0.6.113

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,9 +1,10 @@
1
- // Fetch with timeout wrapper
1
+ // Fetch with timeout wrapper — uses AbortSignal.timeout (reliably aborts the
2
+ // underlying request instead of just racing a dangling promise that can hang
3
+ // the whole HTTP handler / make the browser show "Network error").
2
4
  const fetchWithTimeout = (url, options, timeout = 10000) => {
3
- return Promise.race([
4
- fetch(url, options),
5
- new Promise((_, reject) => setTimeout(() => reject(new Error("Request timeout")), timeout))
6
- ]);
5
+ const controller = new AbortController();
6
+ const t = setTimeout(() => controller.abort(), timeout);
7
+ return fetch(url, { ...options, signal: controller.signal }).finally(() => clearTimeout(t));
7
8
  };
8
9
  // Validate URL format
9
10
  const isValidUrl = (url) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fudrouter/fsrouter",
3
- "version": "0.6.111",
3
+ "version": "0.6.113",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "9Router v2 — Express Backend (API, SSE, DB, Auth, MITM)",
package/public/index.html CHANGED
@@ -10,10 +10,10 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index.BO_pNnMt.js?v=108"></script>
14
- <link rel="modulepreload" crossorigin href="/assets/router.Cjj1--8t.js?v=108">
15
- <link rel="modulepreload" crossorigin href="/assets/zustand.akaTi5uX.js?v=108">
16
- <link rel="stylesheet" crossorigin href="/assets/index.C--zNQ3O.css?v=108">
13
+ <script type="module" crossorigin src="/assets/index.BO_pNnMt.js?v=111"></script>
14
+ <link rel="modulepreload" crossorigin href="/assets/router.Cjj1--8t.js?v=111">
15
+ <link rel="modulepreload" crossorigin href="/assets/zustand.akaTi5uX.js?v=111">
16
+ <link rel="stylesheet" crossorigin href="/assets/index.C--zNQ3O.css?v=111">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>