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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "what-devtools",
3
- "version": "0.12.3",
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.12.3"
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, effect, onCleanup } from 'what-core';
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
- const data = snapshot();
115
- const health = getHealth();
116
- const errs = recentErrors();
117
- const recentErrs = errs.slice(-3).reverse();
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 = value.id ? `#${value.id}` : '';
146
- const cls = value.className ? `.${String(value.className).split(' ')[0]}` : '';
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