Live data from Hacker News

Htmx 1.0.0 Release

htmx.org

1–10 of 62 posts

Re: Htmx 1.0.0 Release

#3
> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx

I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs

You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long as it begins with `data-`.

https://html.spec.whatwg.org/multipage/dom.html#embedding-cu...

Re: Htmx 1.0.0 Release

#4
Congratulations on the release, i have been following htmx for a while and whilst have yet to use it, conceptually i think the ideas are solid.

I think the trend towards SPAs and everything is Javascript/JSX has created a situation where people build SPAs then add SSR as an afterthought.

This is anathema to the ideas of document driven web pages and i think htmx could be a good middle ground. Of course for some applications SPAs are the correct choice but I see many people reaching for them as the default rather than creating pages and enhancing when necessary.

I am working on some tooling in this space and hope to see how htmx could fit into progressively enhanced websites.

Re: Htmx 1.0.0 Release

#5
post #3

> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long…

I agree, the `data-` variant should be enforced so that the markup is always valid.

Re: Htmx 1.0.0 Release

#7
post #3

> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long…

Practically, you are allowed to do so.

I understand both sides of the argument, so I set it up so you could choose which one you preferred. I don't see a reason to force my preferences on anyone.

Re: Htmx 1.0.0 Release

#8
post #3

> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long…

But prepending with data can be annoying both from a "quickly reading" perspective, and an aesthetic one. The goal isn't to provide valid HTML necessarily but just allow the library to parse it correctly.

Re: Htmx 1.0.0 Release

#9
post #3

> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long…

I don't know why people who make frameworks either prefer invalid HTML

I’m guessing people do this to make it less likely to have a name conflict with a custom attribute used by another library.

Post reply on HN