@hy-bricks/canvas 0.4.1 → 0.4.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,45 @@
1
1
  # @hy-bricks/canvas
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - @hy-bricks/core@0.4.3
8
+
9
+ ## [0.4.2] - 2026-05-28 · devtools 强化(配套升级)
10
+
11
+ 跟 `@hy-bricks/devtools` 0.4.2 同步。canvas 本次给 runtime renderer 加诊断 handle 自动注册,
12
+ 让 BoardTile / portal-ui 主题页等"无 designer"场景在 devtools 也能看到实例计数 / 渲染开销 / 错误 / 事件。
13
+ **零 BREAKING**,从 0.4.x 任意版本直接升 0.4.2 安全。
14
+
15
+ ### ✨ 新特性(business 侧可见的部分)
16
+
17
+ - `HyperCardPageRenderer` mount 时**自动**把诊断 handle 注册到全局,devtools 浮窗
18
+ 自动捕获到所有运行时 canvasId(无需 host 手动调 API)
19
+ - `createRenderScheduler.getStats()` 暴露 `pending / mounting / mounted / disposing`
20
+ 实时计数(O(1))
21
+
22
+ ### 内部新增(devtools 消费)
23
+
24
+ `@hy-bricks/canvas` 新增 `RendererDiagnosticsHandle` 接口 + registry,**业务侧不应直接用**:
25
+
26
+ - `registerRendererDiagnostics` / `unregisterRendererDiagnostics` /
27
+ `getRendererDiagnostics` / `subscribeRendererDiagnostics`
28
+ - `RendererDiagnosticsHandle` 接口:`getSchedulerStats / listRuntimeInstances /
29
+ getInstanceTimings / getLayoutIssues`
30
+
31
+ 详见 [根 CHANGELOG.md](../../CHANGELOG.md) §0.4.2。
32
+
33
+ ### 业务侧升级
34
+
35
+ ```bash
36
+ pnpm up @hy-bricks/canvas@0.4.2
37
+ ```
38
+
39
+ 零代码改动。
40
+
41
+ ---
42
+
3
43
  ## [0.4.1] - 2026-05-27
4
44
 
5
45
  文档补完 — 0.4.0 的发版说明现在 npm 包页面可见。代码无变更。
@@ -15,29 +55,29 @@
15
55
 
16
56
  每个组件实例可读 3 个 SDK 注入 prop:
17
57
 
18
- | Prop | 含义 |
19
- |---|---|
20
- | `this.hcInstanceId` | 实例 ID |
21
- | `this.hcCanvasId` | 所属画布 ID |
22
- | `this.hcComponentId` | 组件源 ID |
58
+ | Prop | 含义 |
59
+ | -------------------- | ----------- |
60
+ | `this.hcInstanceId` | 实例 ID |
61
+ | `this.hcCanvasId` | 所属画布 ID |
62
+ | `this.hcComponentId` | 组件源 ID |
23
63
 
24
64
  ```js
25
65
  // 组件源码 component.js
26
66
  export default {
27
67
  mounted() {
28
- console.log('我是谁', this.hcInstanceId, this.hcCanvasId)
68
+ console.log("我是谁", this.hcInstanceId, this.hcCanvasId);
29
69
 
30
70
  // ✅ 立即订阅,不再要等
31
- __HYPERCARD__.runtime.on(this.hcInstanceId, 'click', (payload) => {
71
+ __HYPERCARD__.runtime.on(this.hcInstanceId, "click", (payload) => {
32
72
  // ...
33
- })
73
+ });
34
74
 
35
75
  // ✅ 立即拿到 handle
36
76
  const handle = __HYPERCARD__.canvases
37
77
  .get(this.hcCanvasId)
38
- ?.getInstance(this.hcInstanceId)
78
+ ?.getInstance(this.hcInstanceId);
39
79
  },
40
- }
80
+ };
41
81
  ```
42
82
 
43
83
  ### ⚠ BREAKING — host 升级前 audit
@@ -67,6 +107,7 @@ grep -rn "instance:ready\|onInstanceLifecycle\|getInstanceReady" src/
67
107
  ```
68
108
 
69
109
  每处看回调内是否访问 `vm.$el` / DOM。
110
+
70
111
  - 没访问 → `npm install @hy-bricks/{core,canvas,editor,devtools}@^0.4.0` 透明升
71
112
  - 访问了 → 改 `nextTick`
72
113