imsky / imsky/holder

Support Turbolinks 5

Open
#208 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

Hi, I was hoping you could support Turbolinks 5.

I think I've found what code needs to be changed but don't do much Javascript and don't understand how this code is packaged.

I think what needs to be changed is here in index.js:

```javascript
if (typeof global.Turbolinks == 'object') {
global.document.addEventListener('page:change', function() {
Holder.run();
});
}
```

to
```javascript
if (typeof global.Turbolinks.controller == 'object') { // Turbolinks 5
global.document.addEventListener('turbolinks:load', function() {
Holder.run();
});
} else if (typeof global.Turbolinks == 'object') { // Turbolinks Classic
global.document.addEventListener('page:change', function() {
Holder.run();
});
}
```

I hope this makes sense.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with index.js and inspect how the JavaScript is packaged, since the issue identifies the Turbolinks integration point. Verify the behavior for Turbolinks 5 using the turbolinks:load event while preserving the existing page:change behavior for Turbolinks Classic; done means both integrations trigger Holder.run().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.