-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of Turbolinks 5 on the server side. #10
Conversation
This is an alpha version, it isn't production-ready yet.
[ci skip]
By the way, You can download a Laravel demo application which uses Turbolinks 5, here: |
Thanks! I'll try to look at it this week. |
Hi @carlalexander, Any news on this pull request? Cheers, |
Sorry @tortuetorche, I ended up being swamped the last two weeks. There are conflicts with the merge that I need to look at. I also noticed some of the documentation badges are pointing to the wrong branch now. I'll try to look at this over the weekend or next week. Sorry again for the delay. |
So I've looked over the PR, everything in the |
Hi @carlalexander,
For jQuery compatibility, there is a new library https://github.com/wshostak/turbolinks-jquery which is compatible with Turbolinks 5, but I didn't test it yet. Have a good day |
I updated this pull request description to explain how we can use Turbolinks options on the server side. |
Thanks @tortuetorche! Sorry, been swamped and haven't looked into the new stuff 😞 |
Works like a charm for me 👍 |
['turbolinks' => false] // skip turbolinks redirection, if the `turbolinks` option is identical (===) to false [] // turbolinks default redirection behavior, the `replace` action ['turbolinks' => 0] // turbolinks default redirection behavior, the `replace` action ['turbolinks' => ''] // turbolinks default redirection behavior, the `replace` action ['turbolinks' => null] // turbolinks default redirection behavior, the `replace` action ['turbolinks' => 'any_other_string_than_advance'] // turbolinks default redirection behavior, the `replace` action ['turbolinks' => 'advance'] // turbolinks custom redirection, with the `advance` action
My pull request is ready to be merged 🚀 Happy New Year 2017 🎆 |
Thanks for your all your work @tortuetorche! Version bumped to 2.0.0. |
Based on https://github.com/turbolinks/turbolinks-rails
FYI, jQuery Turbolinks doesn't support Turbolinks 5, see kossnocorp/jquery.turbolinks#56.
So you can use https://github.com/rstacruz/onmount or https://github.com/wshostak/turbolinks-jquery instead.
For Laravel framework support, see
https://github.com/efficiently/turbolinks/tree/turbo5https://github.com/frenzyapp/turbolinks/tree/3.1.0 and these snippets:Put this code in your
app/Http/Controllers/Controller.php
file:NOTE: The
redirectToWithTurbolinks()
code is here.Then in your
app/Http/Controllers/MessagesController.php
file:Specific Turbolinks options of the
$options
parameter can be passed to the->redirectTo()
method (or->redirectToWithTurbolinks()
macro):NOTE: During an
advance
redirection, Turbolinks pushes a new entry onto the browser’s history stack using history.pushState.Related to #9
For Turbolinks 3, see #6
Have a good day,
Tortue Torche