TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

htmx

435 点作者 GavinAnderegg将近 2 年前

33 条评论

silver-arrow将近 2 年前
I have immensely enjoyed and benefited from using htmx for the past 18 months on projects with Clojure as the backend language. I had done years of full-stack Angular then React on the front-end and Java Rest endpoints on the back-end with teams of all sizes.<p>htmx has been a revelation and has really opened my eyes to the nuances of hypermedia development modalities that I was ignorant of. For me, it has become very clear that htmx and hypermedia development is far more simple, productive, beneficial, and FUN for 90% of web dev use cases. I feel huge disappointment how unnecessarily web development evolved into bad client server rpc json protocol for basically everything web.<p>Kudos to the htxm creator and his vision of what should have been. My experience absolutely corroborates his thinking on these things.
cosmojg将近 2 年前
Heh, the &quot;Memes&quot; section of their Essays page is brilliant: <a href="https:&#x2F;&#x2F;htmx.org&#x2F;essays&#x2F;#memes" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;essays&#x2F;#memes</a>
评论 #36079156 未加载
评论 #36079093 未加载
评论 #36081183 未加载
评论 #36080400 未加载
评论 #36081290 未加载
评论 #36080386 未加载
TekMol将近 2 年前
Hmmmm... no.<p>This:<p><pre><code> &lt;button hx-post=&quot;&#x2F;clicked&quot; hx-swap=&quot;outerHTML&quot;&gt; Click Me &lt;&#x2F;button&gt; </code></pre> Should be just this:<p><pre><code> &lt;button onclick=&quot;htmx.post(&#x27;&#x2F;clicked&#x27;, &#x27;outerHTML&#x27;)&quot;&gt; Click Me &lt;&#x2F;button&gt; </code></pre> This way, no magic would be needed, a lot of indirection and complexity would be avoided and everybody who knows HTML and JS could immediately read and understand it:<p><pre><code> - When does something happen here? When the button is clicked. - What does happen? htmx.post() is called.</code></pre>
评论 #36080788 未加载
评论 #36081319 未加载
评论 #36080692 未加载
评论 #36081668 未加载
评论 #36080561 未加载
评论 #36080625 未加载
scoofy将近 2 年前
I use htmx heavily on <a href="https:&#x2F;&#x2F;golfcourse.wiki" rel="nofollow">https:&#x2F;&#x2F;golfcourse.wiki</a><p>It’s nice and easy to work with, and lets me keep almost everything in python (flask).<p>It’s a bit more bandwidth, but it’s a hobby&#x2F;bootstrapped project right now, and since it’s an api, if I ever make any money, it’ll be easy to rewrite and heavy lifting.<p>I like it because I’ll write 3x the code in the same amount of time if it’s python. I just don’t like js much even though I know it’s fine.
panic将近 2 年前
&quot;Load HTML from a URL and replace part of the page with it&quot; is a powerful technique for progressive enhancement, even if you don&#x27;t want to use a framework like this. A button can send users without JavaScript to the URL directly, while users with JavaScript can have that part of the page replaced inline.
marko-lev将近 2 年前
HTMX is just HTML.<p>HTMX substitutes a DOM element with the HTML response you get from an on-click HTTP request instead of redirecting to a new page.<p>Claims of HTMX being yet another complexity or yet another JavaScript framework fail to acknowledge this.
评论 #36081247 未加载
rafark将近 2 年前
This is VERY cool. I’m very excited to see a project like this. Is it me or there has been a lack of wow-factor projects lately like when jquery was introduced. Or templating engines like handlebars. Or when angular and react took over. Browsing the htmx site felt like learning about those aforementioned projects for the first time.
replwoacause将近 2 年前
I love htmx and have used it to build internal tools quite successfully. It allows me to work in my preferred language on the backend, write some basic ass html and spinkle in a few attributes and get some frontend reactivity that I otherwise wouldn’t have because I hate Javascript.
jhp123将近 2 年前
My problem with this approach is the same one raised by Dijkstra against the goto statement. These update actions are too unrestricted and don&#x27;t offer any way to analyze the program&#x27;s progress systematically, based on the program source code.
评论 #36079636 未加载
评论 #36079384 未加载
chatmasta将近 2 年前
I continue to be impressed at the effort people will put into avoiding writing any JavaScript. Is it really easier to learn yet another DSL embedded in attribute tags rather than taking a day to setup your JS dev environment and then writing idiomatic code for running inside a web browser? Surely your htmx project will eventually cross a complexity threshold where you&#x27;ve added enough scaffolding that you may as well have setup a JS bundler in the first place, and yet the debugging, testing and deploying challenges will continue to push you into less-trodden territory.<p>I believe there might be a sweet spot for small projects unlikely to grow in complexity, maintained by a Python dev who is allergic to JS. But I don&#x27;t see why you would want to invite yet another abstraction into the web stack, when it&#x27;s built on top of the very language you&#x27;re trying to avoid, and which you&#x27;ll inevitably encounter in all its automagically obfuscated glory as soon as you run into a moderately complex problem.
评论 #36079465 未加载
评论 #36079401 未加载
评论 #36079199 未加载
评论 #36079221 未加载
评论 #36079531 未加载
评论 #36079161 未加载
评论 #36079412 未加载
评论 #36079229 未加载
评论 #36079633 未加载
评论 #36079123 未加载
评论 #36079133 未加载
评论 #36079138 未加载
评论 #36080436 未加载
评论 #36079498 未加载
评论 #36080402 未加载
评论 #36079211 未加载
评论 #36079585 未加载
评论 #36079761 未加载
评论 #36080504 未加载
评论 #36079303 未加载
评论 #36080429 未加载
评论 #36080180 未加载
评论 #36080081 未加载
评论 #36080034 未加载
0xblinq将近 2 年前
I&#x27;d still pick Unpoly over it. Seems far more high level, feature rich and easier to use although less popular. And if I wanted a popular approach I&#x27;d pick Hotwire which can be used with any backend framework anyways.<p><a href="https:&#x2F;&#x2F;unpoly.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;unpoly.com&#x2F;</a><p><a href="https:&#x2F;&#x2F;hotwired.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hotwired.dev&#x2F;</a>
评论 #36084542 未加载
评论 #36081602 未加载
winrid将近 2 年前
I really want to use htmx on the next project but I am not sure how to make it handle poor network connections yet. The app I&#x27;m building will be used in areas with poor mobile connections - I want to submit a form, add it to a list and say it&#x27;s pending saving, while the user can add more. Have to use hyperscript probably?<p>Can trivially do it in vanillajs so I&#x27;m sure it&#x27;s possible?
评论 #36088604 未加载
评论 #36091397 未加载
评论 #36102027 未加载
whatscooking将近 2 年前
Ah yes…the daily htmx post
评论 #36079704 未加载
评论 #36079543 未加载
评论 #36080245 未加载
评论 #36080163 未加载
sgc将近 2 年前
Does this cause problems for web crawlers indexing sites, since these are not typical js event listeners etc? Even though they must use them in the background, there is an abstraction the crawler must be able to navigate. I had an entire site de-indexed for getting too fancy once, so I worry about this type of thing perpetually now.
评论 #36080159 未加载
评论 #36080032 未加载
mrcwinn将近 2 年前
For those with flexibility or a new project, also consider Phoenix LiveView. It’s been a joy to work with so far.
评论 #36079339 未加载
sandGorgon将近 2 年前
HTMX + Java is almost as good as react!<p>I think people mistake what htmx is - they think it is a way to not write react&#x2F;js in a node environment.<p>Where HTMX really shines is being able to bring the experience of writing React-like code without a nodejs environment in Java for e.g. (or Golang, Rust, etc)
评论 #36080762 未加载
llambda将近 2 年前
How does htmx compare with alpinejs (<a href="https:&#x2F;&#x2F;alpinejs.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;alpinejs.dev&#x2F;</a>)?
评论 #36079746 未加载
评论 #36079359 未加载
justusw将近 2 年前
On the one hand I see the appeal of staying inside, say, Django the whole time and getting 3x done.<p>On the other hand I am so pampered by front end component based templating especially with Tailwind.<p>It would be cool if I could just import my Svelte components from Django.
评论 #36088551 未加载
bluedays将近 2 年前
how many times has this been posted here?
评论 #36080074 未加载
评论 #36079068 未加载
laex将近 2 年前
Can HTMX be used with static site generators, such as Hugo, to create interactive documentation websites?
评论 #36079167 未加载
评论 #36079086 未加载
评论 #36079367 未加载
pbohun将近 2 年前
This is the first time I&#x27;ve been excited to learn about a new web technology in a while. I&#x27;m going to have to play around with this to see how I want to use it. I wonder what other little things like this could be used to simplify webdev?
camdenlock将近 2 年前
The crucial flaw with htmx is that it’s an enhancement of html itself; if a fancy and interesting new UI pattern is invented somewhere, the htmx devs or contributors will have to add support for it into htmx itself!<p>And imagine if htmx became absorbed into the real html standard. It would take much longer for the standards body (and then browser makers) to respond and implement.<p>So the crucial flaw is that it will always be reacting instead of innovating. And more generally, this is likely why the “thick client” approach is more popular on the web these days. Nobody wanted to wait around for standards bodies and browser makers.
adamredwoods将近 2 年前
I&#x27;m not a fan of adding functionality to hypertext attributes. I want an expected set of attributes to a component, not a new set of attributes that extend existing components. A lot of functionality can get obfuscated.
评论 #36080534 未加载
评论 #36082520 未加载
pavlov将近 2 年前
Long arguments here about whether HTMX or React or something else can qualify as idiomatic HTML.<p>But the truth is, HTML itself does so very little that it’s barely useful as a starting point for building applications.<p>Arguing about idiomatic HTML in this context is like arguing about how to write a scientific paper in idiomatic toddler language. One faction thinks you should stick to monosyllabic words. Another believes drawings of colorful balloons are key. Both are held back by the fundamental assumption.
nneonneo将近 2 年前
The filler text on some of the examples (e.g. <a href="https:&#x2F;&#x2F;htmx.org&#x2F;examples&#x2F;tabs-hyperscript&#x2F;" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;examples&#x2F;tabs-hyperscript&#x2F;</a>) seems to be generated by Hipster Ipsum <a href="https:&#x2F;&#x2F;hipsum.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hipsum.co&#x2F;</a>. Cute.<p>I kinda like the aesthetic. It feels a bit like what HTML might have looked like if XHR had been baked in.
PrimeMcFly将近 2 年前
I personally don&#x27;t see the utility in this too much, but then I&#x27;m old fashioned and go out of my way to use as little JS as possible, doing everything via CSS as much as I can.<p>Even though JS is ubiquitous and small, well written JS is harmless, I still try to avoid it like the plague. Maybe just to somewhat fight back against all the excessive JS that plagues every site.
评论 #36080073 未加载
ulrischa将近 2 年前
A lot of this what htmx does is a one-liner in Jquery. I know: the unpopular old thing :)
KevinChen6将近 2 年前
Learning to use any new tool comes at a time cost, and if I learn this and then a newer, more convenient tool emerges that can replace it, I get stuck in the question.<p>Are people driving the tools?<p>Or are the tools binding people?
评论 #36080543 未加载
ChrisArchitect将近 2 年前
Anything new here?<p>Some discussion 5 months ago:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33987578" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33987578</a>
jaxrtech将近 2 年前
This vaguely reminds me of Adobe&#x27;s ColdFusion except in the browser for better or worse.
asah将近 2 年前
can htmx be used offline? i.e. am I screwed if I load an htmx page, close a laptop and get on a plane?
评论 #36081550 未加载
timetraveller26将近 2 年前
stop trying to make htmx happen, it&#x27;s not going to happen
emodendroket将近 2 年前
Seems like a horrible idea that totally breaks separation of concerns, so I’m sure it will be a huge success you’ll see everywhere very soon.
评论 #36080703 未加载