leaky proxy nodes when morphing
See original GitHub issueNot sure if we want this issue here or in nanomorph, but looks like proxy nodes are leaked when a component is morphed to a new location in the dom. For example, if these two views are morphed, a proxy node will be rendered rather than the component:
function viewA (state, emit) {
return html`
<body>
<a href="/">beep</a>
<a href="/boop">boop</a>
<div>
${component.render()}
</div>
</body>
`
}
function viewB (state, emit) {
return html`
<body>
<a href="/">beep</a>
<a href="/boop">boop</a>
${component.render()}
</body>
`
}
You can see this behavior here:
- Demo: https://choo-leaky-proxy.glitch.me
- Code: https://glitch.com/edit/#!/choo-leaky-proxy?path=index.js:1:0
Also interesting to note if the component’s update function returns true
, the component will leak the proxy node on first morph, while subsequent morphs will correctly return the component.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Wordle Analysis: 'leaky'
Wordle Analysis: leaky. Worst case words remaining: 872. Expected words remaining: 397.798. Information provided: 4.78639. (1 words) : leaky
Read more >Proxy for cluster nodes - BlackCat Reasearch Facility
Problem Failover Cluster validation genereates a warning in the Storage section under “Validate CSV Settings”. The error message states: Failure ...
Read more >EP2575313A1 - Morphing firewall - Google Patents
A firewall system and corresponding firewall method are described for protecting a trusted network against unauthorized access from an untrusted network.
Read more >Reply To: Error with the morphing wing simulation
... mesh-motion, mesh-nodes, mesh-problem, mesh-quality, mesh-refinement, Mesh-sensitivity ... proportional-damping, proximity, proximity-effect, proxy ...
Read more >Ways to Check if Your Proxy Is Leaking Your IP Address
Nonetheless, the client can sometimes bypass the proxy IP address, resulting in a torrent IP leak. Check for torrent IP leaks using torrent ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
realNode
in theproxyNode
when its created so that it can be retrieved or returned fromisSameNode
or off of another property of the proxy.e.g.
if (isProxy(proxyNode) && !proxyNode.isSameNode(el)) replace(el, proxyNode.realNode)
I think we could add a fairly easy work around into nanomorph.
The problem occurs when you create a
diffTree
withproxyNode
s, and during the morph, therealNode
that theproxyNode
points to is removed prior to theproxyNode
getting morphed into therealDom
. Child re-ordering can typically handle a lot of these situations, but if theproxyNode
is pointing to arealNode
that isn’t in therealTree
or apart of its sibling set of therealTree
, nanomorph leaksproxyNode
s.Two ideas:
When nanomorph receives a
diffTree
,querySelectAll
a standard proxy identifier prior to morphing and use that to store references to therealNode
s that theproxyNode
is pointing at. In the event nanomorph wants to replace arealTree
node with aproxyNode
, check if we have a reference to thisrealNode
that was removed from the tree and use that instead. 👍Have nanocomponent proxy nodes detect if they are ever put into the page and nanomorph the proxy back into whatever its supposed to be by storing a direct node reference every time the
this.element
getter is used. Would likely require on-load in all cases 👎I think 1 is a more robust solution, but it could be a departure from the
isSameNode
idea we’ve been trying to stick to.This would still be very fast.
The only remaining issue with nanomorph after we fix the leaking nodes is that child reordering has some worse case scenarios, e.g. where the entire sibling set morph cascades the entire set, rather than simple insertions and removals, which a diff set algorithm would fix. See http://nanomap.netlify.com for some examples of this.