2 ms·
Well, as I expected, templating is the hardest part of migrating to htmx on nodejs. After reviewing few templaters/etc (handlebars, ejs, lit-html, virtual-dom)
by wruza 2y ago
Well, as I expected, templating is the hardest part of migrating to htmx on nodejs.
After reviewing few templaters/etc (handlebars, ejs, lit-html, virtual-dom) and few abstractions (html``, just ``, h()), barely anything seems too easy and too freedom-y. Arcane syntaxes, high character noise (ejs, lit, js), lack of typing (all non-`` based), trivial screw ups (virtual-dom, handlebars), experimental status (lit ssr). Sigh.
- unsupp0rted 2y agoThis was my experience as well. No great template generator on the node side. I use PUG. I don’t like to close HTML tags. This cuts 30% of the visual bloat out of my templates.
- michaelcampbell 2y agoremovingspacesgotridofalotofmybloatonregulartexttoo. One man's structure is another man's "bloat", I guess.
- unsupp0rted 2y agoPUG actually adds spaces: it's indentation based. What it removes is the visual bloat of closing html tags. So instead of: <div id='foo' class='bar baz'> <p>Some content</p> </div> <div id='foo2' class='bar2 baz2'> <p>More content</p> <p>Another paragraph</p> </div> In PUG you do: #foo.bar.baz p Some content #foo2.bar2.baz2 p More content p Another Paragraph Even without syntax highlighting, it's plain at a glance where markup stops and content starts in PUG. And it's easier to visually parse element IDs and chained classes this way too.