3 ms·
the code here is hyperscript, not htmx: https://hyperscript.org https://hyperscript.org i use hyperscript because I created it and like it, but the example co
by recursivedoubts 3y ago
the code here is hyperscript, not htmx:
https://hyperscript.org https://hyperscript.org
i use hyperscript because I created it and like it, but the example could just as easily use JavaScript, the point is to show that htmx respects custom validations
- benatkin 3y agoThe docs don't seem to suggest using it for non-trivial things without hyperscript. https://htmx.org/docs/ https://htmx.org/docs/ They do suggest being able to use it without learning a lot of hyperscript, but I see the same with Svelte, where you can get by on copying and pasting a great deal. https://learn.svelte.dev/ https://learn.svelte.dev/
- recursivedoubts 3y agomost of the examples don't have any hyperscript in them htmx generalizes HTML as a hypermedia, making any element a hypermedia control that can issue any type of HTTP request in response to any event and target any element in the DOM for replacement that's the concept, improve HTML, and it gives you quite a bit more than plain HTML, but it is intentionally constrained to not go beyond that for things beyond what that gives you, I am not afraid to recommend scripting: Fielding explicitly included scripting as an optional constraint his description of the REST-ful architecture of the web A good example of how we like to see scripting used w/ a hypermedia system is the Sortable.js demo, which shows htmx integrating w/ Sortable.js via events, the cleanest way to integrate hypermedia controls w/ client side scripting: https://htmx.org/examples/sortable/ https://htmx.org/examples/sortable/ we have a chapter on client-side scripting in hypermedia systems here: https://hypermedia.systems/book/client-side-scripting/ https://hypermedia.systems/book/client-side-scripting/
- benatkin 3y ago> for things beyond what that gives you, I am not afraid to recommend scripting I'm not suggesting that you don't. I'm suggesting that it's quite similar to SvelteKit, Remix, and now Next.js, and other form-friendly frameworks in what you'd need to know in order to do a non-trivial full stack JavaScript project that supports progressive enhancement.
- wild_egg 3y agoThe difference is that with HTMX you're not stuck in "full stack JavaScript" land. Any language that can generate HTML becomes a viable full stack option without the headaches of modern JS tools being forced into the mix.