rails/request.js

0.0.11 Version has Breaking Changes Requiring Turbo >8.0.0

Closed this issue · 1 comments

Logging this for visibility - There was a change added here that uses window.Turbo.fetch but fetch was only added as part of Turbo >8.0.0 so our requests were failing with window.Turbo.fetch being undefined

Can we update the release for 0.0.11 for higher visibility on the Turbo 8 requirement?

Thanks @Monica-Nguyen, I have updated the release to mention this breaking change https://github.com/rails/request.js/releases/tag/v0.0.11

I think we could have avoided it by changing the check from this

(this.responseKind === 'turbo-stream' && window.Turbo)

to

(this.responseKind === 'turbo-stream' && window.Turbo && window.Turbo.hasOwnProperty('fetch'))

However, since we already have those versions requiring Turbo 8, we will keep it as it is.