@hy-bricks/canvas 0.6.2 → 0.6.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,29 @@
1
1
  # @hy-bricks/canvas
2
2
 
3
+ ## [0.6.3] - 2026-06-24 · persistInstanceState 透传
4
+
5
+ 非破坏 patch。@hy-bricks 4 包同步升 0.6.3。机制本体(运行态快照拍照/还原 + watcher diff)在 `@hy-bricks/core`,详见 [core CHANGELOG](../core/CHANGELOG.md) §0.6.3。canvas 本次只把新 opt-in 开关一路透到编译组件 + 补 e2e。
6
+
7
+ ### Added
8
+ - **`persistInstanceState` prop 透传**(`boolean`,默认 `false`,opt-in):从渲染器一路透到编译组件(`@hy-bricks/core` 的 `RuntimeBox` → `hcPersistInstanceState`),打开后实例**真被拆掉**(滚出视口虚拟化 dispose/重建)时拍 `$data` 可序列化子集、重建还原,修"看板组件滚出视口再滚回 / 重渲染后用户运行时选值复位"。新增公开面:
9
+ - **`HyperCardCanvasDesigner` 新 prop `persistInstanceState`**;
10
+ - **`HyperCardPageRenderer` 新 prop `persistInstanceState`**;
11
+ - **`RuntimeLayer` 新 prop `persistInstanceState`**。
12
+ - spec:新增 `persistInstanceState-renderer-e2e.spec.ts`(渲染器→编译组件 dispose/重建端到端,5 例);canvas test → 1722。
13
+
14
+ ### 与 keepHiddenMounted(0.6.2)的关系(互补)
15
+ - `keepHiddenMounted`(默认 `true`):hidden(`v-show` / `display:none`)的 root 实例不被 dispose,vm 不拆 —— 根本不丢状态,不需要快照。
16
+ - `persistInstanceState`(默认 `false`):实例**真被拆掉**(滚出视口虚拟化 dispose/重建)才拍照+还原。
17
+ - 一句话:hidden 走保活(vm 不拆);scroll-out 拆了才用快照。
18
+
19
+ ### 已知限制
20
+ - 异步 `mounted` 重置不在保护范围(还原同步、跑在 `userMounted` 之后);`instanceId` 必须逻辑唯一、不可删后复用(快照按 `(canvasId, instanceId)` + `componentId` 守卫)。详见 [core CHANGELOG](../core/CHANGELOG.md) §0.6.3。
21
+
22
+ ### 依赖
23
+ - `@hy-bricks/core@0.6.3`(fixed 组同步;运行态快照持久化机制本体在 core)。
24
+
25
+ > 状态:本条目对应改动已收口、全验证绿,但**尚未 publish npm**(pre-1.0 手动 bump,待 `pnpm release`)。
26
+
3
27
  ## [0.6.2] - 2026-06-23 · 隐藏实例保活(修隐藏→恢复丢状态)
4
28
 
5
29
  非破坏 patch。@hy-bricks 4 包同步升 0.6.2。