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
For those of us on the turbolinks -> turbo upgrade path, it was great to see #39 in response to hotwired/turbo-rails#12 -- thanks for that. One thing I've noticed, however, is that when a 422 html response is rendered by Turbo in cases like this, turbo:load is not fired. I just checked in one of our apps with turbolinks, and it looks like Turbolinks would fire turbolinks:load in such a case.
The outcome with Turbo is that the 422 html response is rendered, but javascript functionality that hinges on turbo:load is broken. My expectation was that turbo:load would fire -- is that a reasonable expectation or is there something I'm missing here? One obvious solution is to refactor these cases to use a frame or stream I guess, but my hope after seeing #39 was that I could avoid frame/stream refactors until after the initial swap of turbo in for turbolinks and validating that Drive worked more/less ootb with our apps (following the notes in https://github.com/hotwired/turbo-rails/blob/main/UPGRADING.md).
Here's a repo demonstrating the lack of the turbo:load event in such a case (forked and slightly modified demo chat app) https://github.com/fwilkens/hotwire-rails-demo-chat/tree/demo_422_no_event. To see the issue, submit the New room form without a name, and note that there's no console log for the event listener on turbo:load.
The text was updated successfully, but these errors were encountered:
Hi,
For those of us on the turbolinks -> turbo upgrade path, it was great to see #39 in response to hotwired/turbo-rails#12 -- thanks for that. One thing I've noticed, however, is that when a 422 html response is rendered by Turbo in cases like this,
turbo:load
is not fired. I just checked in one of our apps with turbolinks, and it looks like Turbolinks would fireturbolinks:load
in such a case.The outcome with Turbo is that the 422 html response is rendered, but javascript functionality that hinges on
turbo:load
is broken. My expectation was thatturbo:load
would fire -- is that a reasonable expectation or is there something I'm missing here? One obvious solution is to refactor these cases to use a frame or stream I guess, but my hope after seeing #39 was that I could avoid frame/stream refactors until after the initial swap of turbo in for turbolinks and validating that Drive worked more/less ootb with our apps (following the notes in https://github.com/hotwired/turbo-rails/blob/main/UPGRADING.md).Here's a repo demonstrating the lack of the
turbo:load
event in such a case (forked and slightly modified demo chat app) https://github.com/fwilkens/hotwire-rails-demo-chat/tree/demo_422_no_event. To see the issue, submit the New room form without a name, and note that there's no console log for the event listener onturbo:load
.The text was updated successfully, but these errors were encountered: