Closed eclemens closed 5 years ago
Hey @eclemens, thanks for the PR!
Did you try Using with Turbolinks instructions in the README? Is it working for you with those instructions or we need these changes as well? :)
Yes, I tried it and kind of worked, but it forces the page to fully refresh. This causes the page to load again everything including the CSS, JS files, etc. and breaking Turbolinks' purpose.
My approach works fine using the regular Turbolinks flow and do not requires the page to refresh/reload.
P. D. Thanks for maintaining this project.
Awesome, thanks for reporting this, I'll expand the README to inform the users!
Also, I'll see to launch your changes ASAP.
Any progress to merging this pull request?
@eclemens I'll try to find some time tomorrow or next weekend to test and push this :)
Would be nice to have this merged.
Hey y'all, just released 2.0.1 version with Turbolinks 5+ support => https://rubygems.org/gems/render_async/versions/2.0.1
If you can, try it out, and tell me how it goes 🍺
@eclemens @nikolalsvk Strangely this hasn't worked as expected.
Shouldn't the placeholder be hidden when a preview is available?
Hello @ebsalberto
When Turbolinks shows the preview it displays the last content the page had before it unloads, but once the page is grabbed from the server it replaces the preview. The page from the server has the placeholder, so it first displays the placeholder and then render_async runs.
Please let me know it this was what you meant.
@eclemens I was under the impression that this PR would prevent the placeholder of showing up when a preview is available. Does that make sense? If you look at the image above, it looks a bit weird showing a preview, then the loader and the new content.
Adding support for Turbolins 5+