# v1.0.0 Release Notes

> v0.6.22 -> v1.0.0

## Summary

Reworks the rendering core from whole-tree diffing into keyed, block-level partial updates, and stabilizes the public surface for a 1.0 release. Built-in visual effects and source obfuscation are dropped, and locale selection becomes explicit.

<details>
<summary>翻譯</summary>

將渲染核心由整棵樹比對改為以 key 識別的區塊級局部更新，並為 1.0 定版整理對外介面。內建視覺效果與原始碼混淆一併移除，語系選擇改為明確指定。

</details>

## ⚠️ Breaking Changes

### Rendering switched from DOM diffing to keyed partial rendering

**Before:**

```html
<!-- loops matched by position; container children contain only rendered items -->
<li :for="item in items">{{ item.name }}</li>
```

**After:**

```html
<!-- optional :key matches outer-loop items by identity; each top-level :for / :if block is delimited by comment nodes -->
<li :for="item in items" :key="item.id">{{ item.name }}</li>
```

- `:model` binds only top-level keys; a nested path such as `form.name` is no longer bound and logs `[Invalid]`
- `fragment()` copies the root's child nodes excluding comment anchors
- Top-level `:for` / `:if` blocks add comment nodes to the container's `childNodes`

**Migration:**

```js
// Old
<input :model="form.name" />
// New: bind a top-level key
<input :model="formName" />

// Old: code assuming childNodes holds only rendered items
container.firstChild
// New: skip comment anchors
[...container.childNodes].filter((n) => n.nodeType !== 8)[0]
```

### Built-in render effects and loading masks removed

**Before:**

```html
<img :lazyload="cover" :effect="circle" />
<div :mask="true" effect="fade-in"></div>
```

**After:**

```html
<img :lazyload="cover" />
```

**Migration:**

```css
/* Old: QuickUI added fade-in / expand / loading-block classes automatically */
/* New: provide the visuals with your own CSS */
.card {
  animation: fade 0.3s;
}
```

### `i18nLang` removed; locale must be selected explicitly

**Before:**

```js
const app = new QUI({ id: "app", i18n: { zh: {...}, en: {...} }, i18nLang: "zh" });
```

**After:**

```js
const app = new QUI({ id: "app", i18n: { zh: {...}, en: {...} } });
app.lang("zh");
```

- No default locale: nothing is translated until `lang()` selects one
- Missing translations render the raw `i18n.xxx` string instead of the bare key
- `lang()` called before initialization is queued, and no longer logs a conflict

**Migration:**

```js
// Old
new QUI({ id: "app", i18n, i18nLang: "zh" });
// New (lang() returns nothing; keep the instance in a variable first)
const app = new QUI({ id: "app", i18n });
app.lang("zh");
```

### `QUI.body` accessor removed

**Before:**

```js
app.body.classList.add("ready");
```

**After:**

```js
app.element.classList.add("ready");
```

**Migration:**

```js
// Old
app.body;
// New
app.element;
```

<details>
<summary>翻譯</summary>

- 渲染由 DOM diff 改為以 key 識別的局部渲染：`:model` 僅支援頂層 key，巢狀路徑不再綁定；頂層 `:for` / `:if` 區塊會在容器 `childNodes` 加入註解節點；`fragment()` 不含註解錨點。
- 移除內建渲染效果與載入遮罩（`:effect`、`:animation`、`:mask`），需自行以 CSS 實作。
- 移除 `i18nLang`，改以 `lang()` 明確選擇語系；未選擇或缺少翻譯時顯示原始 `i18n.xxx` 字串。
- 移除 `QUI.body`，改用 `QUI.element`。

</details>

## Changes

### BREAKING

- Replace DOM diffing with keyed partial rendering and add `:key` for outer-loop item identity (@pardnchiu) [3290140, ce2eadd]
  - Track binding blocks and a dependency index so only affected blocks recompute
  - Restrict `:model` to top-level keys
  - Delimit top-level `:for` / `:if` blocks with comment nodes
- Remove built-in render effects and loading masks, and unminify internal source (@pardnchiu) [52edcd3]
  - Drop `:effect`, `:animation` and `:mask` presets
  - Use native API names in `src/` while `dist/` stays minified
- Require explicit locale selection through `lang()` and remove `i18nLang` (@pardnchiu) [30a9e76]
  - Queue `lang()` calls made before initialization
  - Show the raw `i18n.xxx` string when a translation is missing
- Remove the `QUI.body` accessor in favor of `QUI.element` (@pardnchiu) [fdb03b1]

<details>
<summary>翻譯</summary>

- 以 key 識別的局部渲染取代 DOM diff，並新增 `:key`
- 移除內建渲染效果與載入遮罩，並還原內部原始碼的可讀性
- 改為透過 `lang()` 明確選擇語系，移除 `i18nLang`
- 移除 `QUI.body`，改用 `QUI.element`

</details>

### FIX

- Fix weekday formatting in `dateFormat`, HTML attribute bindings and template traversal (@pardnchiu) [ce2eadd]

<details>
<summary>翻譯</summary>

- 修正 `dateFormat` 星期格式、HTML 屬性綁定與模板走訪問題

</details>

## Scope

- `src/model/`, `src/function/`, `src/listener/`, `src/interface.ts` — BREAKING, FIX
- `src/QuickUI.debug.js`, `dist/` — BREAKING, FIX
- `package.json` — UPDATE
- `README.md`, `doc/` — DOC
- `.gitattributes`, `wiki-worker/` — CHORE

---

Generated by [SKILL](https://github.com/pardnchiu/skill-version-generate)
