Hotwire Discussion

Question about use case for Turbo

I am thinking about implementing something more or less like this:

  1. user loads a view (report) which - on page ready - does several queries (with AJAX) to another web page to retrieve additional information related to the report page;
  2. retrieved information is inserted into report page
  3. user can click any report item to get details, usually return to report page by using back browser button
  4. using back button triggers AJAX on report page
    I am wondering if it would be possible to “save” report page state in the browser history stack before leaving report page to avoid triggering AJAX again and again for each back visit. Or am I totally missing what Turbo (or history API) are capable of?

Thanks,

Adam

In my experience, Turbo is still too immature and confusing for your use case. Dealing with my own struggles when it comes to back button functionality right now.

For all the talk about Turbo giving us the power of an SPA with little JS, it’s still not there yet. The lack of documentation has been quite frustrating, but it is getting better slowly. I asked a question on this form and got 0 replies too, so it’s hit and miss when looking for answers. I have had to delve into the source code on many occasions, and my current app I am building is literally riding the bleeding edge of the library because I need the fixes in the latest beta release.

It’s an amazing piece of tech and I love the concept and wish I could contribute more, but it does seem like it will be a while before more use cases like yours are supported.

For my hotwire/turbo app, I gave up on making it an SPA and still have hard page loads for anything that I want the back button to be able to navigate back to.

Not sure if this is answering your question. Maybe others can give you a more technical response.

Thanks for sharing your experience. I appreciate even if it is not directly answering my question.

Caching the back history in memory is exactly what turbo does well.

I’m not sure where this is coming from. Just look through recent posts and you’ll see lots of replies.

@tleish I didn’t mean to offend. I know everyone is very busy and things can fall through the cracks.

The question I asked is here: How to restore back-button behavior?

I don’t see any replies so far.