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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Htmx 2.0.4 Released

196 点作者 ms78925 个月前

14 条评论

ianpurton5 个月前
Do some people have examples of interactivity they were able to replace with Htmx?<p>For me, I&#x27;ve been able to get turbo style links with the boost to get nice page transitions. I can also see how I could use the class-tools extension to enable buttons to open dialogs etc.<p>I&#x27;m curious to see when people say they needed an SPA for interactivity, what interactive features Htmx can already do and when do we need to break out some JS.<p>An example that I think needs JS is a copy paste button.
评论 #42415531 未加载
评论 #42416022 未加载
评论 #42416076 未加载
评论 #42416480 未加载
评论 #42418452 未加载
评论 #42416428 未加载
_heimdall5 个月前
&gt; Calling htmx.ajax with no target or source now defaults to body (previously did nothing)<p>This one jumped out to me as an interesting one for a patch release. Changing the default behavior feels like a breaking change, though hopefully there weren&#x27;t sites expecting an ajax call to not do anything.
评论 #42414712 未加载
评论 #42414414 未加载
评论 #42414182 未加载
评论 #42414173 未加载
评论 #42414284 未加载
评论 #42414831 未加载
benatkin5 个月前
There&#x27;s a question I&#x27;ve had about htmx for some time, might as well ask it here. Why does it keep the history cache in localStorage and not sessionStorage or memory? Some kind of a microoptimization? sessionStorage seems like it would be better to me if it&#x27;s really a good default. I also think it should be publicized more, because it unexpectedly keeps stuff in a location that can be accessed more easily and beyond where the browser&#x27;s back button cache can.
评论 #42414276 未加载
deedubaya5 个月前
As ceo of htmx I’ll field any questions now
评论 #42415665 未加载
评论 #42414632 未加载
评论 #42414825 未加载
WD-425 个月前
Nice boring release, just the way I like it. Thank you!
thekashifmalik5 个月前
So happy every time I see HTMX.<p>I&#x27;m hoping there is more innovation in this space with React engineers rediscovering the benefits of server-side rendering and Backend-For-Frontend efforts.<p>I think the perfect stack involves all 3 paradigms (initial loads, hypermedia loads and data&#x2F;AJAX loads) used in parts of the application as makes sense.
评论 #42415517 未加载
euroderf5 个月前
I&#x27;d like to see a demo of htmx talking to the WebAssembly HTTP capability component.
评论 #42415489 未加载
qwm5 个月前
I have several problems with htmx, and none of them are love of React or the thousands of NPM modules that make up most modern frontends today. I&#x27;m also not a fan of JavaScript itself, and I don&#x27;t write Node backends unless I can&#x27;t avoid it.<p>The main problem I have with htmx is it requires my backend and frontend to be uncomfortably coupled. I write most of my backends in Go these days, but I&#x27;ve written a lot of Java and PHP in the past. I particularly hate PHP and the model of mixing backend logic and presentation markup. I&#x27;m not a fiend when it comes to separation of concerns; I try to keep relevant things together. With that said, constantly bundling markup with actions is annoying. For example, POSTing a comment would require the backend to send back the new comment&#x27;s HTML, then possibly perform some action like bumping off comments that are too far down.<p>The other big problem I have with htmx is that it has no good solution for managing state and staying consistent with the backend. I used to work on a site written in PHP that, while not using htmx, used generally the same system of returning HTML from ajax calls. I was working on implementing comment replies, which required not only appending a new comment, but changing some of the markup on the original comment to indicate that it had replies and a button to collapse those replies. The solution I chose for this was to make those changes to the original comment dynamically with raw JS, then append the HTML for the new comment returned by the server. This worked fine, but it was annoying because I had to replicate rendering logic in both JS and PHP. This kind of thing can easily become death by a thousand papercuts as your site grows and you have more and more duplicated rendering code. This problem does not exist in the Vue&#x2F;React&#x2F;etc. world.<p>There is value in keeping all your rendering in one place, even if that place is the server and access to it requires enduring network latency. I understand why someone who uses a language other than JS for backend would enjoy htmx, but I think it&#x27;s going to bite its users in the ass one day or another when their application becomes too big and rendering logic becomes hard to maintain.<p>I would say my favorite alternative to htmx for people who want statically rendered pages but don&#x27;t want to go without niceties like components, JS type checking, reactivity and other things that speed up frontend development and make it more scalable is Inertia.js. It allows you to use a JS frontend framework like Vue or Svelte and the backend of your choice without having to write an API or (god forbid) GraphQL. <a href="https:&#x2F;&#x2F;inertiajs.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;inertiajs.com&#x2F;</a><p>I&#x27;ve also found that petite-vue is great for adding progressive enhancement to otherwise static sites without using a bloated framework. I&#x27;ve used it in several contract projects and it works like a charm. <a href="https:&#x2F;&#x2F;github.com&#x2F;vuejs&#x2F;petite-vue">https:&#x2F;&#x2F;github.com&#x2F;vuejs&#x2F;petite-vue</a>
评论 #42512643 未加载
htmxceo5 个月前
I tried to use HTMX to fix some of the plumbing in our bathroom and I’m very disappointed … it just isn’t fit for purpose. I’m sticking with React
评论 #42417374 未加载
Babawomba5 个月前
Tried Htmx a while back... mixed feelings. Love how easy it is to get basic interactivity—honestly, adding a filter or an upvote button in a couple of lines of HTML feels like magic. No messing with a frontend framework, no bundlers - just works.<p>But I hit walls when I needed more complex stuff. Like, if I want to keep state on the client (e.g., a live calculator or sliders updating a table), Htmx feels clunky. Sending a request to the server every time a user adjusts a slider—yeah, no. React or Svelte is a better fit there. And if you&#x27;re already using those tools. Htmx starts to feel redundant. Why add more when you&#x27;ve got everything in one place?<p>Also, not sure about the recent patch release - Changing default behavior in a minor update? Feels risky, even if it&#x27;s &quot;fixing a bug.&quot; Imagine waking up to find your body tag wiped because you updated without reading the changelog, yikes. Makes me think twice about trusting it in production.<p>Butfor MPAs or projects that lean heavily on server-side rendering, it’s a game-changer. You’re not rebuilding the wheel, just enhancing it. Htmx has a sweet spot—it’s just not always the right tool for every job. Depends what you&#x27;re building, I guess...
评论 #42424237 未加载
评论 #42416222 未加载
RamboRogers5 个月前
Htmx belongs on a pedestal
评论 #42415812 未加载
2-3-7-43-18075 个月前
what is the selling point of htmx? why use it versus ...?
评论 #42417227 未加载
评论 #42419885 未加载
gloosx5 个月前
&gt;htmx.ajax, htmx:trigger, synthetic load event<p>&gt;Nested shadow root<p>&gt;element is reinitialized via htmx.process()<p>&gt;Boosted &lt;form&gt; tags<p>&gt;htmx-powered elements located outside a form, but that refer to a form via the form attribute<p>&gt;preload, hx-boost, response-targets, ws, head-support, sse<p>I see... Folks at HTMX are always thriving for a <i>little bit more power</i> of hypertext.<p>Remember guys this is how <i>S.I.M.P.L.I.C.I.T.Y.</i> looks like.<p>Fnatics, unleash your downvotes!
xupybd5 个月前
Nothing new under the sun. This is just a rip off of intercooler js. Only without jQuery. Times moved on and someone copied the idea (exactly) but with the aid of modern JavaScript didn&#x27;t need jQuery.<p>I mean it&#x27;s nice that it&#x27;s a bit more modern but still.
评论 #42414570 未加载
评论 #42414558 未加载