Jonathan Bennett

Turbo 8 (Beta) Upgrade Guide

Mar 18, 2024: Check out the updated article for the release version

If you are already using Turbo 7, switching to Turbo 8, in all it’s morphing glory, is painless.

  1. Update the turbo-rails gem to the latest beta, 2.0.0.pre.beta.1 as of Dec 22, 2023
  2. Update @hotwired/turbo-rails in package.json to the latest beta, 8.0.0-beta.1 as of Dec 22, 2023
  3. Switch to the new morphing strategy in your layout:
1
2
3
4
5
<head>
	<!-- other head content -->
	<%= turbo_refreshes_with method: :morph, scroll: :preserve %>
	<%= content_for :head %>
</head>

This will globally enable the morphing strategy for your application. With this running (and tested), what’s your next step? Conduct an audit of all your Turbo Streams templates because you may find that most of them can be safely removed!