ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
850 stars 122 forks source link

Fix insertExpression throw #307

Open danieltroger opened 6 months ago

danieltroger commented 6 months ago

Mends part one of https://github.com/solidjs/solid/issues/2030 by selectively walking around that specific case

Tested and actually fixes the issue. Working test reproduction with yarn patch here: yarn && yarn dev

bug-test.zip

danieltroger commented 5 months ago

@ryansolid did you have time to take a look here? :)

ryansolid commented 5 months ago

Understanding this, this is guarding specifically around trying to insert the parent in itself. Like the check is one level deep. I suppose that is all we need, because it is fragments that are breaking this. Actually no that isn't the case. This would break again as soon as the parent doesn't equal the inserted element. We could trace up but I think this needs some more though. Need to get back to the basis of why we grabbing the parent this way. I'm a bit foggy its been like 6 years since I wrote this code.