Skip to content

Commit c366b10

Browse files
committed
more logging
1 parent 78e966c commit c366b10

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

packages/qwik/src/core/client/vnode.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ import { TextVNode } from '../shared/vnode/text-vnode';
173173
import { VirtualVNode } from '../shared/vnode/virtual-vnode';
174174
import { VNodeOperationType } from '../shared/vnode/enums/vnode-operation-type.enum';
175175
import { addVNodeOperation } from '../shared/vnode/vnode-dirty';
176+
import { isCursor } from '../shared/cursor/cursor';
176177

177178
//////////////////////////////////////////////////////////////////////////////////////////////////////
178179

@@ -1801,6 +1802,15 @@ export function vnode_toString(
18011802
} else if (vnode_isElementVNode(vnode)) {
18021803
const tag = vnode_getElementName(vnode);
18031804
const attrs: string[] = [];
1805+
if (isCursor(vnode)) {
1806+
attrs.push(' cursor');
1807+
}
1808+
if (vnode.dirty) {
1809+
attrs.push(` dirty:${vnode.dirty}`);
1810+
}
1811+
if (vnode.dirtyChildren) {
1812+
attrs.push(` dirtyChildren[${vnode.dirtyChildren.length}]`);
1813+
}
18041814
const keys = vnode_getAttrKeys(vnode);
18051815
keys.forEach((key) => {
18061816
const value = vnode_getProp(vnode!, key, null);

packages/qwik/src/core/debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function qwikDebugToString(value: any): any {
3535
stringifyPath.push(value);
3636
if (Array.isArray(value)) {
3737
if (vnode_isVNode(value)) {
38-
return '(' + vnode_getProp(value, DEBUG_TYPE, null) + ')';
38+
return '(' + (vnode_getProp(value, DEBUG_TYPE, null) || 'vnode') + ')';
3939
} else {
4040
return value.map(qwikDebugToString);
4141
}
@@ -52,7 +52,7 @@ export function qwikDebugToString(value: any): any {
5252
} else if (isJSXNode(value)) {
5353
return jsxToString(value);
5454
} else if (vnode_isVNode(value)) {
55-
return '(' + vnode_getProp(value, DEBUG_TYPE, null) + ')';
55+
return '(' + (vnode_getProp(value, DEBUG_TYPE, null) || 'vnode') + ')';
5656
}
5757
} finally {
5858
stringifyPath.pop();

packages/qwik/src/core/shared/cursor/cursor-walker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import { VNodeFlags } from '../../client/types';
3535
import { isPromise } from '../utils/promises';
3636
import type { ValueOrPromise } from '../utils/types';
3737

38+
const DEBUG = true;
39+
3840
const nextTick = createNextTick(processCursorQueue);
3941
let isNextTickScheduled = false;
4042

@@ -138,6 +140,7 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
138140

139141
let count = 0;
140142
while ((currentVNode = getCursorPosition(cursor))) {
143+
DEBUG && console.warn('walkCursor', currentVNode.toString());
141144
if (count++ > 100) {
142145
throw new Error('Infinite loop detected in cursor walker');
143146
}
@@ -188,6 +191,7 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
188191

189192
// Handle blocking promise
190193
if (result && isPromise(result)) {
194+
DEBUG && console.warn('walkCursor: blocking promise', currentVNode.toString());
191195
// Store promise on cursor and pause
192196
setVNodePromise(cursor, result);
193197
// pauseCursor(cursor, currentVNode);

packages/qwik/src/core/shared/vnode/vnode-dirty.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getDomContainer } from '../../client/dom-container';
21
import { addCursor, findCursor } from '../cursor/cursor';
32
import { getCursorPosition, setCursorPosition } from '../cursor/cursor-props';
43
import { findContainerForVNode } from '../cursor/cursor-walker';
@@ -52,7 +51,7 @@ export function markVNodeDirty(container: Container | null, vNode: VNode, bits:
5251
try {
5352
container = findContainerForVNode(vNode)!;
5453
} catch {
55-
console.error('markVNodeDirty: unable to find container for', vNode);
54+
console.error('markVNodeDirty: unable to find container for', vNode.toString());
5655
return;
5756
}
5857
}

0 commit comments

Comments
 (0)