-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix safari no styles #132
Fix safari no styles #132
Conversation
@@ -185,6 +185,33 @@ describe 'Turbolinks', -> | |||
assertLinks(['foo.css']) | |||
done() | |||
|
|||
it 'many subsequent navigations do not break head asset tracking', (done) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless we have a way to run Safari in CI, these don't seem valuable. They probably give a false sense of confidence to the next people who come along and try to update the head
query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I'll wipe them. :)
Changes LGTM. Should I 🎩? |
Yep, absolutely 🎩 if you can. If you point your repo at |
Changes LGTM 👍 |
Cool I think this is g2g then |
This PR fixes the
sometimes the app breaks
case where a user navigates several times within a TG application using0.3.0
.The breakages were the result of
Turbohead#update
missing the upstream document's css when processing it. This only occurred randomly (somewhere between 1/10 and 1/20 times) and only on safari. It seems to be the result of:Where the result of extractTrackedAssets would be different than the new implementation:
However, only sometimes, and only on safari. Debugging through or adding
console.log
to the loop steps would make the function perform as expected.Since
querySelector
does not give you a live collection, it seems to be some strange browser level behaviour involving live collections of DOM elements. Similar flakiness was also addressed previously in #93.In addition, there was some concern that we were not testing large numbers of subsequent navigations (though this is not specifically the issue as far as I can tell), so I've included additional tests for this case.