-
-
Notifications
You must be signed in to change notification settings - Fork 637
Resolve double mounting error with Turbo(links) #1421
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
29ebe20
enhance turbo documentation
Judahmeek 467b032
switch from render to load event listeners
Judahmeek a6cc1e2
changelog
Judahmeek 5a1b748
update setOptions typing
Judahmeek 8cd4b57
restrict generator mini-css-extract-plugin version to 2.4.5
Judahmeek 0d94ca7
add typescripts changes
Judahmeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,16 +241,16 @@ function renderInit(): void { | |
if (turboInstalled()) { | ||
debugTurbolinks( | ||
'USING TURBO: document added event listeners ' + | ||
'turbo:before-render and turbo:render.'); | ||
document.addEventListener('turbo:before-render', reactOnRailsPageUnloaded); | ||
document.addEventListener('turbo:render', reactOnRailsPageLoaded); | ||
'turbo:before-visit and turbo:load.'); | ||
document.addEventListener('turbo:before-visit', reactOnRailsPageUnloaded); | ||
document.addEventListener('turbo:load', reactOnRailsPageLoaded); | ||
reactOnRailsPageLoaded(); | ||
} else if (turbolinksVersion5()) { | ||
debugTurbolinks( | ||
'USING TURBOLINKS 5: document added event listeners ' + | ||
'turbolinks:before-render and turbolinks:render.'); | ||
document.addEventListener('turbolinks:before-render', reactOnRailsPageUnloaded); | ||
document.addEventListener('turbolinks:render', reactOnRailsPageLoaded); | ||
'turbolinks:before-visit and turbolinks:load.'); | ||
document.addEventListener('turbolinks:before-visit', reactOnRailsPageUnloaded); | ||
document.addEventListener('turbolinks:load', reactOnRailsPageLoaded); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Judahmeek did you test on Turbolinks 5? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did. |
||
reactOnRailsPageLoaded(); | ||
} else { | ||
debugTurbolinks( | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Judahmeek do we need to update this here as it doesn't seem to include
turbo
?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.
we could allow for either string, but it's not totally required.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah I was thinking
turbo?: boolean
Or
turbo: boolean | null
or however it's actually defined.I think it'd help increase visibility because my IDE only shows
traceTurboLinks
.I'm speaking specifically about the d.ts file.
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.
if we could easily just have the shorter traceTurbo, that's better for the long-term.
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.
@Judahmeek, yes, we need to update the d.ts file.
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.
@justin808 my interpretation of the code seems slightly different.
For Turbo to work I need:
turbo: true
To see the logging I need:
traceTurboLinks: true
Both have to be on for it to work and log with Turbo.
--
Turbolinks seems to work without opting into it.
traceTurboLinks: true
just prints to the logs in that scenario.