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

connection status class #589

Merged
merged 2 commits into from
Jun 15, 2022
Merged

Conversation

leastbad
Copy link
Contributor

Type of PR (feature, enhancement, bug fix, etc.)

Enhancement + Bug fix

Description

Moved the code responsible for handling Action Cable connection status classes on the DOM body from main SR initializer function to the Action Cable transport module. Brought AC consumer deprecation warning into the transport as well.

Refactored Action Cable transport module to call on a new connectionStatusClass function, reducing code repetition.

Created event listeners for turbolinks:load and turbo:load to run connectionStatusClass.

Renamed ActionCableTransport.set to ActionCableTransport.initialize.

Why should this be added

  1. Separation of concerns and preparation for pluggable transport mechanisms in SR 4.
  2. Fixes a bug where Turbo Drive would remove the body classes upon navigation.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

@leastbad leastbad added bug Something isn't working enhancement New feature or request javascript Pull requests that update Javascript code labels Jun 14, 2022
@leastbad leastbad added this to the 3.5 milestone Jun 14, 2022
@leastbad leastbad self-assigned this Jun 14, 2022
@leastbad leastbad merged commit 9d5945f into stimulusreflex:master Jun 15, 2022
@leastbad leastbad deleted the body_classes branch June 15, 2022 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant