@iyulab/router 0.11.2 → 0.11.3
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 +13 -0
- package/dist/index.js +8 -4
- package/dist/react.js +1 -1
- package/dist/{share-Ds0NYHr-.js → share-iJLbxFbJ.js} +2 -2
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.3] - 2026-08-31
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`waitOutlet()` could hang forever in a backgrounded tab.** The wait loop
|
|
8
|
+
only re-checked for the outlet after each `requestAnimationFrame`
|
|
9
|
+
resolved, and a fully suspended tab can stop firing `rAF` entirely (not
|
|
10
|
+
just throttle it), so the loop never exited. It now races each `rAF`
|
|
11
|
+
wait against a `setTimeout` for the remaining budget, and does one more
|
|
12
|
+
outlet check immediately before throwing — the deadline can pass in the
|
|
13
|
+
exact frame the outlet became ready, and without that final check that
|
|
14
|
+
read as a false timeout.
|
|
15
|
+
|
|
3
16
|
## [0.11.2] - 2026-08-25
|
|
4
17
|
|
|
5
18
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isExternalUrl, i as absolutePath, n as __decorate, o as parseUrl, r as __decorateMetadata, s as UOutlet, t as ULink } from "./share-
|
|
1
|
+
import { a as isExternalUrl, i as absolutePath, n as __decorate, o as parseUrl, r as __decorateMetadata, s as UOutlet, t as ULink } from "./share-iJLbxFbJ.js";
|
|
2
2
|
import { LitElement, css, html } from "lit";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
4
|
//#region src/types/RouteError.ts
|
|
@@ -260,14 +260,18 @@ function findOutletOrThrow(element, skip = false) {
|
|
|
260
260
|
* @returns 준비된 `u-outlet` 엘리먼트
|
|
261
261
|
*/
|
|
262
262
|
async function waitOutlet(element, timeout = 1e4, skip = false) {
|
|
263
|
-
const
|
|
264
|
-
while (performance.now()
|
|
263
|
+
const deadline = performance.now() + timeout;
|
|
264
|
+
while (performance.now() < deadline) {
|
|
265
265
|
const outlet = findOutlet(element, skip);
|
|
266
266
|
if (outlet) return outlet;
|
|
267
267
|
if (element.localName.includes("-")) await customElements.whenDefined(element.localName);
|
|
268
268
|
if ("updateComplete" in element) await element.updateComplete;
|
|
269
|
-
|
|
269
|
+
const remaining = deadline - performance.now();
|
|
270
|
+
if (remaining <= 0) break;
|
|
271
|
+
await Promise.race([new Promise((resolve) => requestAnimationFrame(() => resolve())), new Promise((resolve) => setTimeout(resolve, remaining))]);
|
|
270
272
|
}
|
|
273
|
+
const outlet = findOutlet(element, skip);
|
|
274
|
+
if (outlet) return outlet;
|
|
271
275
|
throw new Error(`Timed out waiting for <u-outlet> inside <${element.tagName.toLowerCase()}>. Ensure that the router root element contains a <u-outlet> child.`);
|
|
272
276
|
}
|
|
273
277
|
/**
|
package/dist/react.js
CHANGED
|
@@ -1023,12 +1023,12 @@ function catchBasepath(basepath) {
|
|
|
1023
1023
|
return basepath;
|
|
1024
1024
|
}
|
|
1025
1025
|
//#endregion
|
|
1026
|
-
//#region \0@oxc-project+runtime@0.
|
|
1026
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/decorateMetadata.js
|
|
1027
1027
|
function __decorateMetadata(k, v) {
|
|
1028
1028
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
1031
|
-
//#region \0@oxc-project+runtime@0.
|
|
1031
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/decorate.js
|
|
1032
1032
|
function __decorate(decorators, target, key, desc) {
|
|
1033
1033
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1034
1034
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/router",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "A modern client-side router for web applications with support for Lit and React components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
+
"preversion": "node ../../scripts/preversion-check.mjs",
|
|
50
51
|
"test": "vitest run",
|
|
51
52
|
"build": "npm run typecheck && vite build",
|
|
52
53
|
"test:watch": "vitest",
|