@iyulab/router 0.12.0 → 0.13.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.13.0] - 2026-09-13
|
|
4
|
+
|
|
5
|
+
### Removed
|
|
6
|
+
|
|
7
|
+
- **`RouteConfig.force`** — deprecated in 0.12.0, removed as announced. It only ever expressed
|
|
8
|
+
the two values `key` already covers: `force: false` is `key: () => ''` (keep the mounted
|
|
9
|
+
content across every navigation that matches the route), `force: true` is the default
|
|
10
|
+
(`ctx => ctx.href` — remount when the URL changes at all). Replace one with the other; a
|
|
11
|
+
route that never set `force` is unaffected. The property is gone from the type, so a stale
|
|
12
|
+
usage fails at compile time rather than silently doing nothing.
|
|
13
|
+
|
|
3
14
|
## [0.12.0] - 2026-09-13
|
|
4
15
|
|
|
5
16
|
### Added
|
|
@@ -64,7 +64,7 @@ export declare class ULink extends LitElement {
|
|
|
64
64
|
/**
|
|
65
65
|
* 호스트에 세팅된 `aria-current`/`aria-label`은 실제 접근 가능한(포커스 대상)
|
|
66
66
|
* 엘리먼트가 아니라 — 그 안쪽 shadow DOM 의 네이티브 `<a>`다. 섀도우 경계를
|
|
67
|
-
* 넘지 않으므로 접근성 트리에 자동 반영되지 않는다(
|
|
67
|
+
* 넘지 않으므로 접근성 트리에 자동 반영되지 않는다(실측 — 속성은
|
|
68
68
|
* 붙어 있는데 접근성 트리의 `aria-current`는 계속 비어 있음). `render()`가 이
|
|
69
69
|
* 값을 읽어 내부 `<a>`에 직접 옮긴다.
|
|
70
70
|
*
|
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-A3Fla8oW.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
|
|
@@ -302,13 +302,12 @@ var createURLPattern = URLPattern;
|
|
|
302
302
|
* `key` 가 없을 때의 기본 식별 키 — «언제 새로 만드는가» 의 기본 규칙.
|
|
303
303
|
*
|
|
304
304
|
* 자식이 없는 라우트는 URL(`href`) 이 조금이라도 바뀌면 새로 마운트하고, 자식을 가진 라우트
|
|
305
|
-
* (레이아웃)는 상수 키로
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* 존중한다: `false` 는 «유지», `true` 는 «새로».
|
|
305
|
+
* (레이아웃)는 상수 키로 유지된다. 그 밖의 규칙은 소비자가 `key` 로 직접 준다 — 예전의
|
|
306
|
+
* `force` 불리언은 이 두 값(«유지»·«새로»)밖에 표현하지 못해 `key` 로 대체됐고 0.13.0 에서
|
|
307
|
+
* 제거됐다(`force: false` ≡ `key: () => ''` · `force: true` ≡ 기본값).
|
|
309
308
|
*/
|
|
310
|
-
function defaultKey(
|
|
311
|
-
return
|
|
309
|
+
function defaultKey(hasChildren) {
|
|
310
|
+
return hasChildren ? () => "" : (ctx) => ctx.href;
|
|
312
311
|
}
|
|
313
312
|
/**
|
|
314
313
|
* 라우트들을 다음 사항에 따라 재귀적으로 재설정합니다.
|
|
@@ -326,15 +325,15 @@ function setRoutes(routes, basepath) {
|
|
|
326
325
|
route.ignoreCase ||= false;
|
|
327
326
|
if (route.index === true) {
|
|
328
327
|
route.path = new createURLPattern({ pathname: `${basepath}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
329
|
-
route.key ??= defaultKey(
|
|
328
|
+
route.key ??= defaultKey(false);
|
|
330
329
|
} else {
|
|
331
330
|
if (typeof route.path === "string") route.path = new createURLPattern({ pathname: `${absolutePath(basepath, route.path)}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
332
331
|
else if (route.path instanceof URLPattern) {} else route.path = new createURLPattern({ pathname: `${basepath}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
333
332
|
if (route.children && route.children.length > 0) {
|
|
334
333
|
const childBasepath = route.path.pathname.replace("{/}?", "");
|
|
335
334
|
route.children = setRoutes(route.children, childBasepath);
|
|
336
|
-
route.key ??= defaultKey(
|
|
337
|
-
} else route.key ??= defaultKey(
|
|
335
|
+
route.key ??= defaultKey(true);
|
|
336
|
+
} else route.key ??= defaultKey(false);
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
339
|
return routes;
|
package/dist/react.js
CHANGED
|
@@ -1120,7 +1120,7 @@ var ULink = class ULink extends LitElement {
|
|
|
1120
1120
|
/**
|
|
1121
1121
|
* 호스트에 세팅된 `aria-current`/`aria-label`은 실제 접근 가능한(포커스 대상)
|
|
1122
1122
|
* 엘리먼트가 아니라 — 그 안쪽 shadow DOM 의 네이티브 `<a>`다. 섀도우 경계를
|
|
1123
|
-
* 넘지 않으므로 접근성 트리에 자동 반영되지 않는다(
|
|
1123
|
+
* 넘지 않으므로 접근성 트리에 자동 반영되지 않는다(실측 — 속성은
|
|
1124
1124
|
* 붙어 있는데 접근성 트리의 `aria-current`는 계속 비어 있음). `render()`가 이
|
|
1125
1125
|
* 값을 읽어 내부 `<a>`에 직접 옮긴다.
|
|
1126
1126
|
*
|
|
@@ -90,13 +90,6 @@ interface BaseRouteConfig {
|
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
92
|
key?: (ctx: RouteContext) => string;
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated `key`로 표현하세요 — `force: false`는 `key: () => ''`(상수 키)와 같고 `force: true`는
|
|
95
|
-
* 기본값과 같습니다. 이 판에서는 동작을 유지하며, 다음 minor에서 제거됩니다.
|
|
96
|
-
* ⚠이전 판에서는 자식이 없는 라우트에 `force: false`를 줘도 무시됐습니다(기본값 적용 순서의 결함).
|
|
97
|
-
* 이제 `force: false`는 모든 라우트에서 «유지»를 뜻합니다.
|
|
98
|
-
*/
|
|
99
|
-
force?: boolean;
|
|
100
93
|
/**
|
|
101
94
|
* 경로 매칭시 대소문자 구분 여부
|
|
102
95
|
* @default false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "A modern client-side router for web applications with support for Lit and React components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -75,6 +75,8 @@
|
|
|
75
75
|
"@types/react": "^19.2.17",
|
|
76
76
|
"@types/react-dom": "^19.2.3",
|
|
77
77
|
"happy-dom": "^20.10.6",
|
|
78
|
+
"react": "^19.2.8",
|
|
79
|
+
"react-dom": "^19.2.8",
|
|
78
80
|
"typescript": "^6.0.2",
|
|
79
81
|
"vite": "^8.1.4",
|
|
80
82
|
"vite-plugin-dts": "^5.0.3",
|
|
@@ -72,7 +72,6 @@ const router = new Router({
|
|
|
72
72
|
| `title` | `string` | Sets `document.title` on match |
|
|
73
73
|
| `metadata` | `Record<string, unknown>` | Arbitrary metadata (auth, layout, analytics) |
|
|
74
74
|
| `key` | `(ctx) => string` | When to remount: content is kept and re-rendered in place while the key is unchanged (Lit: same part, React: same root, `HTMLElement`: instance kept). Default `ctx => ctx.href` for leaf routes, a constant for routes with `children`. `key: ctx => ctx.pathname` keeps a page across query-string changes |
|
|
75
|
-
| `force` | `boolean` | **Deprecated** — use `key`. `false` ≡ constant key (keep), `true` ≡ default |
|
|
76
75
|
|
|
77
76
|
## RouteContext Fields
|
|
78
77
|
|