@iyulab/router 0.10.0 → 0.10.1
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,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.1] - 2026-07-02
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
- `RouteConfig.render` JSDoc: clarified that returning a React element directly lets `<u-outlet>` auto-manage `createRoot`/`root.unmount()` — wrapping it in a manually-created container `HTMLElement` bypasses this and leaks the React root on route change. Added a React `@example` alongside the existing Lit one.
|
|
7
|
+
|
|
3
8
|
## [0.10.0] - 2026-06-11
|
|
4
9
|
|
|
5
10
|
### Changed
|
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-C2LbLiIW.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
|
|
@@ -216,7 +216,7 @@ UErrorPage = __decorate([customElement("u-error-page"), __decorateMetadata("desi
|
|
|
216
216
|
* @return 랜덤한 ID 문자열
|
|
217
217
|
*/
|
|
218
218
|
function getRandomID() {
|
|
219
|
-
return window.isSecureContext ? window.crypto.randomUUID() : window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16);
|
|
219
|
+
return window.isSecureContext ? window.crypto.randomUUID() : window.crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0].toString(16);
|
|
220
220
|
}
|
|
221
221
|
//#endregion
|
|
222
222
|
//#region src/internals/element-helpers.ts
|
package/dist/react.js
CHANGED
|
@@ -126,12 +126,12 @@ function catchBasepath(basepath) {
|
|
|
126
126
|
return basepath;
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
|
-
//#region \0@oxc-project+runtime@0.
|
|
129
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorateMetadata.js
|
|
130
130
|
function __decorateMetadata(k, v) {
|
|
131
131
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
-
//#region \0@oxc-project+runtime@0.
|
|
134
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
|
|
135
135
|
function __decorate(decorators, target, key, desc) {
|
|
136
136
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
137
137
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -41,6 +41,18 @@ interface BaseRouteConfig {
|
|
|
41
41
|
* }
|
|
42
42
|
* }
|
|
43
43
|
* ```
|
|
44
|
+
* @remarks
|
|
45
|
+
* `render`는 Lit `TemplateResult`, `HTMLElement`, **또는 React 엘리먼트**를 반환할 수 있습니다.
|
|
46
|
+
* React 엘리먼트를 직접 반환하면 내부 `<u-outlet>`이 `createRoot`/`root.unmount()`를
|
|
47
|
+
* 자동으로 관리합니다 — React 루트를 직접 만들어 컨테이너 `HTMLElement`로 감싸 반환하면
|
|
48
|
+
* 이 자동 해제 지점을 우회하게 되어 라우트 전환마다 unmount가 호출되지 않는 누수가 생깁니다.
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* const route = {
|
|
52
|
+
* path: '/users/:id',
|
|
53
|
+
* render: (ctx) => <UserProfilePage userId={ctx.params.id} />, // React 엘리먼트를 직접 반환
|
|
54
|
+
* };
|
|
55
|
+
* ```
|
|
44
56
|
*/
|
|
45
57
|
render?: (ctx: RouteContext) => Promise<unknown> | unknown;
|
|
46
58
|
/**
|