what-devtools 0.12.3 → 0.13.0
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/package.json +2 -2
- package/src/DevPanel.jsx +5 -6
- package/src/index.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "what-devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Dev tools for What Framework — signal inspector, component tree, effect graph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"inspector"
|
|
21
21
|
],
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"what-core": "^0.
|
|
23
|
+
"what-core": "^0.13.0"
|
|
24
24
|
},
|
|
25
25
|
"author": "ZVN DEV (https://zvndev.com)",
|
|
26
26
|
"license": "MIT",
|
package/src/DevPanel.jsx
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Works WITHOUT MCP devtools connected.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { signal,
|
|
22
|
+
import { signal, onCleanup } from 'what-core';
|
|
23
23
|
import { subscribe, getSnapshot, getErrors, installDevTools, _suppressDevtools } from './index.js';
|
|
24
24
|
|
|
25
25
|
export function DevPanel() {
|
|
@@ -111,11 +111,10 @@ function DevPanelBody() {
|
|
|
111
111
|
|
|
112
112
|
// --- Tab: Overview ---
|
|
113
113
|
const renderOverview = () => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
// Everything below reads snapshot()/getHealth()/recentErrors() inside a
|
|
115
|
+
// thunk so it stays reactive. Four eager copies used to be taken here and
|
|
116
|
+
// then shadowed; had anything rendered them directly it would have frozen
|
|
117
|
+
// at first paint.
|
|
119
118
|
return (
|
|
120
119
|
<div style="padding:12px;">
|
|
121
120
|
{/* Health indicator */}
|
package/src/index.js
CHANGED
|
@@ -141,9 +141,11 @@ export function safeSerialize(value, depth = 0, seen) {
|
|
|
141
141
|
|
|
142
142
|
// DOM nodes
|
|
143
143
|
if (typeof Node !== 'undefined' && value instanceof Node) {
|
|
144
|
+
// id/className live on Element, not Node; a text or comment node has neither.
|
|
145
|
+
const el = /** @type {Element} */ (/** @type {unknown} */ (value));
|
|
144
146
|
const tag = value.nodeName?.toLowerCase() || 'node';
|
|
145
|
-
const id =
|
|
146
|
-
const cls =
|
|
147
|
+
const id = el.id ? `#${el.id}` : '';
|
|
148
|
+
const cls = el.className ? `.${String(el.className).split(' ')[0]}` : '';
|
|
147
149
|
return `[DOM: <${tag}${id}${cls}>]`;
|
|
148
150
|
}
|
|
149
151
|
|