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

Import session instead of reading window.Turbo.session #1094

Merged

Conversation

seanpdoyle
Copy link
Contributor

Follow-up to #1049
Follow-up to #1073
Related to #1078

Replace an internal window.Turbo.session access with an import { session } statement.

Prior attempts at this change introduced circular dependencies. This attempt does not. Additionally, this change maintains the ability for consumers to access StreamActions through window.Turbo.StreamActions, while also enabling import { StreamActions } from "@hotwired/turbo" (or from "@hotwired/turbo-rails").

Follow-up to [hotwired#1049][]
Follow-up to [hotwired#1073][]
Related to [hotwired#1078][]

Replace an internal `window.Turbo.session` access with an `import {
session }` statement.

Prior attempts at this change introduced circular dependencies. This
attempt does not. Additionally, this change maintains the ability for
consumers to access StreamActions through `window.Turbo.StreamActions`,
while also enabling `import { StreamActions } from "@hotwired/turbo"`
(or `from "@hotwired/turbo-rails"`).

[hotwired#1049]: hotwired#1049
[hotwired#1073]: hotwired#1073
[hotwired#1078]: hotwired#1078
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sorting this out @seanpdoyle

@jorgemanrubia jorgemanrubia merged commit 5c48398 into hotwired:main Dec 2, 2023
1 check passed
@seanpdoyle seanpdoyle deleted the remove-window-turbo-reference branch December 15, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants