Template Literals are amazing, but I've lately found they make everything look like a proverbial nail, particularly when it comes to updating large...
For further actions, you may consider blocking this person and/or reporting abuse
If I understood correctly this article, I think lit-html is (close) to what you're looking for.
Thanks, I'll give it a look. I've seen lit-html mentioned repeatedly in connection with htm in fact it was htm's latest release that got me thinking about all this. But from what I can understand htm is only usable in a preact/react environment.
At first glance I can't seem to see how to load a lit template from the DOM. My goal here is to write a JS component which contains no markup, but takes the markup it needs from the DOM. lit apparently does use
<template>
tags, but only as a background technique, not a primary source for rendering.Oh I get it now. Nothing "lightweight" comes to mind.
I guess the closest thing that you could do with lit-html is evaluate the template somehow.
Don't do this at home.
Just discovered the Template Instantiation spec which is essentially proposing exactly this:
github.com/w3c/webcomponents/blob/...
Hi! I think what you need is eval. While it is not a full template system, I can solve most of the problems I face while making single page apps.