You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The server-side fingerprint-based refactor (livetemplate/livetemplate#86) eliminates the need for StaticsMap (sm) support in the client. Heterogeneous ranges (items with different templates) now use full replacement instead of per-item statics lookup.
This issue tracks the cleanup of ~35-50 lines of dead code that can be safely removed.
Background
Server Change: The server now uses structure fingerprints to determine when to send statics, replacing the complex registry-based path tracking. For heterogeneous ranges, instead of sending StaticsMap with per-item statics, the server sends a full tree replacement.
Client Impact: The StaticsMap (sm) field and _sk (statics key) handling code will never execute but won't cause errors. This is safe to remove for cleaner code.
Dead Code to Remove
1. RangeStateEntry.staticsMap field
File:state/tree-renderer.ts (line 7)
// Remove this fieldinterfaceRangeStateEntry{items: any[];statics: any[];staticsMap?: Record<string,string[]>;// ← REMOVE}
// Lines 509, 516-518 - REMOVE this blockconsthasStaticsMap=staticsMap&&typeofstaticsMap==="object";if(statics&&Array.isArray(statics)){returndynamics.map((item: any,itemIdx: number)=>{letitemStatics=statics;// REMOVE: This block is now dead codeif(hasStaticsMap&&item._sk&&staticsMap[item._sk]){itemStatics=staticsMap[item._sk];}// ... rest stays});}
// Lines 728-735 - REMOVE staticsMap parameter and _sk lookupprivaterenderItemsWithStatics(items: any[],statics: string[],staticsMap?: Record<string,string[]>,// ← REMOVE parameterstatePath?: string
): string {// REMOVE: This check is now dead codeif(staticsMap&&typeofstaticsMap==="object"&&item._sk&&staticsMap[item._sk]){itemStatics=staticsMap[item._sk];}}
Verification
Before removing this code, verify:
Server v0.8.0 is released and stable
No sm fields appear in WebSocket messages (can check via browser dev tools)
Summary
The server-side fingerprint-based refactor (livetemplate/livetemplate#86) eliminates the need for
StaticsMap(sm) support in the client. Heterogeneous ranges (items with different templates) now use full replacement instead of per-item statics lookup.This issue tracks the cleanup of ~35-50 lines of dead code that can be safely removed.
Background
Server Change: The server now uses structure fingerprints to determine when to send statics, replacing the complex registry-based path tracking. For heterogeneous ranges, instead of sending
StaticsMapwith per-item statics, the server sends a full tree replacement.Client Impact: The
StaticsMap(sm) field and_sk(statics key) handling code will never execute but won't cause errors. This is safe to remove for cleaner code.Dead Code to Remove
1.
RangeStateEntry.staticsMapfieldFile:
state/tree-renderer.ts(line 7)2.
smdestructuring and storageFile:
state/tree-renderer.tsstaticsMap: rangeStructure.sm,staticsMap: rangeStructure.sm,staticsMap: value.sm,const { d: dynamics, s: statics, sm: staticsMap } = rangeNode;staticsMap: rangeData.staticsMap,sm: rangeData.staticsMap,sm: this.rangeState[stateKey].staticsMap,3.
hasStaticsMapand_sklookup logicFile:
state/tree-renderer.tsVerification
Before removing this code, verify:
smfields appear in WebSocket messages (can check via browser dev tools)Estimated Impact
Related
docs/SIMPLIFIED_DIFF_PROPOSAL.md→ "Client Compatibility Analysis" section