4 ms·
We’re talking about templates in the context of component libraries. In particular, I’m highlighting the template languages of smaller, more capable component l
by halostatue 4y ago
We’re talking about templates in the context of component libraries. In particular, I’m highlighting the template languages of smaller, more capable component library systems than React — Vue (2 and 3) and Svelte. In both Svelte and Vue (both versions), Single File Components are the standard. Yes, there’s logic in your template, but it’s closely related to the core business logic, and it reads a lot better than embedded logic in JSX droppings.
On the rest of it, I’d agree that a lot of the JavaScript-based pure templating languages don’t really work well, but IMO that has more to do with JavaScript than the templating languages. I find EEX (Elixir), ERB (Ruby), and Jinja (Django-ish, plus others), Liquid (Ruby / Shopify), and Text Templates (Go) to all be pretty good for what they do — and most of them are templating languages that can be applied to HTML, but are not HTML "native" templating languages (even though some have HTML "native" variants, e.g., HTML templates for Go).