ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
858 stars 125 forks source link

Fix `/*@once*/` only works with first child of object #258

Closed titoBouzout closed 11 months ago

titoBouzout commented 1 year ago

Related to #252

Somehow figured that the problem was that removing the comment makes the expression dynamic again for the next object evaluated. That's why it works once and then stops working.

Added a test expecting the effect to not be present.

The effect will be present even in the presence of @once if you use a spread, which I didn't figure how to handle nor what to expect to be honest. I didn't add a test for it because it will fail.