Add support for multiple frame targeting in Turbo
See hotwired/turbo#475 and hotwired/turbo#56. This is an alternative solution to implementing Turbo streams in situations where refactoring otherwise may be required.
$ npm install @miii/turbo-multiple-frame-targeting
import * as Turbo from '@hotwired/turbo'
import enableMultiFrameSupport from '@miii/turbo-multiple-frame-targeting'
Turbo.start()
enableMultiFrameSupport()
import * as Turbo from '@hotwired/turbo'
import { enable, disable } from '@miii/turbo-multiple-frame-targeting'
Turbo.start()
enable()
// Later...
disable()
This package will enable you to provide a space-separated list of identifiers, much like Stimulus.
<form data-turbo-frame="row_21 sidebar">
...
</form>
<a data-turbo-frame="row_21 sidebar">
...
</a>