01 Apr, 2022

Rails

Hotwire

Introduction to Hotwire

Let’s get acquainted with Rails Hotwire.

MROY Team

If you are getting started with Rails it makes sense to read first:
- https://guides.rubyonrails.org/
- https://brdn.design/articles/good-resources-to-learn-ruby-rails-in-2022

Let’s get acquainted with Rails Hotwire.

Hotwire

https://hotwired.dev/
Hotwire is an approach to building web apps without using much JavaScript by sending HTML instead of JSON over the wire. Simply said, it allows you to create “monolith” single-page web application with Ruby / PHP / whatever on the back and (little) JS on the front (no React, Redux, Formik, etc).

Hotwire highlights:

It became possible with:

Hotwire consists of 3 technologies:

Hotwire is the default front-end framework since Rails 7 (released on December 15, 2021).

Before Hotwire there was https://github.com/defunkt/jquery-pjax. It would asynchronysly fetch fragments of HTML from the server and updated the dom.