Skip to content

Commit d0ca27e

Browse files
committed
fix: improve mount tracking for cached elements
- Ensure MeoNodeUnmounter wraps all renderable nodes - Fix mount/unmount tracking consistency - Update navigation cache manager to work without prop caching
1 parent d7baa16 commit d0ca27e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/components/meonode-unmounter.client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export default function MeoNodeUnmounter({ children, ...props }: { node: NodeIns
2727

2828
const onUnmount = useEffectEvent(() => {
2929
if (node.stableKey) {
30+
// Get the cache entry to access propSignatures before deleting
31+
// const cacheEntry = BaseNode.elementCache.get(node.stableKey)
32+
33+
// Delete the element cache entry
3034
BaseNode.elementCache.delete(node.stableKey)
3135

3236
if (MountTrackerUtil.isMounted(node.stableKey)) {

src/util/navigation-cache-manager.util.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export class NavigationCacheManagerUtil {
7979
const debounceMs = cacheSize < 100 ? 50 : cacheSize < 500 ? 100 : 200
8080

8181
this._cleanupTimeout = setTimeout(() => {
82-
const propsSize = BaseNode.propProcessingCache.size
8382
let unmountedElementsCleaned = 0
8483

8584
// Only clean UNMOUNTED elements
@@ -91,13 +90,8 @@ export class NavigationCacheManagerUtil {
9190
}
9291
})
9392

94-
// Only clear props cache if it's large enough
95-
if (propsSize > 200) {
96-
BaseNode.propProcessingCache.clear()
97-
}
98-
9993
if (__DEBUG__) {
100-
console.log(`[MeoNode] Navigation: cleared ${unmountedElementsCleaned} unmounted elements, ${propsSize} props entries`)
94+
console.log(`[MeoNode] Navigation: cleared ${unmountedElementsCleaned} unmounted elements`)
10195
}
10296
}, debounceMs)
10397
}

0 commit comments

Comments
 (0)