4 ms·
howdy, I'm the creator of htmx, happy to talk about it
by recursivedoubts 4y ago
howdy, I'm the creator of htmx, happy to talk about it
- sureglymop 4y agoTwo questions. What would you recommend to build the backend in, some language that can parse xml/html well? And second question, are there any more extensive examples such as working authentication?
- silver-arrow 4y agoThat’s part of the benefit of htmx and it’s hypermedia approach, you can build the backend in anything you prefer. Some like using language and frameworks that use templates. Others, like we do, used fairy basic HTML generation libraries. We love Clojure so we use the Hiccup library to generate HTML. We use the full power of clojure and functions to build reusable HTML type components and their fragments.
- amne 4y agohx-post .. what? hx-put .. what? hx-delete .. what? I stopped scrolling as soon as I noticed I have to ask myself what am I posting to this URL? Maybe digging deeper I could find the reference docs explaining in very vague terms where the payload is coming from. But this was supposed to be simple.
- whichdan 4y agohttps://htmx.org/docs/#parameters https://htmx.org/docs/#parameters Simple doesn't mean "I should be able to intuitively understand this with under a minute of reading"...
- amne 4y agoWith so many tools floating in this space the landing page MUST be clear enough. Sorry.
- recursivedoubts 4y agohere is the landing page: https://htmx.org https://htmx.org the link here is to the docs, which is more involved
- KyeRussell 4y agoThis project has seemingly picked up a bunch of traction. The number of times it has appeared on the front page of this website serves as some indication, as well as the plethora of conference talks. You seemed unwilling to put more than 2 minutes into looking at an example, or 10 seconds into checking what page you were on, yet felt that your experience warranted these dismissive comments which cumulatively proportionally surely took up just as much time. You aren’t acting in good faith. This doesn’t add to the conversation at all.
- strangus 4y agoI hate web dev, but this gives me hope.
- tiffanyh 4y agoWould you characterize htmx as the successor to AJAX?
- recursivedoubts 4y agoI would say htmx is how I think HTML should work as a hypermedia, to make it possible to build more interactive applications within that paradigm.
- deleted 4y ago[deleted]
- francoisdevlin 4y agoGRUG? Is that you?
- recursivedoubts 4y agowell of course I know him he's me
- decross 4y agoin a way, he's all of us
- agentwiggles 4y agothis grug much appreciate wise senior grug's advice. thanks for many laugh!
- francoisdevlin 4y agoYou need to start merchandising. Complexity very, very, bad.
- mhitza 4y agoQuick question, as it made me curious. Can I send the content that I want to swap to the server itself? Say I want to submit a form to the backend, will it only send form fields or is there a way to send the form html itself?
- recursivedoubts 4y agothat would probably be best accomplished w/ a custom htmx:configRequest handler: https://htmx.org/events/#htmx:configRequest https://htmx.org/events/#htmx:configRequest you could jam the outerHTML of the detail.target into the detail.parameters map, maybe based on the presence of an attribute...
- mhitza 4y agoI'm gonna make a note on that when I have cycles to burn to experiment with htmx. From my understanding of reading that section, parameters being a container of kv pairs, I'd have to hack on the internals of htmx for it to be able to send a pure string (not form/multipart) as the body of a post/put request. If I get around of experimenting with that, and it fits my flow, would that be something you'd accept back into the project as a contribution to the code?
- recursivedoubts 4y agoi don't think you'd need to hack the internals, you just hook into that event to do what you need: htmx.on("htmx:configRequest", function(evt) { evt.detail.parameters['my-html'] = evt.target.outerHTML; // or whatever } you can jump on the discord and we can help you out when the time comes: https://htmx.org/discord https://htmx.org/discord
- artificialLimbs 4y agoWhy would you do that? Curious about use case.
- mhitza 4y ago
- jonomacd 4y agoI love the model. I've been writing a golang app with the standard library template system and it works really well. One bit I've found slightly unintuitive is the swap and settled states. Took my a while to animate in a sidebar how I wanted. It was my fault for not groking it faster but perhaps some more examples or guides in that regard could be useful.
- recursivedoubts 4y agoi agree and here is a perfect place for you to contribute to the project! :)
- jonomacd 4y agoHa. Excellent point! I think I need to understand it better myself before I try to write something about it.
- recursivedoubts 4y agohey now, I didn't understand what I was doing when I started htmx either... not sure I do now, come to think of it
- soperj 4y agoHonestly, even starting writing about it will likely help you (and the person finishing it).
- BeefySwain 4y agoYou have mentioned here and in other places that you use HTMX + HyperScript in production. Curious what that looks like, is it part of consulting, a side business, a day job ?
- recursivedoubts 4y agoconsulting as a side gig of my day job, which is a CS prof
- can3p 4y agoHi, thanks for the libraries! When I started using them, one of the hardest parts was to actually have it imported and built with webpack, since the site focuses on cdn and webpack example is really brief. Same goes for hyperscript Do you see cdn as a preferred way of usage?
- recursivedoubts 4y agounfortunately I don't know webpack really well, although I'd love docs contributions on it if the existing docs aren't good
- efields 4y agoyou're not missing anything :-P there's a big distortion field around expectations vs reality with webpack.
- m4lvin 4y agoHow does error handling work? If I try to replace the content of some div with a reply I get using htmx, but the request fails or times out etc., what content is then put into the div? What if the reply is not valid HTML? Sorry for the newb and lazy questions.
- recursivedoubts 4y agohtmx doesn't do anything on an error by default, but you can override this behavior using the extensive event system it has: https://htmx.org/events/#htmx:responseError https://htmx.org/events/#htmx:responseError
- silver-arrow 4y agoIt’s pretty simple to use the htmx events on the Response to handle errors dialogs or other behavior
- spion 4y agoI've never used htmx, primarily because I like the concept of "components" so much. (They serve two needs - standardizing larger blocks of UI and encapsulating them with an alternative interface, and providing islands of rich interactivity) Is there any material on successfully combining htmx with web components? It doesn't look to me like the original design takes this possibility into consideration... (note: at a surface glance it doesn't look to me like components are in conflict with hypermedia - one could treat them as a side channel that "enhances" the standard set of elements)
- caseyf 4y agoI use Unpoly and not HTMX but similar idea, what you do for components entirely is up to you. My components look like this. The JS and CSS is included in the application's bundles. Ruby renders HTML on the server side. app/components/breadcrumbs - _breadcrumbs.scss - breadcrumbs_component.rb ... app/components/search_field - _search_field.scss - search_field_component.rb - search_field.js - selections.html.haml
- ColonelPhantom 4y agoI'm not sure if I've entirely grokked the idea of components, but can't you define them server-side? So write them as some template magic that creates the "inner HTML". Then you just need some HTMX to enable using the component in a richer way. It's not really Web Components as specified, but iirc those are generally pretty much JS-dependent? But hypermedia's reliance on server side rendering means that you can just move this logic to the server.
- yawaramin 4y agoWhy wouldn't htmx work with web components? It just does asynchronous fetches and DOM swaps. Web components are just pieces of DOM. There should be absolutely no issue with them working together?
- talideon 4y agoFirst, I'll preface this that what I'm about to write is meant as an endorsement of HTMX. What HTMX does should've been a W3C standard a decade ago, and I've my fingers crossed that some day I'll be able to do what I've done with jQuery and remove it. Thank you for pushing the state of the art forward in a meaningful (and RESTful!) way.
- recursivedoubts 4y ago:) agree 100%, htmx shouldn't have to exist!
- hexmiles 4y agoHi, on the subject of hypermedia: I recently saw your talk when you showed hyperview.org as an alternative to HTML for mobile use case. As someone who is very interested in the space, are there other hypermedia implementation (if is the right word) that you found interesting? Or do you have some pointer for those who want to explore this space? Personally I really want some kind of hypermedia framework for terminal application, since I often need to work with hardware (or bandwidth) where the only interface is a terminal, and I never feel productive with manually writing the application code, having to reimplement a new client every time. Also thank you for htmx, I started using for a couple of project, and it really is refreshing. Especially kudos for the various example, that really helped making it "click".
- recursivedoubts 4y agoheya, i don't know of any terminal-based hypermedia, but that's an interesting concept maybe gopher as a prototype example? adam stepinski (creator of hyperview) is one of the heroes of hypermedia in that he didn't just develop a hypermedia format but also developed a hypermedia client, and you need both for a proper hypermedia system so, I would say... maybe you are lookin' at the person in the mirror who is going to make that terminal app hypermedia?
- modernerd 4y agoIs htmx a good fit for Electron apps? Curious to know if anyone in the community is actively using it that way.
- recursivedoubts 4y agoi have heard that people are using it in electron, but it seems a little crazy to me
- Vohlenzer 4y agoDo you have any suggestions for or reference implementations of server code that works well with htmx?
- ksec 4y agoAnything we can do to push HTMX inside HTML5 and not as JS add-on?
- mvac 4y agoWhat’s the story for modals? Or multiple modals, navigating in them etc… Do you plan to take inspiration from Unpoly Layers (https://unpoly.com/up.layer https://unpoly.com/up.layer) or is it out of scope for htmx?