Is it best practice to keep both format.html and format.turbo_stream responses in the respond_to block for ALL controller responses? Is there any scenario where it is safe to only include a turbo_stream response?
The Hotwire documentation states:
It’s good practice to start your interaction design without Turbo Streams. Make the entire application work as it would if Turbo Streams were not available, then layer them on as a level-up. This means you won’t come to rely on the updates for flows that need to work in native applications or elsewhere without them.
The same is especially true for WebSocket updates. On poor connections, or if there are server issues, your WebSocket may well get disconnected. If the application is designed to work without it, it’ll be more resilient.
I am assuming this means we should always have non-Turbo Stream responses, error-handlings, etc. as a fallback?
I successfully implemented Turbo Streams in one of my #index pages. I have a table with rows representing each model in the collection, with action buttons in each row that would let the user update the model. Previously, the buttons linked to separate #edit form pages, and then the standard CRUD flow for #show, error handling, etc. Now with Turbo Streams the user can update rows without leaving the #index table view. It's terrific. I'm was hoping to get rid of the old view pages, but wondering if I need to keep them around as a fallback.