3 ms·
Just a quick answer to a point that jumped at me: for an array of signals, you wouldn’t need to map them, you’d use a specialised directive that directly takes
by jdkoeck 1y ago
Just a quick answer to a point that jumped at me: for an array of signals, you wouldn’t need to map them, you’d use a specialised directive that directly takes an array of signals and binds them to the DOM, the same way lit uses the repeat() directive to optimise the rendering of arrays.
https://lit.dev/docs/templates/lists/#the-repeat-directive https://lit.dev/docs/templates/lists/#the-repeat-directive
- MrJohz 1y agoHmm, I really don't like the idea that you would have these kinds of directives as specialised tools, rather than having a single standard approach. From experience, it's often hard to explain the differences between these sorts of different directives, especially if someone is coming from a React/VDOM perspective where everything Just Works™. This feels like a very significant impedance mismatch that will cause problems in practical usage.
- jdkoeck 1y agoOn the contrary, I think this a very practical escape hatch that will let frameworks insert optimisations where they need to. I don’t know if React really Just Works these days, the VDOM has real overhead and developing with React feels like playing whack-a-mole with rerenders these days.