@iyulab/router 0.11.3 → 0.11.4
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 +14 -0
- package/dist/index.js +3 -3
- package/dist/react.js +1 -1
- package/dist/{share-iJLbxFbJ.js → share-BOhUKwJL.js} +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.4] - 2026-09-01
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Three error messages gave no way to act on the failure.** `UOutlet.render()`
|
|
8
|
+
threw a generic "not supported content type" without saying what type it
|
|
9
|
+
actually received or what's supported; `getRoutes()` threw a garbled,
|
|
10
|
+
comma-spliced message that leaked an internal function name
|
|
11
|
+
(`setRoutes`) instead of the actual `path` value; and a route whose
|
|
12
|
+
`render()` returned a non-renderable value threw "Failed to load content
|
|
13
|
+
for the route." with no route path or id to identify which route failed.
|
|
14
|
+
All three now interpolate the actual value/route and name the expected
|
|
15
|
+
shape.
|
|
16
|
+
|
|
3
17
|
## [0.11.3] - 2026-08-31
|
|
4
18
|
|
|
5
19
|
### 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-BOhUKwJL.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
|
|
@@ -343,7 +343,7 @@ function getRoutes(routes, pathname) {
|
|
|
343
343
|
}
|
|
344
344
|
if (route.path instanceof URLPattern) {
|
|
345
345
|
if (route.path.test({ pathname })) return [route];
|
|
346
|
-
} else throw new Error(
|
|
346
|
+
} else throw new Error(`Route "path" must be a URLPattern, but got ${JSON.stringify(route.path)}. Routes passed to the Router must go through its normal config flow (new Router({ routes: [...] })), which normalizes string paths into URLPattern before matching — a route object was matched before that step ran.`);
|
|
347
347
|
}
|
|
348
348
|
return [];
|
|
349
349
|
}
|
|
@@ -510,7 +510,7 @@ var Router = class {
|
|
|
510
510
|
let content;
|
|
511
511
|
try {
|
|
512
512
|
content = await route.render(context);
|
|
513
|
-
if (content === false || content === void 0 || content === null) throw new Error(
|
|
513
|
+
if (content === false || content === void 0 || content === null) throw new Error(`Route render() returned ${content === false ? "false" : String(content)} for "${context.pathname}"${route.id ? ` (route id: "${route.id}")` : ""} — a route's render() must return an HTMLElement, a Lit TemplateResult, or a React element.`);
|
|
514
514
|
} catch (e) {
|
|
515
515
|
throw new ContentLoadError(e);
|
|
516
516
|
}
|
package/dist/react.js
CHANGED
|
@@ -23,7 +23,10 @@ var UOutlet = class extends HTMLElement {
|
|
|
23
23
|
const { createRoot } = await import("react-dom/client");
|
|
24
24
|
this.root = createRoot(this);
|
|
25
25
|
this.root.render(value);
|
|
26
|
-
} else
|
|
26
|
+
} else {
|
|
27
|
+
const receivedType = value?.constructor?.name ?? typeof value;
|
|
28
|
+
throw new Error(`Unsupported content type for Outlet rendering: received ${receivedType}. Expected an HTMLElement, a Lit TemplateResult, or a React element.`);
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* 기존 DOM을 삭제하여, 초기 상태로 되돌립니다.
|
|
@@ -1023,12 +1026,12 @@ function catchBasepath(basepath) {
|
|
|
1023
1026
|
return basepath;
|
|
1024
1027
|
}
|
|
1025
1028
|
//#endregion
|
|
1026
|
-
//#region \0@oxc-project+runtime@0.
|
|
1029
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorateMetadata.js
|
|
1027
1030
|
function __decorateMetadata(k, v) {
|
|
1028
1031
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1029
1032
|
}
|
|
1030
1033
|
//#endregion
|
|
1031
|
-
//#region \0@oxc-project+runtime@0.
|
|
1034
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorate.js
|
|
1032
1035
|
function __decorate(decorators, target, key, desc) {
|
|
1033
1036
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1034
1037
|
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.4",
|
|
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,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
-
"preversion": "node ../../scripts/preversion-check.mjs",
|
|
50
|
+
"preversion": "node -e \"if(require('fs').existsSync('../../scripts/preversion-check.mjs'))require('child_process').execFileSync('node',['../../scripts/preversion-check.mjs'],{stdio:'inherit'})\"",
|
|
51
51
|
"test": "vitest run",
|
|
52
52
|
"build": "npm run typecheck && vite build",
|
|
53
53
|
"test:watch": "vitest",
|