31 ms·
Htmx is part of the GitHub Accelerator
- kitanata 3y ago[flagged]
- neon_electro 3y agoYou can get your comment deleted if you contact Hacker News, I’ve done it
- kitanata 3y agoI contacted them. They outright refused to delete any comments, all comments or my entire account. Hacker News by matter of policy WILL NOT delete your comments, even when requested in writing.
- kragen 3y agoin your case there seem likely to be extenuating circumstances; just after posting the above you accused me of 'anti-semitic rhetoric' in https://news.ycombinator.com/item?id=37150457 https://news.ycombinator.com/item?id=37150457 for example people who egregiously abuse the site like that may be less likely to get cooperation in concealing their abuses
- 0ct4via 3y agoInteresting how you equate a simple desire to have the ability to delete comments (ostensibly a site-supported function) with "concealing abuses" -- it says more about your own projection than anything else. All you've done above is make baseless assumptions and imply accusations against kitanata with no basis or merit. Might want to check your own actions out before you go accusing others of "egregious abuse" - and as you put it, dial back on the rhetoric ;)
- kragen 3y agodeleting comments is supported for 2 hours if nobody has replied > All you've done above is make baseless assumptions and imply accusations against kitanata with no basis or merit. though you see nothing wrong with their behavior, kitanata has been banned from the site for abuse two hours ago as explained in https://news.ycombinator.com/item?id=37150880 https://news.ycombinator.com/item?id=37150880 judging from the number of your comments that have been killed today you may be on the way to being banned yourself maybe you should consider more carefully the moral of the hasidic parable i quoted in my previous comment https://news.ycombinator.com/item?id=37145942 https://news.ycombinator.com/item?id=37145942, that nothing you say can be unsaid
- deleted 3y ago[deleted]
- montenegrohugo 3y agoHave loved HTMX for small projects so far, quite delightful. Does anyone know what they have on the roadmap for 2.0? I'm curious what they are working towards.
- elliottinvent 3y agoVery active, helpful community on Discord [1] and a #htmx-2-dev channel for discussion on this very topic 1. https://htmx.org/discord https://htmx.org/discord
- chainwax 3y agoCongratulations! I had a fun time making a little project with Htmx, though ultimately went with something else as I ended up heavily using a openlayers, and map libs are notoriously heavy with clientside javascript and Svelte ended up being a better tool for the job. I plan on using it again for a future Golang project and look forward to following it's development. If you're in need of a simple/medium complex front end for your app, and _especially_ if you're already using template fragments[0], I really recommend giving HTMX a shot. It's pretty fun to work with coming from Javascriptland. Also, the guy who runs their Twitter account[1] is hilarious. [0] https://htmx.org/essays/template-fragments/ https://htmx.org/essays/template-fragments/ [1] https://twitter.com/htmx_org https://twitter.com/htmx_org
- PaulHoule 3y agoI’ve had good luck combining HTMX with D3.js but I’ve treated D3.js visualizations as “just another HTML element” with any particularly complex interaction with the rest of the site.
- chainwax 3y agoMy map has a _bunch_ of controls overtop of it that let the user mess around with what's displayed. Could I have made it work? Yes Could I have just made the map it's own self-sufficient component and left the rest of the app as is? Also yes Did I do these things? No. As one tends to do, I just nuked it and started over
- RGBCube 3y agoThe guy that manages their Twitter account is the creator himself: @recursivedoubts
- jonny_eh 3y agoA refreshing lists of startups, nothing related to HealthTech, Crypto, or AI.
- nprateem 3y agoThis page made me realise I'm better off with just vanilla JS or jQuery: https://htmx.org/examples/update-other-content/ https://htmx.org/examples/update-other-content/ Solution 3 gave me a good laugh though.
- EspressoGPT 3y agoWhy the heck would you use jQuery in 2023 though?
- nprateem 3y agoMy main use case will be basic UI interaction, mostly just posting or fetching data from a backend then updating the innerHTML on some element. Vanilla might be enough, but I'm keeping my options open. Also, no compilation step, so no need for npm, etc
- maxboone 3y agoIMO that's where alpine.js complements HTMX, you can use HTMX mainly for interfacing with a server and then use alpine.js for any special interaction that does not require a round-trip with the server.
- bardak 3y agoThat's my thought as well. Anything that needs new data from the server uses HTMX and if you need to manipulate something already on the page use Alpine, Jquery, vanillajs, or whatever other framework you prefer.
- rodorgas 3y agoJQuery would make sense when we didn’t have querySelector and fetch API. I can’t think of any reason to use it today on a new project, there are not advantages over vanilla.
- tambourine_man 3y ago
- deleted 3y ago[deleted]
- basiskarten 3y agoVery cool, congratulations!
- 3cats-in-a-coat 3y agoIt's so odd to live long enough and see the steady pipeline of "look at this much simpler way of doing web apps, just write HTML, not like the previous complex way" projects, which then turn into the previous complex way as the eyes turn towards the next "simple way of doing web apps, just write HTML...". Angular and React started this way on the frontend, while ASP and PHP started this way on the backend (of course eventually they all grow "full-stack" solutions). EDIT: And how could I forget, Tailwind, whose tagline reads: "Rapidly build modern websites without ever leaving your HTML" The fact your HTML barely reads like HTML after Tailwind, and reads more like your file is corrupted is I guess not mentioned in the tagline.
- PaulHoule 3y agoASP had some strange things where you could write what looked like a client side handler on a button and it would call a function in the server. Circa 2007 or so it seemed a to be a huge mistake because it didn’t play well with the so-called “model-view-controller” paradigm where, most importantly, the request handler could decide which view to render. (e.g. you fill out a form and if you mad a mistake it redraws the form with an error message, otherwise it might render one of several different forms depending on what you filled out on the first form.) He thing about HTMX is that it really wants support on the server side. For instance, you might have a <select> that gets drawn as part of an HTML page or that gets updated with new <option>(s) via HTMX when you push a button. Similarly you might have a form that can be rendered as the only form on a page or that can be rendered as a modal dialog that is pulled from the server when you open the modal (as opposed to unhiding it.). Either way the code that draws the HTML fragment (both the template and any database fetching/thinking) has to be runnable in more than one context. (Modal dialogs are so fun to implement with HTMX.) It’s something you can do in a situational way or that you could have a framework to help with, but it is part of the HTMX puzzle.
- throwaway290 3y ago> Either way the code that draws the HTML fragment (both the template and any database fetching/thinking) has to be runnable in more than one context. I'm sure it's the matter of time for isomorphic HTMX-based frameworks... but they won't degrade gracefully. but then they will, as a new feature. the circle of life!
- mikece 3y agoAm I the only one who looks at HTMx and thinks "this is like CICS all over again"?
- jaipilot747 3y agoThis CICS? https://en.m.wikipedia.org/wiki/CICS https://en.m.wikipedia.org/wiki/CICS Could you elaborate?
- mikece 3y agoYeah that one: full screen sent down from the mainframe on the beginning of a page-interaction, then only the parts of the screen that need to be changed are sent over the wire based on commands and input. With CICS it was all about reducing the number of bits moving over the wire to an absolute minimum which isn't the case here but partial screen replacement without refreshing or reloading the entire page is very reminiscent of the design.
- varispeed 3y agoIt looks like Angular on crack. I can see how this can quickly turn into unworkable mess.
- ris58h 3y agoNot at all. What makes you think that it looks like Angular?
- samsquire 3y agoAngular 1, I don't know about Angular 2 had syntax like ng-repeat <a class="item" ng-repeat="action in activeField.actions" ng-click="follow(action, $index, $event)"> {{action.text}} <i class="{{action.icon}} icon"></i> </a>
- hliyan 3y agoA syntax-based comparison feels a bit... superficial. One is an MVC based SPA framework. The other is best described (in my mind) as syntactic sugar over AJAX calls that replace inner HTMLs of selected targets.
- mikece 3y agoThe twists and turns my career has taken had me pretty much skip the whole front-end JavaScript framework wars so it's nice to see "plain old HTML" make an enhanced comeback.
- buro9 3y agoThe site and it's examples do not work with JavaScript disabled. This is a regression on graceful degradation.
- throwaway154 3y agoThat's a shame, and bad use of htmx, these examples shouldn't be showcase examples. It takes careful but not extraordinate thinking to think of ways to get consistent results with or without JavaScript turned on. Indeed, when a visitor hits a site for the first time they get the full response so everything for a graceful degradation should already be there to use. If I can figure it out, I'm sure big CS brains can.
- airtag 3y agoYes but for your own projects you could have a first page with a "no JS" div and attach a HTMX load request. That's how I did my first HTMX project and it works well informing you to turn on JS.
- nologic01 3y agoI think we need an impressive "made with htmx" example that will trail blaze an new class of web experiences. People have typecast htmx as something to use for simple use cases that dont "warrant" getting out the serious guns. There is something to that, but it is limiting. Htmx and related 'back-to-the-server' approaches are a distinct category that could have been explored much earlier but for various reasons isnt
- cyber_kinetist 3y agoThere was already a pretty good non-trivial real-world example where a company replaced their entire React site with htmx and got impressive results: https://htmx.org/essays/a-real-world-react-to-htmx-port/ https://htmx.org/essays/a-real-world-react-to-htmx-port/
- toastercat 3y agoWhere is the source?
- dvtkrlbs 3y agoI don’t think it is open source they show some parts of their code in the talk but that is it.
- withinboredom 3y agoThere's literally a talk linked to in the essay.
- toastercat 3y agoA link to a talk is not the same thing as source code.
- withinboredom 3y agoAh, I thought you meant "source" as in "news source" not "source code."
- synergy20 3y agoit does not work well with the ever growing restful API backend services to me.
- simonbarker87 3y agoHow so? (no snark, genuine) Your frontend makes a request to your server, the expectation is that will respond with html. If you have other services you need to bring in to the mix that responds with JSON then make the request to them from your server, have that parse the JSON in to HTML (most likely some kind of templating system like handlebars) and then send that back to your frontend as html for htmx to handle. Or am I missing something?
- withinboredom 3y agoDear god. Have we forgotten about the ACCEPT header? If you get a request with ACCEPT application/json, return json. If you get one with text/html, return html.
- simonbarker87 3y agoNot sure if your “Dear god” is negatively targeted at my comment - I’ll assume it’s a general show of exasperation. How likely is it every API will adhere to that though?
- withinboredom 3y agoYeah, just exasperation. For the longest time, most APIs would return json if you asked for json, or xml if you requested xml. Many older api's still do content negotiation, many gave up because 'xml bad'.
- monknomo 3y agoYeah, I remember a lot of apis that were something like `resource/instance.json` or `resource/instance.xml` and they'd give you `instance` in whatever the requested format was
- varispeed 3y agoSorry to sound mean but, what is the point of this? I've gone to the home page it poorly explains what it is and doesn't say why would you want to use something like this. Seems like another distraction.
- mekster 3y agoBefore people explore stuff that may not matter, I just don't understand why people don't just graduate writing raw HTML and write something like Pug which is like saving 30% typing that doesn't break or change your workflow. There's a stable implementation for PHP too.
- sibit 3y ago> poorly explains what it is Seems clear to me but I've been watching this project grow for a few years now. If you read the brief introduction, motivation, and quick start on the homepage what do you think the project does? > why would you want to use something like this I would agree that part wasn't clear to me either, at least not right away. When compared to something like a SPA the state has to persist on the server while an ephemeral state exists on the client. With HTMX the state only needs to exist on the server. If this sounds like the MPAs of yesteryear, it is. You render the HTML using the frameworks/tools/languages you fancy. HTMX provides custom attributes you can use to update content within a page without having to reload the entire page.
- wslh 3y agoSidetopic: is there anything similar to GitHub Accelerator but for companies instead of individual developers?
- papruapap 3y agoPersonally I dont like it. I think this will look as good as "everything in YAML" for CI/CD on an non-trivial codebase.
- PedroBatista 3y agoI've been a HTMX fan "since before was cool".. Very happy for the recent attention and "success". Also enjoying the shitposting and backlash mostly from the front-end crowd who believe the Web was invented in 2013 and they "made that city". :) I'm biased since the time Backbone.js came around, I understood part of the pain but was moderately skeptical, fast forward to React with the young energetic bros building dead simple 5 page websites with a Rube Goldberg setup of front-end frameworks, I've cashed out my tech chips and never touched those things.
- jddj 3y agoI hear you're buying a synthesizer and an arpeggiator and are throwing your computer out the window because you want to make something real. I hear that you and your band have sold your guitars and bought turntables. I hear you rewrote your http endpoints to return JSON because that was REST. I hear that you and your band have sold your turntables and bought guitars. I hear you rewrote your http endpoints to return templated html fragments because that was HATEOAS. I'm losing (regaining/losing/regaining) my edge
- Alifatisk 3y agoIs this some kind of metaphor?
- cantSpellSober 3y agohttps://genius.com/Lcd-soundsystem-losing-my-edge-lyrics https://genius.com/Lcd-soundsystem-losing-my-edge-lyrics
- jddj 3y agoAn appropriation of James Murphy to make a common potshot about webtech trends being as circular as fashion / music ones
- deleted 3y ago[deleted]
- 3y ago
- revskill 3y agoReact is JS in html. Htmx is JS in string. Goodluck stringify :))
- okeuro49 3y agoNo, React is HTML in JS.
- kwhitefoot 3y agoI've skimmed the documentation and searched for the word server but I haven't been able to discover what is required on the server side. Can anyone point me in the right direction?
- hliyan 3y agoAnything that can serve HTML.
- domh 3y agoFrom what I understand, it's just HTML from the server, embellished with properties that get picked up client side by HTMX. So you can use anything on the server: nginx, node.js, go, php, whatever
- renerick 3y agoAny server-side language with your favorite web-framework and HTML templates system. Static files, PHP, Go, Ruby, ASP.NET Core, Spring etc, as long as you can send HTML pages and HTML partials, you are all set
- kwhitefoot 3y agoThanks. So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml". Is there a simple example of a static site using Htmx somewhere?
- renerick 3y ago> So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml" Exactly. It can serve HTML partials, or utilize `hx-select` attribute to extract required elements from a full page > Is there a simple example of a static site using Htmx somewhere? Not that I'm aware of unfortunately
- WeAddValue 3y agoThe code is not done yet but I can explain how we're going to use htmx and Hypermedia APIs for the static site of a national chess federation (it's static to avoid hacking/ddos from disgruntled russians). Every week, new chess ratings are calculated from the reports of in-person / over-the-board tournaments. At build-time (Hugo/Netlify), a static HTML fragment is created for each member and included in the site's static files. At run-time, when a member's info is requested, htmx will fetch the member's HTML fragment and insert it into the appropriate <div>. At run-time, there is no server-side code executing nor database so it's fast, highly available, and almost unhackable.
- duxup 3y agoIt’s amusing to read all the “it’s great to just write html” comments here, in a thread about some company going through a startup accelerator. Not that the comments are “wrong” but it feels slightly contradictory, in a way.
- adamckay 3y agoIt's not a company - it's an open source project. It's not a startup accelerator - it's a part of GitHub's efforts to support open source projects with funding and mentorship.
- kitanata 3y ago[flagged]
- kragen 3y agonobody has the right to be forgotten nothing you say can be unsaid; therefore speak judiciously https://uuliveoak.org/Story%20ideas%20-%20service%20or%20class/Words-gossip_Tale%20of%20the%20Feathers.pdf https://uuliveoak.org/Story%20ideas%20-%20service%20or%20cla... > “Now Yankel,” the Rabbi began “go back through the town and collect all of the feathers. Put them back into the pillow and bring the fully stuffed pillow back to me.” > “But Rabbi!!!” Yankel burst out. “That will be impossible. Even as I was walking away from the feathers, I saw that they were being blown from the doorsteps. How will I be able to find and gather up all of the feathers again?!?!?!” > “Ah...” the Rabbi began his explanation. “And the same is true for lashon hara, for once you let it pass from your lips, you can never collect it back again. It floats and flutters away in whatever direction the wind carries it. That is why you must always watch your words carefully and avoid all talk of others. You will never be able to repair the damage you have caused, but I am hoping that you have learned a lesson...” > Yankel nodded with deep understanding. From that day forward, not only was he no longer the town storyteller, but he did everything he could to spread the word about the pitfalls of lashon hara. if you regret the damage done by what you have said, you cannot unsay it, but perhaps you can take responsibility, apologize, and make amends by some other means
- okeuro49 3y agoOff topic, but: > The right to erasure is also known as ‘the right to be forgotten’. https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/individual-rights/individual-rights/right-to-erasure/ https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-re...
- kragen 3y agono such right exists; that would be like the right to rob with impunity of course clever demagogues and rhetoricians can write such things into legislation, just as they can write legislation that claims you have no right to speak freely, but that just makes the legislation incorrect, like the famous legislation declaring pi to be exactly 3
- esseti 3y agois it a june news? the url is 2023-06-06
- deleted 3y ago[deleted]
- jray 3y agoA question, has anyone managed to integrate htmx with select2 or tom-select? I'm trying to create a remote livesearch, but I can't achieve it.
- rs_rs_rs_rs_rs 3y agoIt's time to bring jquery back in the limelight.
- hliyan 3y agodocument.querySelector(x).[addEventListener|innerHTML|... etc.] is usually enough for most use cases. You can alias it to $() and .on() if it looks verbose.
- DrDroop 3y agoI've a hard time taking htmx serious for building a modern web app/site. It makes is impossible to build features that users have come to expect: * Faceted search with configurable filters, like filter date on before, between or after, but only show the filter if the user wants it. * Configure result view with different columns or even different views like maps or drawing something on a canvas like charts. You can maybe do some of this stuff with htmx but at some point you'll just need the json. Even Angular can do this, and with something like SolidJS it is actually a pleasant thing to do. A JSON api can be re-used by other apps while htmx feels like someone reinvented Thymeleaf
- zaphar 3y agoImpossible is a strong word. I've looked at their API and I can certainly imagine ways to do everything you list above in HTMX. I would need to build and use it in anger to know if it's a good way to do so but I can imagine scenarios where it definitely is. The point about a JSON API is a good point and if you need a public API then you should probably factor that into your decision making but not everything has this constraint.
- CharlieDigital 3y ago> The point about a JSON API is a good point In a well-designed system, these two are not mutually exclusive but simply two facets of the same request pipeline. The JSON API simply serializes the model as JSON. The HTMX-specifc API applies a template/transform over the model and returns HTML instead. If one thinks of hypertext as another serialization target, it's easy to see how one would easily be able to serve both JSON for pure APIs and hypertext for HTMX.
- zaphar 3y agoOh definitely. You could control it with the `Accept: text/html` http header too so you can use the same endpoint. But as I said, you need to take that into consideration if you adopt htmx.
- Cthulhu_ 3y ago
- samsquire 3y agoHTMX reminds me of pjax which I really liked I did a lot of sideprojects in Knockout and one large one in Angularjs 1. I feel all the frontend frameworks need to talk about what they see the problems are and decide how to fix them. I would like some solid foundations and avoidance of common pain and gotchas of scale and complexity. My old sideprojects are broken because I didn't fix library versions. My JSBIN sqlite file with my knockout projects in is also in an unknown version of JSBIN which latest JSBIN doesn't work with. The speed that frontend development moves has broken lots of my code. EDIT: Screenshots of my old experiments: https://github.com/samsquire/interface-experiments https://github.com/samsquire/interface-experiments
- recursivedoubts 3y agoyes, intercooler.js (which was the first version of htmx) was heavily influenced by my experience with pjax!
- JodieBenitez 3y agoI used this in the past: https://malsup.com/jquery/taconite/ https://malsup.com/jquery/taconite/
- fleetfox 3y agoThere are many applications where htmlx is objectively the best tool. But i really hate all the hype around it and people pushing it as react replacement.
- agumonkey 3y agoHad an heated debate with someone that was really angry at everything react, for good reasons, but being oblivious that htmx can't replace client side logic. React hype + backend crowd I guess.
- thefreeman 3y agoas a primarily backend dev I really don't see the appeal here. So now I need to make endpoints for every little UI element that I want to be updated by user interactions? And somehow keep it styled and matching all of the UI elements rendered on the frontend? No thanks, I'll just give you data and you can present it however you please.
- Skinney 3y ago> So now I need to make endpoints for every little UI element that I want to be updated by user interactions? No. Htmx supports extracting a subset of received HTML and merging it with the current page. So, for a typical form, you _could_ do a request to validate the entire form then extract the relevant error message for the input field that triggered said request. This would re-use most code of the actual form submit endpoint except it _only_ does the validation. > And somehow keep it styled and matching all of the UI elements rendered on the frontend? When using Htmx, the backend would typically own the frontend. So the styles and UI elements are already "matched" as it were. > No thanks, I'll just give you data and you can present it however you please. This makes sense when there are multiple frontends and/or consumers of the API. When there is exactly one API consumer, and that API consumer is the frontend, Htmx can save a lot of time by reducing the overall complexity of the project.
- doesitbollocks 3y ago
- T3RMINATED 3y ago[dead]
- qbasic_forever 3y agoCongrats. I will be very curious to see how this (and other companies that are built around an open source frontend/web library) work on monetizing themselves. Are there any successful businesses in that space? I worry it will be truly challenging without a big compromise to morals/openness/etc. I kind of wonder if stuff like htmx should just be funded with a big grant so it never needs to worry about selling out users for profits and operating income. Or at the very least that it learns to run extremely lean, to not chase expensive fads, and to build itself into something that can survive off a modest "please donate/buy some stickers/tshirts or my book" income stream. I hope we don't see the day that suddenly there's no download link on their site and it's replaced with a, "please contact our sales team for a demo!".
- recursivedoubts 3y agohtmx is bsd licensed and I will not allow it to be anything but that (I may actually move to BSD-0, the two clauses are kind of dumb when you are talking about javascript) i have a day job (a couple) so there is no financial pressure around it i hope that it will be a long term public asset for developers
- jdthedisciple 3y agoHTMX the framework that sends a server request to put a textfield into edit mode? Nah sorry, not convinced.
- globalreset 3y agoHtmx doesn't prevent anyone from using JS, and using a tiny bit of localized JS is explicitly encouraged.
- recursivedoubts 3y agorelevant: https://htmx.org/essays/hypermedia-friendly-scripting/ https://htmx.org/essays/hypermedia-friendly-scripting/
- silver-arrow 3y agoGreat news. I have had good success and a rewarding experience using htmx the past year. It has been so great in tandem with Clojure using hiccup for SSR. Once htmx clicks for you, you are almost left stunned by how simple and flexible it is. You can't believe that this isn't how HTML evolved to as a hypermedia. It becomes very obvious that this is how web development should have evolved. I hope someday that what htmx is doing through javascript becomes baked right into HTML and the browser clients. If you are mistakenly believing it is just some derivative of Angular or you are not grasping the significance of its advancement of the architecture of hypermedia, please do yourself a favor and read the excellent essays on their site; you will then truly understand what REST is and what the importance of real HATEOAS means: https://htmx.org/essays/ https://htmx.org/essays/ They also have a free book here: https://hypermedia.systems/ https://hypermedia.systems/ We made a costly wrong turn 10 -15 years ago by attempting to rebuild thick clients on the web with a JSON API architecture instead of expanding and enriching the new and powerful idea of the early web: hypermedia.
- afavour 3y ago> It becomes very obvious that this is how web development should have evolved. I have to disagree with that. I’m happy htmx exists and that it works for many but in my professional life I've found few cases where it's the best choice. And that’s fine! It’s a wonderful thing that the web has been able to grow in so many diverse ways, there should be no one way it “should have evolved”. IMO this is the biggest mistake in web dev in the last decade or so: that there should be One Right Way. No matter if you’re making the next Gmail or if you’re making a static blog the cargo cult of an industry tells you it should all be done the same way when common sense would tell you that’s not the case at all.
- silver-arrow 3y agoThat's fair. I agree - that type of blanket statement is not helpful in the technical realm. I should have kept it at just: HTML should have continued to be expanded into what htmx is doing.
- 3y ago
- ilaksh 3y agoIf you think htmx is cool, check out _hyperscript https://hyperscript.org/ https://hyperscript.org/. Made by the same people, available with htmx I believe. After seeing _hyperscript, it looks like they may have invented that first, and a lot of people's heads exploded, so they decided to try to make a "gateway drug" to sneakily introduce _hyperscript, and came up with htmx.
- toastercat 3y agoThe practice of cramming a DSL into an HTML string attribute seems like it would get cumbersome and hard to read after a while. You can really tell in this example on the htmx site [1]. I imagine you can write that long string in your server code somewhere, but that also seems weird especially since you won't have _hyperscript syntax highlighting in your Ruby/Go/Clojure/whatever file. Does anyone have any real world examples of this? [1] https://htmx.org/examples/confirm/ https://htmx.org/examples/confirm/
- recursivedoubts 3y ago:) hyperscript came after htmx htmx is version 2 of intercoolerjs: https://intercoolerjs.org https://intercoolerjs.org which had a proto-scripting language in it, the `ic-action` attribute: https://intercoolerjs.org/attributes/ic-action https://intercoolerjs.org/attributes/ic-action i dropped that attribute (along w/ the jQuery dependency) when I created htmx, but I felt there was some merit to the idea of a lightweight scripting language that abstracted away async behavior. Once htmx had stabilized I revisited the idea, remembered my experience w/ HyperTalk as a young programmer, and decided to take a shot at that, but for the browser. I'm very happy with how it worked out, although I expect it will always be niche when compared with htmx, which has much broader applicability and isn't as insane looking. :)
- ilaksh 3y agoWell, congrats on both projects. _hyperscript especially to me looks like an amazing technical accomplishment, to make something so similar to natural language. What sort of parser is it? LL? LR? Because I would need to use an _LLM_ to handle that. Lol.
- dontupvoteme 3y agoWhat is github now?
- norwalkbear 3y agoComing from the Unity world, I find frontend development on the web weird as hell. When accounting for the limited amount of time and mental load people have, wouldn't the best bang for your buck be doing react/vue/js?
- danpalmer 3y agoArguably you’ve got to learn HTML, so why then add learning React/etc on top of that? HTMX is more limited, but also _radically_ simpler to modern frontend development.
- norwalkbear 3y agoPeople want and expect pretty and interactive experiences. I don't think they care how they get there. I've written some Unity "web" apps by using the port to webgl feature, so I have no deep fondness of html or js. I just need results.
- danpalmer 3y agoSure, I'm just suggesting that "best bang for the buck" may well not be React/etc, because it's a lot more "bucks" for often not much more "bang".
- avisser 3y ago> People want and expect pretty and interactive experiences. Counterpoint: a majority of websites are for business where they want the form to submit and update the database. And to me, pretty = CSS + removing full refreshes, which is what HTMX does.
- andy800 3y agoWith a little creativity, HTMX can enable some extremely UX-friendly interactive sites. Keep in mind that it makes it trivially easy to entirely swap out small, or large, sections of a web page. So things that used to be standard boring forms can be interactive step-by-step pathways that adapt to the user's selections. Very easy to deliver progress updates and validation cues to users that seem to appear magically without page reloads. It's still early but HTMX continually inspires me (a poor designer) to execute new UI ideas because it makes it very simple to conceptualize how they can be built (and simple to actually build). Tailwind is also essential in this process, for me.
- dontupvoteme 3y agoI haven't written anything meant to be seen by the wider web since geocities/myspace and I don't know anything front end besides apache and PHP -- is this a return to roots? (I don't like javascript and i think making websites sentient was a mistake)
- justmedep 3y agoAfter reading the linked website for like 2 hours I still can’t tell if this is a joke or for real…
- simonw 3y agoWhich part of it seems like a joke?
- elliottinvent 3y agoWait til you see the Twitter account: https://twitter.com/htmx_org https://twitter.com/htmx_org
- recursivedoubts 3y agofalse dichotomy detected
- recursivedoubts 3y agohi there, as many of you know, i am the creator of htmx and I'm happy to answer any questions about it htmx has seen a surge in popularity, triggered by a video by fireship dev (https://www.youtube.com/watch?v=r-GSGH2RxJs https://www.youtube.com/watch?v=r-GSGH2RxJs) and a series of videos by ThePrimeagen, a popular twitch streamer on it hacker news readers might be interested in the essays I have written on htmx & hypermedia in general here: https://htmx.org/essays https://htmx.org/essays and in a book I authored with a few other writers that we recently released on hypermedia, htmx and a mobile hypermedia called Hyperview: https://hypermedia.systems https://hypermedia.systems while I am a fan of htmx, obviously, I think the deeper concept that it touches on is hypermedia, which is a worthwhile idea for people to explore even if they don't plan on using it in day-to-day programming. There are also lots of other great hypermedia-oriented libraries worth checking out such as Hotwire from 37signals, or, my favorite after htmx, https://unpoly.com https://unpoly.com
- guggle 3y ago> my favorite after htmx That's interesting. I discovered Unpoly after HTMX (which I like) and decided to stay with Unpoly for a few reasons. Do you think hypermedia libraries will converge or do you think there is space for different interpretations ?
- mollerhoj 3y agoSame path for me here. In particular, I found unpolys codebase to be of higher quality.
- recursivedoubts 3y agohenning is an excellent programmer, I really admire him and his work
- phplovesong 3y agoThe htmx author is an excellent programmer, I really admire him and his work
- can3p 3y agoGreat news! I'm not using the full feature set (e.g. hyperscript) but really like the general approach as opposed to usual suspects like react or svelte. One of my last projects runs just fine on htmx + 3-4 stimulusjs controllers for all interactivity
- WeAddValue 3y agohyperscript is a separate project. It is not a feature of htmx. htmx handles the hypermedia interactions with the back-end server. For pure in-page interactivity (hiding/showing side-navs, etc), you get to decide how you want to do it: VanillaJS, AlpineJS (my favourite), hyperscript, Web Components (lit.dev, etc), StimulusJS (what you used), a big framework component (Svelte, Vue, React, ...), etc, etc. htmx does not bundle anything into itself to make that decision for you. You may have thought hyperscript is a feature of htmx because sometimes you'll see the two used in examples (both have the same creator).
- sriku 3y agoAlso https://hyperscript.org/docs/ https://hyperscript.org/docs/ - works together with htmx.
- imbnwa 3y agoHtmx strikes me as what we would've gotten earlier if we didn't throw XHTML and namespaces out with the bath water. Namespaced attributes, perhaps even tags, that already package and compose behavior seems like the natural outcome of browser spec writers reifying community conventions over time, and that kind of superimposing is precisely what XML facilitates.
- pictur 3y agoIn recent years, I have not seen another tool that is so inflated. The attention it can garner for a tool where all it does is do simple things by adding attributes to html elements is really weird. Anyway, we need to act as if adding an attribute to the button and changing the value written in it is a very big need. Great job congratulations.
- elliottinvent 3y ago> all it does is do simple things by adding attributes to html elements It’s extending html to make the most of http by adding some simple attributes. Like all great things - the building blocks are simple, but the possibilities of what you can build with them is vast. I think this is really well dealt with in the “opportunities” to extend html in this chapter of the Hypermedia Systems book: https://hypermedia.systems/extending-html-as-hypermedia/ https://hypermedia.systems/extending-html-as-hypermedia/
- basique 3y agoIt can do a lot more than just changing the value written in a button. I'd say that the hype is more centered around the fact that it helps you to do much more interactive and SPA-like websites without needing a full JS framework and on your favourite server stack, which is honestly really cool.
- kayo_20211030 3y agoThis is great news. It's an unfortunate fact, but the validation of htmx simply by its inclusion in the GitHub OpenSource Accelerator may unstick some folks that were on the fence about its "legs"; not its utlity as such, but more about its safety for adoption. Nobody wants to be fired for selecting a library that may just go away. It's a very good library and it (and things like Turbo) are incredibly useful when developing canvases that slot into SFDC with the least amount of friction, allowing you to simplify interactions between SFDC and your back-end systems, where those systems themselves depend on SFDC data.
- deleted 3y ago[deleted]
- dchuk 3y agoSo who is using this/hotwire/unpoly and something like capacitor or maybe react native wrapper or turbo-iOS to make “native” mobile apps that are mostly just web apps? Any good war/success stories? I have to assume that just like most web apps don’t need aggressive SPA front ends, many mobile apps fall in the same boat…
- WhitneyLand 3y agoHave many open source projects have embraced htmx as their way of doing things? Or are there any non-IT projects that have adopted? It would be interesting to see how it’s been working out for folks.
- zenith035 3y agoAwesome news. I have been a user since intercooler.js days and then moved to htmx.
- aembleton 3y agoHow does HTMX work with Tailwind? If I return some HTML from my backend, then the Tailwind scanner won't have found the css selectors, so it won't be in the generated CSS. What am I missing?
- cwales95 3y agoHave tailwind scan your backend files as well or have a list of classes needed included in your tailwind config which should not be purged.
- Capricorn2481 3y agoTailwind does let you specify files other than HTML/css. I point mine at .cljs files. Can you point it to whatever files are generating your html?
- rglover 3y agoI don't want to bag on Htmx but if you're looking to just use vanilla HTML (seriously, no extra/custom attributes or weird syntax gotchas), please check out Joystick [1]. UI framework that's part of a full-stack framework that uses vanilla HTML, CSS, and JavaScript for building components. [1] https://github.com/cheatcode/joystick https://github.com/cheatcode/joystick
- wildermuthn 3y agoI started with Perl in ‘96 and have lived through what feels like everything — PHP, jQuery, Drupal, Backbone, Node, Angular, ClojureScript, React, GraphQL, and NextJS. Htmx feels like a divergence from the trend, and is worth thinking about. Htmx asks us a good question: “does the complexity of your work reside essentially on the server or essentially on the client?” The complexity for the vast majority of websites resides essentially on the server. Most of us are not building Figmas and Google Sheets. Most websites, even if heavily interactive, are just CRUD apps with pleasant interfaces. Frameworks like NextJS attempt to rectify the problem of overly complex clients by moving React to the server, but this often magnifies complexity rather than minimizing it. Wouldn’t it make sense to remove React from the stack? For complex clients, skip the DOM and JS with canvas and compiled web assembly. For complex servers, use some form of server-driven granular updates to the DOM. The problem I see with this approach is that although most complexity reside on the server for most websites, there are almost always a few high-complexity task that needs to reside on the client — image editing, real-time sorting/filtering/calculation, drag-touch gestures, etc. A hybrid approach is necessary. It isn’t good enough to allow compatibility. Although htmx and React can be used on the same web page, they need to be kept in isolation. But I’m not looking for isolation; I’m looking for fundamental integration. My ideal framework would allow for reactive granular updates to the DOM while also being tightly integrated with compiled web assembly powering complex client operations. I’d write all my code in a powerful language rather than JavaScript. My debugger would operate on both server and client because the difference between the two has disappeared. It would be true full-stack development — a single-stack application (SSA) Clojure + ClojureScript comes close to being an SSA, but only superficially. If ever there was a killer framework for Common Lisp, I think an SSA fits the bill.
- jcmontx 3y ago> Wouldn’t it make sense to remove React from the stack? God hear your words
- jonahx 3y agoAgree with your take. > A hybrid approach is necessary. This is "the islands" approach, as advocated by Astro, for example: https://docs.astro.build/en/concepts/islands/ https://docs.astro.build/en/concepts/islands/ This approach is consistent with htmx and friends, and we're using it on an htmx project with simple vanilla JS for the pieces of interactivity. For small and medium projects and a small team, this can be enough, and it's a breath of fresh air to be able open up dev tools, point to part of a page, and understand everything there just by looking at the html and small snips of JS.
- martijn_himself 3y agoCan anyone explain why Htmx is such a big deal? I really don't get their 'motivation' section on their landing page. I mean, for example, the first motivation it lists is 'Why should only <a> and <form> be able to make HTTP requests?', why is that an issue? And 'Why should you only be able to replace the entire screen?', I mean that hasn't been an issue since XMLHttpRequest or am I missing something?
- tracker1 3y agoHTMX is meant to relatively cleanly interact with updating portals on a rendered page. Where the serve-side handles the post data and simply returns the HTMX fragment that gets injected/replaced. I can see the appeal, it's what ASP.Net WebForms probably should have been. And for that matter could probably cleanly fit with ASP.Net MVC and Razor views.
- jagged-chisel 3y ago> 'Why should only <a> and <form> be able to make HTTP requests?', why is that an issue? I wouldn’t call it an issue, but maybe you would like individual elements to fetch their own data. Sure you can do the same thing with JS in the browser (calling fetch or XMLHttpRequest), but htmx lets one do it with attributes on tags. The “replace the entire screen” business is a jab at React-like frameworks. Although they all claim to update only the DOM parts that change, it’s very easy for a codebase to [accidentally] force a full page redraw.
- RileyJames 3y agoMan. Love this. React for a purpose. Htmx and Hotwire for the rest. The debt years saved are for humanity.
- jjkeddo199 3y agoFor first-time-devs, configuring + understandings development environments is usually 10 times more daunting than "learning to code". With respect to Typescript, NPM, Webpack, React, transpiling, sourcemaps, broken IDE probably makes webdevnewbies quit before actual code syntax. In my dream world, HTMX could become part of the HTML6 spec, and beginners could spend more time dipping their toes in the water testing their .html files in Chrome before they face getting gobsmacked by the greater JS ecosystem.
- t3estabc 3y ago[dead]
- tempaway47811 3y agoIsn't this how jQuery worked about 10 years ago?
- recursivedoubts 3y agoto an extent, there was `jQuery.get` but it wasn't tightly integrated with HTML the original version of htmx was intercooler.js: https://intercoolerjs.org https://intercoolerjs.org released in 2013, and that version depended on jQuery
- strangescript 3y agoHtmx's biggest upside is no pressure to use JS/TS on the backend. So many stories start with "I used htmx with (rust|go|ocaml|django|etc) and had good results". Feels hard to not use JS/TS on the backend if you are already using it on the frontend (unless you have a specific need node can't fit). Why intentionally use two different languages, yadda yadda, etc, if you don't have too. Its refreshing.
- teaearlgraycold 3y agoBut I love TS on the backend...
- AtNightWeCode 3y agoBefore I break my neck completely. Htmx is still JS? No?
- dhucerbin 3y agoI was helping with an application that used htmx and had two issues. I’m wondering if anybody had similar experience and if these issues are from misusing technology or maybe there’s some ongoing work to address them. 1. A lot of custom middleware in controllers to decide if endpoint should return HTML for whole page or only fragment that htmx needs. On the side of htmx that sounds simple but it is something that probably every project using htmx have to reinvent. 2. Bookkeeping around `hx-trigger`. If UI is getting complicated, many elements need to react to external changes. Instead of reading some state and hope that framework will schedule updates, I have to manage a list of events to react by hand. Anybody had similar impression?
- jokoon 3y agoCan somebody explain to me how I am supposed to use this?
- als0 3y agoShouldn't HTMX be a W3C proposal?
- michaelchisari 3y agoLove Htmx but confident the hardest part of implementing will be convincing managers and designers to fully rethink how to approach UX and product in a way that privileges simplicity over presentation.
- pjs_ 3y ago. > looking for a nice framework for website > ask dev if their framework is hypermedia or javascript > doesn't understand, pull out long essay on hypermedia as the engine of application state > dev laughs and says "its a good framework sir" > check github > its javascript
- deleted 3y ago[deleted]
- nraf 3y agoCurious if anyone familiar with Drupal’s AJAX implementation (at least how it was in v5-7, I haven’t used Drupal v8 onwards) back in the day and has used this can offer a comparison? A sense a lot of familiarity
- guluarte 3y agooff tipoc but DocuMenso = Meso means retarded in spanish.
- 0xblinq 3y agoThis is a great tool for backend devs. No frontend developer that cares about the details, the UX and has to deal with the evolution and maintenance of any non trivial UI would use this. But as I said, this is great for everyone that just wants to make a frontend for their Go/Django/Clojure/etc backend. You’ll notice this pattern in most positive comments you see here. Also, as someone who also used these kind of tools, I still prefer Unpoly over it. Sadly it didn’t get as much marketing.
- rawoke083600 3y agoI just love that you had the "guts" to start a project that sends HTML via ajax from the server at the height of JSON/JS/Framework Mania (hey it pays my bills). Project is really cool, I'm itching to use it in the right side project. Congrats on shipping ! Oh yea the https://htmx.org/essays https://htmx.org/essays as the author mentioned is also fantastic. Their twitter is "fun" :D
- djangpy 3y agoCan someone explain to me how state management is done in HTMX? I'm a native Django developer, and I really do like HTMX and wrote my own personal website with it (nothing special, a digital garden). But for my startup, I chose react, and it has pretty much become a SPA, where I need to keep track of so much state. Now, I would love to transition to HTMX, because I find Django a lot more ergonomic to work with. But I couldn't imagine not running into issue managing state.
- vlz 3y agoI don't think there is a single answer to state management with htmx as in "put your key-value pairs here“. Instead the page depicts the application state and offers ways to change it or to change what is depicted each time updating parts of the page. So the state is what's on the page so to say. However some options are: 1. you can have some form of state in your url by having every user actions change a param, returning the updated page with updated links/forms. 2. You could keep a session on the backend. Never used this myself, however Django which you speak of above should have support for sessions without a user/login. 3. you can keep state in the database if is important enough and you have a user. 4. htmx also sends a lot of js events which you can react to by using some plain Javascript yourself. You can also send your own events and have htmx listen on them to have different components react to a page/state update elsewhere with their own page update.
- weikju 3y agoState management is done in whatever day your backend does it. HTMX is mostly concerned with sending requests to the backend and shoving the HTML response in the right place in the DOM
- ljlolel 3y agoI invented this over 10 years ago and called it Pebbles. Got some stars on GitHub. I convinced Memrise to use it in production and it helped them speed up dev a lot. https://github.com/jperla/pebbles https://github.com/jperla/pebbles Later when I worked at Facebook I saw that someone later made a similar library internally.
- 12907835202 3y agoI like the look of htmx at first but then when I want to do something where I would usually reach for JavaScript (vanilla or framework), such as a dropdown button, I inevitably consider hyperscript and then I see an example like "<div class="dropdown" _="on mouseenter toggle .is-active on me until mouseleave">" and decide I don't like having sentences in code like that and I move on to something else. Maybe I should give htmx a go without hyperscript or maybe I should give hyperscript more time. But on anything that I'm expecting to be maintaining for years it's just too unfamiliar and I don't want to be stuck with it if I wind up never using it again.
- 59nadir 3y agoI am fully on board with htmx but hyperscript doesn't necessarily interest me. The htmx side doesn't care even one bit what client-side interactivity you use at all, so it's not really material to whether htmx can be useful for you. Personally, if I am trying to keep JS build tools and stuff out of the equation I'll go with htmx + Alpine.js.
- stuckinhell 3y agoYea that hyperscript code looks awful. How would it scale and handle complexity ?
- vietvu 3y agoI like the idea of htmx, it's more familiar with me since when I was involve on web developing, it was mostly jQuery, PHP, vanila JS, django. But I don't think I will change my current app from Vue to htmx, too many changes.
- mnming 3y agoIn all those SSR tools, my favorite is inertial.js, I think it combines the best of the both worlds. I am not sure why inertial wasn't getting more popularity though, anyone know why?
- rydgel 3y agoBecause it's PHP I guess
- hu3 3y agoIt's not well known or advertised, but it can be used with other langs and frameworks too: - Rails - AdonisJs - ASP.NET Core - CakePHP - CanJS - Clojure - CodeIgniter4 - ColdBox - Django - Go - Masonite - Mithril.js - Node.js - Phoenix - PSR-15 - Statamic - Symfony - WordPress - Yii2 - Flask source: https://inertiajs.com/community-adapters https://inertiajs.com/community-adapters
- loafoe 3y agohtmx just got me to do some front-end programming again after many years of false starts with Angular, React, Flutter, etc! Very refreshing and extremely productive! Goland, browser window and Bard for code snippets and from idea to first working flow in less than an hour! With other frameworks I would first have to struggle for a day or two setting up the tooling and understand all of the new concepts and constructs. Or worse, learn completely new language (Flutter, Typescript) Thanks @recursivedoubts and team!
- jgimenez 3y agoNot willing to be the party pooper, but isn't htmx's appeal the simplicity of it? I would expect it to be "done", or maybe could be refined with a couple more little things, but definitely not needing full-time dedication on making a version 2.0 or adding new features. Aren't we going to end up with a new react?
- recursivedoubts 3y agoi certainly hope not the 2.0 would drop IE support, remove the older SSE and WebSocket support, and switch a couple of defaults (e.g, using template wrapping for parsing partial content, which handles troublesome elements like table rows better, but isn't available in IE) so it would be a breaking change (not for most folks, but still, breaking for some) which I only like to do w/ major versions. we may have one major addition: a morph swap based on idiomorph: https://github.com/bigskysoftware/idiomorph/ https://github.com/bigskysoftware/idiomorph/ i'm on the fence on that one: it is currently available as an extension and maybe doesn't belong in the core, still thinking about it so, in comparison with most libraries, 2.0 is going to be very minor