Closed bilogic closed 1 year ago
It's definitely tricky. I covered a similar use case in this blogpost.
The main ideas behind it are:
data-turbo-permanent
element, so it's persisted when navigating, which makes the Turbo Frame wrapping it not reload (see docs)_top
(makes a full visit, changing URL)I'll close the issue for now, but please let me know if that was helpful.
Simplified view of a typical admin panel
I have been stuck with this for a while, but the problem has been clearer and easier to define now, let me explain:
When I click on the red side menu, I expect blue and green to change
https://discuss.hotwired.dev/t/turbo-stream-inside-turbo-frame-response-is-this-a-legit-pattern/3812/2 I read that it is possible to embed a turbo stream in a turbo frame but it feels hacky and can be quite a challenge to implement. The only way I thought of now is to make special provisions when returning a turbo-frame, i.e. we can dynamically embed a stream when rendering the full/partial blade HTML, but this could become uncacheable.
Am I just overcomplicating the solution or is there already a simpler and elegant one to the above?
Thank you!