Re:Htmx 2.0.0 has been released
by unsupp0rted on Tuesday June 18, 2024 @07:22AM
(#40716431)
This 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.
Re:Htmx 2.0.0 has been released
by michaelcampbell on Tuesday June 18, 2024 @08:55AM
(#40717270)
removingspacesgotridofalotofmybloatonregulartexttoo.
One man's structure is another man's "bloat", I guess.
Re:Htmx 2.0.0 has been released
by unsupp0rted on Tuesday June 18, 2024 @10:38AM
(#40718358)
PUG 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.
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.