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
Add documentation about Action Cable npm package #24991
Conversation
r? @jeremy |
@@ -460,6 +460,28 @@ with all the popular application servers -- Unicorn, Puma and Passenger. | |||
Action Cable does not work with WEBrick, because WEBrick does not support the | |||
Rack socket hijacking API. | |||
|
|||
## npm usage | |||
|
|||
In addition to being available through the `actioncable` gem, Action Cable's frontend JS assets are also bundled in an officially supported npm |
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.
This line is too long
96c79b2
to
82b7037
Compare
sorry for the delay @jeremy, updated 👍 |
|
||
In addition to being available through the `actioncable` gem, Action Cable's | ||
frontend JS assets are also bundled in an officially supported npm module, | ||
intended for usage in standalone frontends that communicate with a Rails application. |
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.
frontend Applications
82b7037
to
d4fbb56
Compare
updated 👍 |
```javascript | ||
ActionCable = require('actioncable') | ||
|
||
cable = ActionCable.createConsumer('wss://RAILS-API-PATH.com/cable') |
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.
var cable
Sorry, forgot to include in my main PR :( [ci skip] [Jon Moss, Zach Schneider]
d4fbb56
to
1713075
Compare
👍 we should push for global variables rather than instantiating consumers all over the place ;) |
@maclover7 ideally one will instantiate and export them. There is no "global" per say in npm App, and its relative. |
👍 yep, this is just meant to get people started |
Getting this in for the release, since related changes are already in as part of #24991. |
Add documentation about Action Cable npm package
Add documentation about Action Cable npm package
Sorry, forgot to include in my main PR :(
[ci skip]
Jon Moss, Zach Schneider
cc @jeremy @javan