3 ms·
I do this. It’s surprisingly effective, both in actual performance and developer productivity. The one area where it is useless however is for mutating DOM. It’
by mstade 9y ago
I do this. It’s surprisingly effective, both in actual performance and developer productivity. The one area where it is useless however is for mutating DOM. It’s easy enough to create DOM using template strings, but if you say need to render something and then mutate it later on in you render function, it becomes terrible since you either have to do tricky string manipulation, actually create the DOM and use methods to mutate it, or use some framework at which point you may as well just give up on template strings altogether.
But for any case where you’re basically going in the one direction, i.e. data -> DOM and not changing things once rendered it’s great.
- reificator 9y agoI have no personal experience with it, but Google's been toying with this project: https://github.com/PolymerLabs/lit-html https://github.com/PolymerLabs/lit-html Might help with some of those pain points
- pteredactyl 9y agoSame experience here.