Yaroslav Shmarov - Hotwire Cookbook: Common Uses, Essential Patterns & Best Practices - Rails World

Discover the common uses, essential patterns, and best practices of Hotwire, a Ruby on Rails framework for building fast and scalable web applications, in this conference talk.

Key takeaways
  • Hotwire is a Ruby on Rails framework that allows you to create fast and scalable web applications.
  • Turbo is a component of Hotwire that helps to solve the problem of full page reloads caused by routing changes.
  • Turbo uses Action Controller.predict, which predicts what the client needs based on the JavaScript models and then renders a template for it.
  • Turbo also includes Turbo Drive, which is a server-rendered route that is rendered as a response to a JavaScript request.
  • You can use Turbo to create a single-page application, which can improve the user experience and reduce the amount of data transmitted.
  • You can also use Turbo with Stimulus, a JavaScript framework that provides a programmatic way to manipulate the DOM.
  • Turbo also includes TurboStreams, which is a real-time updates feature that allows you to update the page dynamically.
  • You can use TurboFrames to wrap elements in a TurboFrame and render them as a response to a TurboStream request.
  • TurboFrames are used to encapsulate the elements that you want to update in real-time and render them as a response to a TurboStream request.
  • You can also use TurboConfirm, which is a feature that allows you to confirm changes before they are saved.
  • You can use TurboFrames to create a single-page application that updates in real-time.
  • TurboFrames are used to encapsulate the elements that you want to update in real-time and render them as a response to a TurboStream request.