You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes [hotwired#679][]
Prior to this change, calls to
`Turbo::Streams::Broadcasts#broadcast_remove_to` would render a
view partial that corresponds to the model *regardless* of whether or
not the contents of that render would be included in the broadcast
`<turbo-stream>` element.
Not only is it wasteful to render HTML and then do nothing with it, it
also poses the risk of failing due to errors raised during the rendering
process.
This commit restructures the contents of the
`Turbo::Streams::Broadcasts#broadcast_action_to` method to skip
extraneous rendering if `render: false` is passed. In addition, it
ensures that calls to `broadcast_remove_to` pass `render: false` by
default.
[hotwired#679]: hotwired#679
v2.0.8 and v2.0.9 contain an issue where
broadcast_remove_to
requiresrender: false
For example:
after_destroy -> { broadcast_remove_to("#{user_id}-activities") }
throws "ActionView::MissingTemplate: Missing partial" errors unless it's rewritten to
after_destroy -> { broadcast_remove_to("#{user_id}-activities", render: false) }
Introduced in #511
Initial commit: 5d6e604
Rebase commit: 76f492a
Code in question:
turbo-rails/app/models/concerns/turbo/broadcastable.rb
Lines 126 to 133 in 5d6e604
The text was updated successfully, but these errors were encountered: