1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Document the ActionCable JS changes in the upgrade guide & release notes

This commit is contained in:
Richard Macklin 2019-01-14 15:47:37 -08:00
parent fcd38cf19f
commit f8076e14b4
2 changed files with 52 additions and 0 deletions

View file

@ -92,6 +92,22 @@ Please refer to the [Changelog][action-cable] for detailed changes.
### Notable changes
* The ActionCable javascript package has been converted from CoffeeScript
to ES2015, and we now publish the source code in the npm distribution.
This allows ActionCable users to depend on the javascript source code
rather than the compiled code, which can produce smaller javascript bundles.
This change includes some breaking changes to optional parts of the
ActionCable javascript API:
- Configuration of the WebSocket adapter and logger adapter have been moved
from properties of `ActionCable` to properties of `ActionCable.adapters`.
- The `ActionCable.startDebugging()` and `ActionCable.stopDebugging()`
methods have been removed and replaced with the property
`ActionCable.logger.enabled`.
Action Pack
-----------

View file

@ -97,6 +97,42 @@ If you require your cookies to be read by 5.2 and older, or you are still valida
to allow you to rollback set
`Rails.application.config.action_dispatch.use_cookies_with_metadata` to `false`.
### ActionCable javascript API Changes
The ActionCable javascript package has been converted from CoffeeScript
to ES2015, and we now publish the source code in the npm distribution.
This change includes some breaking changes to optional parts of the
ActionCable javascript API:
- Configuration of the WebSocket adapter and logger adapter have been moved
from properties of `ActionCable` to properties of `ActionCable.adapters`.
If you are currently configuring these adapters you will need to make
these changes when upgrading:
```diff
- ActionCable.WebSocket = MyWebSocket
+ ActionCable.adapters.WebSocket = MyWebSocket
```
```diff
- ActionCable.logger = myLogger
+ ActionCable.adapters.logger = myLogger
```
- The `ActionCable.startDebugging()` and `ActionCable.stopDebugging()`
methods have been removed and replaced with the property
`ActionCable.logger.enabled`. If you are currently using these methods you
will need to make these changes when upgrading:
```diff
- ActionCable.startDebugging()
+ ActionCable.logger.enabled = true
```
```diff
- ActionCable.stopDebugging()
+ ActionCable.logger.enabled = false
```
Upgrading from Rails 5.1 to Rails 5.2
-------------------------------------