Skip to content
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

Turbolinks 5 Support #264

Closed
wants to merge 1 commit into from
Closed

Conversation

aaronvb
Copy link
Member

@aaronvb aaronvb commented Feb 10, 2016

  • Added turbolinksShim to support older versions of Turbolinks.
  • Updated dummy to use Turbolinks 5

I came up with two options to getting Turbolinks 5 in; update the event listeners or add a shim so we can have support for both the classic and Turbolink 5 events. I decided on the latter, based on the one in the Turbolinks 5 docs, that translates the classic events to the new Turbolinks 5 events giving support for classic and Turbolinks 5.

https://github.com/turbolinks/turbolinks#should-i-use-turbolinks-5-or-turbolinks-classic
https://github.com/turbolinks/turbolinks/blob/master/src/turbolinks/compatibility.coffee

Review on Reviewable

@justin808
Copy link
Member

@aaronvb my gut tells me that we want to detect which version of turbolinks is in use, rather than using a shim. Did you have a PR for doing the non-shim way?

@aaronvb
Copy link
Member Author

aaronvb commented Feb 10, 2016

@justin808 That was my initial idea but I haven't found an easy way to detect the javascript version of Turbolinks. I can see there are completely new functions between classic and 5, and I can do a comparison with that, but that seems hacky. Do you know of a way to figure out the version of Turbolinks loaded in the DOM?

@aaronvb
Copy link
Member Author

aaronvb commented Feb 10, 2016

@justin808
Copy link
Member

You should be able to determine this in 2 ways:

  1. On the ruby side, check the VERSION in the gem
  2. On the JS side, there's probably some function names on the Turbolinks object that differ between v2 and v5.

@aaronvb
Copy link
Member Author

aaronvb commented Feb 10, 2016

@justin808 since this is being handled in the npm_module I'll have to use the second option. I'll make another PR with the version check method. Thanks for the feedback!

@justin808
Copy link
Member

See turbolinks/turbolinks#6

- Added turbolinksShim to support older versions
  of Turbolinks.
- Updated dummy to use Turbolinks 5
@aaronvb aaronvb force-pushed the turbolinks_5_support branch from 5bda550 to 42fdc7f Compare February 11, 2016 20:49
@justin808
Copy link
Member

Closed in favor of #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants