4 ms·
How does this contrast to htmx?
by whartung 2y ago
How does this contrast to htmx?
- one-punch 2y agoHotwire integrates with Ruby on Rails. (EDIT: The linked page shows how to integrate Hotwire with Ruby on Rails. See fxn's comment https://news.ycombinator.com/item?id=40555577 https://news.ycombinator.com/item?id=40555577) I had the same question, then watched the video to get the answer.
- fxn 2y agoNo, Hotwire is framework agnostic it is web components and JavaScript, basically. You can Google Hotwire with Django, or Laravel, or many others (https://hotwire.io/frameworks https://hotwire.io/frameworks).
- one-punch 2y agoThanks for the information. The linked page shows only integrating Hotwire with Ruby on Rails, giving me my original impression.
- fxn 2y agoSome links do not have information yet, others do, for example https://hotwire.io/frameworks/laravel https://hotwire.io/frameworks/laravel or https://hotwire.io/frameworks/django https://hotwire.io/frameworks/django.
- nacs 2y ago> framework agnostic Framework agnostic but Ruby-only it seems.
- fxn 2y agoNo.
- freen 2y agoNo. Turbo is js and HTML. If your backend can send templates down the websocket, you can use Hotwire.
- andrei_says_ 2y agoHotwire is in JS and is used by multiple back-end frameworks including Rails. Rails has a lot of affordances for Hotwire and is the back end framework for which Hotwire was originally written.
- felipemesquita 2y agoHotwire is the umbrella term for turbo, stimulus and strada. Turbo has client and server side components that enable easy ways to do partial page refreshes and send html templates (turbo streams) to initiate page updates from the server. That’s all without writing any js (using mostly data attributes and custom html tags, like turbo-frame). Stimulus comes in as a small framework for the cases where you want to write some JavaScript, in a way that you still control the behavior from html, by attaching controllers to elements explicitly. These two aspects are similar to htmx: - send html from the server even for partial page updates - encode desired js behavior into the html The main difference is that turbo is designed with a convention over configuration attitude, as many of it’s behaviors are automatic (like intercepting all form submissions and handling them using fetch, preventing a full page reload). When custom js is needed Hotwire defers to letting you write actual js code, htmx has this tailwind style shorthand that allows you to basically write js from the html.
- andrei_says_ 2y agoI’d add - stimulusjs lets you write your own htmx-like functionality by providing a convention for triggering and passing data to js via html data attributes. The stimulus JavaScript controllers (not to be mistaken with the Rails mvc controllers) are reusable and nest-able which makes them very powerful and quite fun to write.