sitesmith: strip diagnostic shim + state-dump now that the fix is verified
Apply path is stable end-to-end with the linkedNode pre-creation patch; diagnostic shim + window.__sitesmithLastState dump are no longer earning their footprint. Reverts: - vite.config.ts: drops the tiny-invariant alias - src/utils/tiny-invariant-shim.ts: deleted - PageContext.tsx: removes the post-walk dump/scan block
This commit is contained in:
@@ -383,25 +383,6 @@ export const PageProvider: React.FC<{ children: ReactNode }> = ({ children }) =>
|
||||
return id;
|
||||
};
|
||||
const rootId = walk(tree, null);
|
||||
// DIAGNOSTIC: dump the produced state + scan for type=undefined nodes
|
||||
// so when the resolver invariant fires we can see which node is bad.
|
||||
try {
|
||||
const w = window as any;
|
||||
w.__sitesmithLastTree = tree;
|
||||
w.__sitesmithLastState = nodes;
|
||||
const bad: Array<{id:string; node:any}> = [];
|
||||
for (const [nid, n] of Object.entries(nodes)) {
|
||||
const t = (n as any).type;
|
||||
const name = t && typeof t === 'object' ? t.resolvedName : t;
|
||||
if (!name) bad.push({ id: nid, node: n });
|
||||
}
|
||||
if (bad.length > 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[SITESMITH] nodes with undefined type:', bad);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('[SITESMITH] treeToState produced', Object.keys(nodes).length, 'nodes; rootId=', rootId);
|
||||
} catch (_e) { /* diagnostic only */ }
|
||||
// Craft.js deserialize requires the root node keyed as 'ROOT'
|
||||
if (rootId !== 'ROOT') {
|
||||
nodes['ROOT'] = nodes[rootId];
|
||||
|
||||
Reference in New Issue
Block a user