@iyulab/components 1.40.2 → 1.40.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
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.40.3] - 2026-09-13
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`createDevWarner`/`devWarnOnce`, and the `u-icon`/`u-split-panel` warnings built on them, were
|
|
8
|
+
a complete no-op in every published release since 1.40.1** — the guard used
|
|
9
|
+
`import.meta.env.DEV`, which Vite resolves statically at this library's own build time (not the
|
|
10
|
+
consumer's), so the published dist always shipped with `false` baked in and Rollup's dead-code
|
|
11
|
+
elimination removed the warning body entirely. No published dev-mode warning from this package
|
|
12
|
+
has ever actually fired for a consumer. Replaced with `process.env.NODE_ENV !== 'production'`,
|
|
13
|
+
which this library's own build leaves untouched and each consumer's own bundler resolves against
|
|
14
|
+
its own dev/production build (the same convention used by other libraries in this ecosystem for
|
|
15
|
+
the same reason). A new test asserts the built dist directly, not just the source.
|
|
16
|
+
|
|
3
17
|
## [1.40.2] - 2026-09-13
|
|
4
18
|
|
|
5
19
|
### Added
|
|
@@ -1,12 +1,37 @@
|
|
|
1
1
|
import { styles } from "./UElement.styles.js";
|
|
2
2
|
import { LitElement, render } from "lit";
|
|
3
3
|
//#region src/components/UElement.ts
|
|
4
|
+
/**
|
|
5
|
+
* 모든 UI 컴포넌트의 기반 클래스.
|
|
6
|
+
* LitElement를 확장하여 이벤트 발행 및 렌더 교체 헬퍼를 제공합니다.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 디자인 토큰 시트 부재를 개발 빌드에서 1회 경고한다.
|
|
10
|
+
*
|
|
11
|
+
* 토큰이 없으면 컴포넌트 시트의 `var(--u-…)` 가 전부 무효가 되어 테두리·배경이 **에러 없이**
|
|
12
|
+
* 사라진다. CSS 는 이때 아무 신호도 내지 않으므로, 소비자는 자기 CSS 를 의심하며 며칠을 쓴다.
|
|
13
|
+
* 실제로 운영 화면이 무스타일로 렌더된 사례가 있었다 — 토큰 주입이 `Theme.init()` 호출
|
|
14
|
+
* (셸이 대신 부른다)에만 딸려 있어서, 셸 밖에서 렌더되는 로그인 화면만 조용히 깨졌다.
|
|
15
|
+
*
|
|
16
|
+
* ★리터럴 폴백(1.14.0)이 그 **소멸**은 막는다. 그래도 경고는 유지한다 — 폴백은 라이트
|
|
17
|
+
* 시트 값을 구워 넣은 것이라 **다크 테마가 라이트 색으로 렌더되고**, 테마 변수 오버라이드도
|
|
18
|
+
* 먹지 않는다. 폴백은 *"조용히 사라지지 않게"* 하는 안전망이지 *"시트 없이 써도 된다"* 가
|
|
19
|
+
* 아니다. 둘을 섞으면 이 경고가 고발하는 무증상 열화가 형태만 바꿔 돌아온다.
|
|
20
|
+
*/
|
|
21
|
+
var tokenCheckDone = false;
|
|
22
|
+
function warnIfTokensMissing() {
|
|
23
|
+
if (tokenCheckDone || typeof document === "undefined") return;
|
|
24
|
+
tokenCheckDone = true;
|
|
25
|
+
if (getComputedStyle(document.documentElement).getPropertyValue("--u-blue-600").trim()) return;
|
|
26
|
+
console.warn("[@iyulab/components] No design-token sheet found in the document — components render with their built-in fallbacks (baked from the light theme). Dark theme and theme variable overrides will not apply.\n Static CSS: import '@iyulab/components/styles/tokens.css'\n At runtime: Theme.init()\n (The @iyulab/modern-app shell calls Theme.init() for you. Screens rendered outside the shell — login, onboarding, embeds — need one of the two.)");
|
|
27
|
+
}
|
|
4
28
|
var UElement = class extends LitElement {
|
|
5
29
|
static {
|
|
6
30
|
this.styles = styles;
|
|
7
31
|
}
|
|
8
32
|
connectedCallback() {
|
|
9
33
|
super.connectedCallback();
|
|
34
|
+
if (process.env.NODE_ENV !== "production") warnIfTokensMissing();
|
|
10
35
|
}
|
|
11
36
|
/**
|
|
12
37
|
* 커스텀 이벤트를 생성하여 발행합니다.
|
|
@@ -2,6 +2,7 @@ import { UElement } from "../UElement.js";
|
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorate.js";
|
|
4
4
|
import { arrayAttrConverter } from "../../utilities/converters.js";
|
|
5
|
+
import { devWarnOnce } from "../../utilities/devWarning.js";
|
|
5
6
|
import { Locale } from "../../utilities/Locale.js";
|
|
6
7
|
import { styles } from "./USplitPanel.styles.js";
|
|
7
8
|
import { html } from "lit";
|
|
@@ -247,7 +248,14 @@ var USplitPanel = class USplitPanel extends UElement {
|
|
|
247
248
|
* 실측 18px. 호스트가 `overflow: hidden` 이라 패널 내용에 닿을 방법이 없고,
|
|
248
249
|
* 오류도 없다. 첫 배치 뒤 한 번 재서 개발 모드에서 알린다.
|
|
249
250
|
*/
|
|
250
|
-
warnIfCollapsed() {
|
|
251
|
+
warnIfCollapsed() {
|
|
252
|
+
if (process.env.NODE_ENV === "production" || this.panels.length === 0 || !this.isConnected) return;
|
|
253
|
+
{
|
|
254
|
+
const height = this.getBoundingClientRect().height;
|
|
255
|
+
if (height >= 40) return;
|
|
256
|
+
devWarnOnce(`split-panel:${this.id || "height"}`, `u-split-panel is only ${Math.round(height)}px tall — it has no height of its own (its height: 100% found no sized parent), so its panels take one line of content and anything sized 100% inside them collapses to nothing. Give the host or its parent a height (e.g. height: 400px, or flex: 1 1 auto inside a sized parent).`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
251
259
|
appendSplitters() {
|
|
252
260
|
const root = this.renderRoot;
|
|
253
261
|
if (!root) return;
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
* 개발 모드 «사용 안내» 경고 — 오류 경로가 아닌, ***조용히 틀리는*** 상태를 한 번 알린다.
|
|
3
3
|
*
|
|
4
4
|
* 이 패키지에는 같은 모양의 경고가 이미 있다(`UElement.warnIfTokensMissing` — 토큰 시트 부재).
|
|
5
|
-
* 공통 규약: `[<패키지>]` 네임스페이스 · 개발 모드에서만(`
|
|
5
|
+
* 공통 규약: `[<패키지>]` 네임스페이스 · 개발 모드에서만(`process.env.NODE_ENV !== 'production'`) ·
|
|
6
6
|
* 같은 키로는 **한 번만** · 무엇이 틀렸는지가 아니라 **무엇을 하면 되는지**를 적는다.
|
|
7
7
|
*
|
|
8
|
+
* ⚠**`import.meta.env.DEV` 를 쓰지 않는다** — Vite 는 이 라이브러리 **자신의** `vite build`
|
|
9
|
+
* 시점에 그 값을 정적으로 `false` 로 치환하고, Rollup 의 dead-code elimination 이 이후
|
|
10
|
+
* 분기를 통째로 지운다. 소비자가 dev 서버로 띄워도 이미 게시본에서 죽은 코드라 살아나지
|
|
11
|
+
* 않는다(2026-09-13 실측 — 1.40.1·1.40.2 게시본에서 이 경고가 전부 no-op 이었다).
|
|
12
|
+
* `process.env.NODE_ENV` 는 이 라이브러리의 빌드가 손대지 않고 그대로 dist 에 남아,
|
|
13
|
+
* **소비자 자신의** 번들러가 소비자의 빌드 시점에 치환한다(React 등 생태계 라이브러리와
|
|
14
|
+
* 동일한 관례) — `tests/build/dev-warning-dist.test.ts` 가 게시본에 대해 이 계약을 지킨다.
|
|
15
|
+
*
|
|
8
16
|
* 이 파일이 생긴 계기: 소비앱의 메뉴 30개가 해석되지 않는 아이콘 이름으로 **한꺼번에 같은
|
|
9
17
|
* 큐브 폴백**을 그렸는데 신호가 0 이었다(소비자 실측). 폴백은 의도된 것이라(접힌 사이드바에서
|
|
10
18
|
* 아이콘이 없으면 메뉴가 «높이만 있는 빈 줄» 이 된다) 제거가 답이 아니다 — **없는 것은 경고다.**
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
* 개발 모드 «사용 안내» 경고 — 오류 경로가 아닌, ***조용히 틀리는*** 상태를 한 번 알린다.
|
|
4
4
|
*
|
|
5
5
|
* 이 패키지에는 같은 모양의 경고가 이미 있다(`UElement.warnIfTokensMissing` — 토큰 시트 부재).
|
|
6
|
-
* 공통 규약: `[<패키지>]` 네임스페이스 · 개발 모드에서만(`
|
|
6
|
+
* 공통 규약: `[<패키지>]` 네임스페이스 · 개발 모드에서만(`process.env.NODE_ENV !== 'production'`) ·
|
|
7
7
|
* 같은 키로는 **한 번만** · 무엇이 틀렸는지가 아니라 **무엇을 하면 되는지**를 적는다.
|
|
8
8
|
*
|
|
9
|
+
* ⚠**`import.meta.env.DEV` 를 쓰지 않는다** — Vite 는 이 라이브러리 **자신의** `vite build`
|
|
10
|
+
* 시점에 그 값을 정적으로 `false` 로 치환하고, Rollup 의 dead-code elimination 이 이후
|
|
11
|
+
* 분기를 통째로 지운다. 소비자가 dev 서버로 띄워도 이미 게시본에서 죽은 코드라 살아나지
|
|
12
|
+
* 않는다(2026-09-13 실측 — 1.40.1·1.40.2 게시본에서 이 경고가 전부 no-op 이었다).
|
|
13
|
+
* `process.env.NODE_ENV` 는 이 라이브러리의 빌드가 손대지 않고 그대로 dist 에 남아,
|
|
14
|
+
* **소비자 자신의** 번들러가 소비자의 빌드 시점에 치환한다(React 등 생태계 라이브러리와
|
|
15
|
+
* 동일한 관례) — `tests/build/dev-warning-dist.test.ts` 가 게시본에 대해 이 계약을 지킨다.
|
|
16
|
+
*
|
|
9
17
|
* 이 파일이 생긴 계기: 소비앱의 메뉴 30개가 해석되지 않는 아이콘 이름으로 **한꺼번에 같은
|
|
10
18
|
* 큐브 폴백**을 그렸는데 신호가 0 이었다(소비자 실측). 폴백은 의도된 것이라(접힌 사이드바에서
|
|
11
19
|
* 아이콘이 없으면 메뉴가 «높이만 있는 빈 줄» 이 된다) 제거가 답이 아니다 — **없는 것은 경고다.**
|
|
@@ -21,7 +29,13 @@ var warned = /* @__PURE__ */ new Set();
|
|
|
21
29
|
* 프로덕션 빌드에서는 호출 자체가 no-op 이다.
|
|
22
30
|
*/
|
|
23
31
|
function createDevWarner(scope) {
|
|
24
|
-
return (key, message) => {
|
|
32
|
+
return (key, message) => {
|
|
33
|
+
if (process.env.NODE_ENV === "production") return;
|
|
34
|
+
const scoped = `${scope} ${key}`;
|
|
35
|
+
if (warned.has(scoped)) return;
|
|
36
|
+
warned.add(scoped);
|
|
37
|
+
console.warn(`[${scope}] ${message}`);
|
|
38
|
+
};
|
|
25
39
|
}
|
|
26
40
|
/** `key` 당 한 번만, 개발 모드에서만 `[@iyulab/components]` 로 `console.warn` 한다. */
|
|
27
41
|
var devWarnOnce = createDevWarner("@iyulab/components");
|