-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding Turbolinks (front-end and backend) #237
Comments
I've run in to an issue with Turbolinks in Gym regarding anchoring that's a bit unfortuante: turbolinks/turbolinks#75 You can get around it by adding data-turbolinks="false" to the anchors manually. |
Another issue: if you get a 500 error, and then go back to the site, various javascripty things are screwed up—for example on gym, there's now a duplicate search bar for athletes, and toggling things basically toggles them twice, so it flashes them on and off. |
I've started a turbolinks branch: Issues fixed so far:
Issues currently unresolved:
I've updated the main issue with a list of done/not done tasks. |
Awesome. Will take a look soon, hopefully. |
We ran in to an issue with AddThis where it would cache the Facebook share links. |
Summary
In my experience, Turbolinks makes things feel faster. Turbolinks was revamped in Rails 5, and it's not going away any time soon.
Status
Work has started on this feature:
https://github.com/katalyst/koi/tree/feature/turbolinks
Possibly more things I haven't come across yet, feel free to edit this issue and add new tasks.
Motivation
The Gym experiment
As a trial, we added Turbolinks to the Gym when we did the rails rewrite. From what I can tell, this experiment was pretty successful. With a few reasonably minor code changes, and a couple of gotchas, Turbolinks gave the app a very smooth feel—on many pages, just as fast if not faster than the previous Ember build. Take a look yourself, have a click around, compare it to our other sites:
https://gymnastics-staging.vat.org.au/manager/gym-sports/1/athletes
manager@katalyst.com.au
Nw3WrunL
Native-ish apps
If the turbolinks native iOS and android wrappers end up being solid, having Turbolinks built into our projects would open us up to building more app-like projects—or building app-friendly views for existing projects to be shipped natively.
Koi slowness
The Koi backend feels sluggish a lot of the time. There are various reasons for this and various things we can do to improve this situation, but Turbolinks could go a long way towards making it feel snappier, assuming everything plays nice.
Detailed design
Adding Turbolinks should will be trivial. The hard part will be testing to make sure that everything in (a) ornament and (b) koi still functions as intended, and fixing it if it doesn't. Turbolinks does have some implications for javascript that relies on page-load events. Quoted from the docs:
I suggest we set aside some time, give it a shot and see how much breaks. That'll give us a good idea on how easy it'll be.
Drawbacks
It might break things. Potentially lots of things. We won't know until we try, though! It may end up being more overhead than it's worth if it does cause problems, but we'll probably only be able to judge this after using it for some time. We'll want to make sure that it plays nice with all the plugins we regularly use on the front-end,
Things to worry about:
Among others. Feel free to add things to this list that rely on page-load hooks or that are reported to break with Turbolinks 5.
Alternatives
There are other options we can consider for the performance of both Koi and the Front-end (which I'll detail in other RFCs), but there's no reason we can't do both unless time becomes a constraint.
The text was updated successfully, but these errors were encountered: