Live data from Hacker News

Show HN: htmz – a low power tool for HTML

leanrada.com

91–100 of 256 posts

Re: Show HN: htmz – a low power tool for HTML

#91

That's a great hack and it shows how close the browser is to offering SPA natively. Just a few attributes and we could avoid the iframe. It's probably more useful to prove a point than an actual day to day tool. And the point seems to be: htmx is too much trouble for what it offers. We just need HTML native ajax.

Yes this was a response to htmx. It was a half-parody half-I wanna make it work project. Like https://github.com/vilgacx/aki I would fear if anyone wants to use this in production BUT I would love someone to get inspired and use the concepts rather than the actual code. Hmm maybe i should write a disclaimer...

I don't see why you wouldn't want someone to use this in production. This is pretty close to the way it should have been all along.

Re: Show HN: htmz – a low power tool for HTML

#92
post #18

Earlier quoted context omitted.

I use Disable JavaScript extension with js disabled by default and only enable it if website is broken. https://addons.mozilla.org/en-US/firefox/addon/disable-javas...

You should use uMatrix so you can only enable the scripts necessary to unbreak the site

[deleted]

Re: Show HN: htmz – a low power tool for HTML

#93

I happened to spend a little more time on htmx this weekend which htmz was inspired by. htmx/htmz does do well for simple use cases, htmx does well for SSR heavy cases(e.g. django). in the end I returned to vue.js, with a few lines code(put in a library) I can mimic htmx easily plus all the extra stuff vue.js brings, and no I do not need use a build tool for that, vuejs works fine via CDN inside a html for simple use…

This. I think Vue.js "scales down" excellently. You can just load it via the cdn and write some widgets and go about your day. In the past I've tried to make use of "microframeworks" like alpine.js and such but often found myself returning to Vue.js.

same here, spent lots of time poking around, even tried svelte and react.js(heavily), and now firmly back to vue.js.

vue.js does not mix SSR with SPA into one, make it much simpler compare to what React.js is doing today, and it provides way more than alpine.js and htmx etc, it's the best one in practice for me now.

Re: Show HN: htmz – a low power tool for HTML

#94
post #78

This looks neat! I've never really been in to web development, but I'm curious... is it possible to create a standalone .html file for a browser-delivered app? Like, not just PWA or SPA, but... a single HTML App? If I had modest amount of data in JSON baked into html, what's the barrier to something interesting, say... implementing a minimal spreadsheet or maybe just a sortable/filterable table?

> This looks neat! I've never really been in to web development, but I'm curious... is it possible to create a standalone .html file for a browser-delivered app? Like, not just PWA or SPA, but... a single HTML App?

Yes, you can include your JavaScript and CSS directly inside the [0] and [1] tags, so you don't need to include any other file. Images like PNG, JPEG, ... can be either embedded with a base64 data URL [2] or an SVG with the SVG tag [3].

> what's the barrier to something interesting, say... implementing a minimal spreadsheet or maybe just a sortable/filterable table?

Well, you could go the easy route and use an already existing JavaScript library for this. Libraries are normally included via a URL, but you can just copy the contents of this library into the script tag as mentioned above.

Otherwise, I think it's manageable to do develop it yourself (sortable/filterable tables) much knowledge, but frontend development can be a PITA very fast

[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/st...

[2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_...

[3] https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg

Re: Show HN: htmz – a low power tool for HTML

#95

This is a glorious demonstration of someone really understanding the platform. I don't expect I would ever use it, but I think it's excellent.

Understanding or not, certain decisions like overriding the semantic meaning of a hash in a url doesn't seem to be working with the platform. A better version would be adding a target to a `data-` attribute. It's a fun project overall, though.

OP addresses this at “We can do a hack that enables you to write the target ID selector in the target attribute itself!”

Re: Show HN: htmz – a low power tool for HTML

#96

It's a fun one liner, but what is the use case? When I want to replace some element using JS as the user clicks a link , it is progressive enhancement. Usually links enable history navigation. If you do stuff like this, you need to code it in a way that uses the history API to fix it for users with JS enabled (majority of users). If you don't want history navigation and URLs, why do you use links? This breaks history…

It can be used in Markdown with HTML enabled but JavaScript disabled.

Re: Show HN: htmz – a low power tool for HTML

#97

That's a great hack and it shows how close the browser is to offering SPA natively. Just a few attributes and we could avoid the iframe. It's probably more useful to prove a point than an actual day to day tool. And the point seems to be: htmx is too much trouble for what it offers. We just need HTML native ajax.

I'm the creator of htmx and think this is a great library/snippet. Much closer to what htmx-like functionality in HTML would/should look like in that it is following existing norms (iframes, the target attribute) much more closely than htmx. From a practical perspective, a lot of the bulk of htmx is bound up in things like history support, collecting inputs, a lot of callbacks/events to allow people to plug into thin…

Love the fact that you care more about the tech than HTMX winning. I like htmx a lot though

Re: Show HN: htmz – a low power tool for HTML

#98

Earlier quoted context omitted.

Understanding or not, certain decisions like overriding the semantic meaning of a hash in a url doesn't seem to be working with the platform. A better version would be adding a target to a `data-` attribute. It's a fun project overall, though.

OP addresses this at “We can do a hack that enables you to write the target ID selector in the target attribute itself!”

I'm only addressing the comment on "a glorious demonstration" of understanding the platform, where hacks like this go against such a take (IMO)

Re: Show HN: htmz – a low power tool for HTML

#99
post #18

Earlier quoted context omitted.

I use Disable JavaScript extension with js disabled by default and only enable it if website is broken. https://addons.mozilla.org/en-US/firefox/addon/disable-javas...

You should use uMatrix so you can only enable the scripts necessary to unbreak the site

I use NoScript for this as well, I’ll have to check out uMatrix.

Re: Show HN: htmz – a low power tool for HTML

#100
post #78

This looks neat! I've never really been in to web development, but I'm curious... is it possible to create a standalone .html file for a browser-delivered app? Like, not just PWA or SPA, but... a single HTML App? If I had modest amount of data in JSON baked into html, what's the barrier to something interesting, say... implementing a minimal spreadsheet or maybe just a sortable/filterable table?

> This looks neat! I've never really been in to web development, but I'm curious... is it possible to create a standalone .html file for a browser-delivered app? Like, not just PWA or SPA, but... a single HTML App? Yes, you can include your JavaScript and CSS directly inside the [0] and [1] tags, so you don't need to include any other file. Images like PNG, JPEG, ... can be either embedded with a base64 data URL [2]…

That’s how TiddlyWiki works for example: https://classic.tiddlywiki.com/
Post reply on HN