Live data from Hacker News

Show HN: htmz – a low power tool for HTML

leanrada.com

151–160 of 256 posts

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

#151

Earlier quoted context omitted.

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...

It's funny, I stumbled on a similar use for iframes a few years ago that I did put into production. I needed to have a rather large SPA for employees hosted locally - that is, on a server on a local network in retail stores, not accessible from the web or unless you're on the same network as the server. The employee had to be able to load it on a tablet (but wouldn't necessarily know the server's local, dynamically a…

Pretty sure recent browser security features will break that.

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

#152
post #57

In 2001 or so, I was building an HTML based email client. We used a hidden iframe to execute JS to load data from the server and manipulate the DOM with the result. It was not quite as neat and elegant as this—the browser support was not there. However, the basic mechanism was the same. It warms my heart to see the basic mechanism in such a compact package, without libraries upon libraries and machinations to make th…

[deleted]

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

#153
post #135

Earlier quoted context omitted.

> I never found a way for a server to check if the originating request is for an iframe or a new tab. There is no such technique. One way to distinguish is to pick a URL convention and modify the URL (before the hash) of the iframe URL. For example, add ?iframe=true to the URL, and then have the server check for that. Perhaps more usefully you could include information about the parent URL, e.g. url += '?parent=${doc…

Can we add a cookie instead of modifying URLs?

No. The same cookies are added to both the host and guest pages.

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

#154

This is great. I had an idea to use named iframes and targeted forms for simple, server-rendered pages with built-in style-scoped widgets, without leaning into complex JS client-side. But, I never simplified it well nor expressed a polished and elegant realization of that idea, as this htmz looks to me to be. A reminder to never give up good ideas, focus on excellence, and focus on refinement to a completion of an id…

I am a little bit confused because your comments seem to imply initially that htmz is written by someone other than you, and then later that you wrote htmz. Who are you and what is your relationship with htmz and its creators? Please be honest and refrain from violating federal law and FTC guidelines in your response.

[deleted]

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

#155
post #115

This seems snappy from the US but I doubt someone in say NZ will have a good experience. Going back and forth between the client and the server on every interaction can result in terrible UX. Users will be happy waiting 1-2 seconds after submitting a form but waiting that much to switch a tab is not gonna fly. Plus there's internet weather etc which might result in unpredictable latencies over long distances. Yes, yo…

Texting from NZ: I don’t know how snappy your experience is but all I can say is that we‘re used to slower websites here in New Zealand. Switching between the tabs and having a <1sec delay is totally acceptable imho. It doesn’t feel „instant“ but instant enough!

[dead]

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

#156

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.

Just use target, if it starts with #, it's replacement, otherwise behaves as is.

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

#157
post #88

Earlier quoted context omitted.

It is maintained but the UI for dealing with JS is horribly time consuming and overly complex compared to uMatrix. I'll never really understood it and I keep using uMatrix on my laptop. I switched to NoScript on my phone. Maybe I can install uMatrix now if Mozilla really unblocked many extensions. If uMatrix stops working, I'll switch to NoScript everywhere for JS and uBO for all the other issues.

I've never used uMatrix what can uMatrix do what uBlock can't? I have set all sites to no js, and if something does not work I click the JS toggle in the menu, reload the page and thats it. And yes uMatrix should work on Firefox on Android. ( At least it is installable)

uMatrix has a spreadsheet like matrix of features and sites. It's immediately clear what happens when I click a cell, a column or a row. With uBO I don't even understand where to click to toggle JS for one of the sites a page got scripts from. I learned it years ago but it was too cumbersome. I kept using uMatrix and I forgot it. I attempted to use it again now and I couldn't find anything. I didn't google for it.

I installed uMatrix on my phone and disabled NoScript. Of course I keep using uBO for filtering out ads and hiding annoying parts of sites with the element picker.

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

#158

I think you can use null instead of ':not(*)' in the query selector, if only to make it a bit shorter and maybe a bit faster.

Nice, it works! I was a bit scared here because the querySelector() MDN docs say

> A string containing one or more selectors to match. This string must be a valid CSS selector string; if it isn't, a SyntaxError exception is thrown.

I'll test it out. If this works good, we shave off 5 bytes towards a 176-byte snippet!

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

#159

Reusing the element like this is a bad idea - it has very specific behavior in browsers. In a shadow root it'll be replaced by the children of the host element, no matter what the library does. HTML already has an inert element for things like this.

Thanks for the suggestion, I'll update the examples. Edit: that is, after I wake up...

Woke up... It's at the top of HN...

Anyway I chose div instead thanks to the other commenter https://github.com/Kalabasa/htmz/commit/153a5a448b60a0898604...

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

#160

This is great. I had an idea to use named iframes and targeted forms for simple, server-rendered pages with built-in style-scoped widgets, without leaning into complex JS client-side. But, I never simplified it well nor expressed a polished and elegant realization of that idea, as this htmz looks to me to be. A reminder to never give up good ideas, focus on excellence, and focus on refinement to a completion of an id…

I am a little bit confused because your comments seem to imply initially that htmz is written by someone other than you, and then later that you wrote htmz. Who are you and what is your relationship with htmz and its creators? Please be honest and refrain from violating federal law and FTC guidelines in your response.

You seem to have misinterpreted "[those comments] are exactly what I hoped to hear reflected about my creation". They weren't saying "I enjoyed hearing those comments about htmz, which is a thing I created" - they were saying "those comments are what I _had_ hoped to hear about my (unreleased and unnamed) creation, which indicates that htmz is a good implementation of a similar idea that I had"
Post reply on HN