@hy-bricks/core 0.4.2 → 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 +13 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @hy-bricks/core
|
|
2
2
|
|
|
3
|
+
## 0.4.3
|
|
4
|
+
|
|
3
5
|
## [0.4.2] - 2026-05-28 · devtools 强化(配套升级)
|
|
4
6
|
|
|
5
7
|
跟 `@hy-bricks/devtools` 0.4.2 同步。core 本次新增 SDK 内部 hook 给 devtools 消费,
|
|
@@ -50,29 +52,29 @@ pnpm up @hy-bricks/core@0.4.2
|
|
|
50
52
|
|
|
51
53
|
每个组件实例可读 3 个 SDK 注入 prop:
|
|
52
54
|
|
|
53
|
-
| Prop
|
|
54
|
-
|
|
55
|
-
| `this.hcInstanceId`
|
|
56
|
-
| `this.hcCanvasId`
|
|
57
|
-
| `this.hcComponentId` | 组件源 ID
|
|
55
|
+
| Prop | 含义 |
|
|
56
|
+
| -------------------- | ----------- |
|
|
57
|
+
| `this.hcInstanceId` | 实例 ID |
|
|
58
|
+
| `this.hcCanvasId` | 所属画布 ID |
|
|
59
|
+
| `this.hcComponentId` | 组件源 ID |
|
|
58
60
|
|
|
59
61
|
```js
|
|
60
62
|
// 组件源码 component.js
|
|
61
63
|
export default {
|
|
62
64
|
mounted() {
|
|
63
|
-
console.log(
|
|
65
|
+
console.log("我是谁", this.hcInstanceId, this.hcCanvasId);
|
|
64
66
|
|
|
65
67
|
// ✅ 立即订阅,不再要等
|
|
66
|
-
__HYPERCARD__.runtime.on(this.hcInstanceId,
|
|
68
|
+
__HYPERCARD__.runtime.on(this.hcInstanceId, "click", (payload) => {
|
|
67
69
|
// ...
|
|
68
|
-
})
|
|
70
|
+
});
|
|
69
71
|
|
|
70
72
|
// ✅ 立即拿到 handle
|
|
71
73
|
const handle = __HYPERCARD__.canvases
|
|
72
74
|
.get(this.hcCanvasId)
|
|
73
|
-
?.getInstance(this.hcInstanceId)
|
|
75
|
+
?.getInstance(this.hcInstanceId);
|
|
74
76
|
},
|
|
75
|
-
}
|
|
77
|
+
};
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
### ⚠ BREAKING — host 升级前 audit
|
|
@@ -102,6 +104,7 @@ grep -rn "instance:ready\|onInstanceLifecycle\|getInstanceReady" src/
|
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
每处看回调内是否访问 `vm.$el` / DOM。
|
|
107
|
+
|
|
105
108
|
- 没访问 → `npm install @hy-bricks/{core,canvas,editor,devtools}@^0.4.0` 透明升
|
|
106
109
|
- 访问了 → 改 `nextTick`
|
|
107
110
|
|