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

29 commits

Author SHA1 Message Date
David Heinemeier Hansson
4a23cb3415
Output Action Cable JS without transpiling and as ESM (#42856)
* Output Action Cable JS without transpiling and as ESM

* Retain umd version under the old name, generate ESM version + duplicate under new name

* Precompile JavaScripts for direct asset pipeline use

* We've dropped support for IE11

* Include deprecation notice for the old file reference

Thanks @rafaelfranca 👍

* Allow app to opt out of precompiling actioncable js assets

cc @rafaelfranca

* Add changelog entries
2021-08-06 14:00:43 +02:00
Jonathan Hefner
949e4587d5 Allow missing Action Cable config
Since #37850, `config_for` returns `nil` instead of an empty Hash when
a config file does not contain configuration for the specified
environment.  Thus, the return value should be converted to a Hash
before calling `with_indifferent_access`.

Fixes #40548.
2020-11-06 11:45:51 -06:00
Akira Matsuda
40a8db6329 [Action Cable] require_relative => require
This basically reverts f851e1f705
2017-10-21 22:48:29 +09:00
Kir Shatrov
385825fb70 Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
Akira Matsuda
f851e1f705 [Action Cable] require => require_relative 2017-07-01 18:38:05 +09:00
Akira Matsuda
5473e390d3 self. is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
2017-01-05 19:58:52 +09:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Xavier Noria
b678eb57e9 applies new string literal convention in actioncable/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:13:46 +02:00
Michael Dever
0a8584456e Allow actioncable connections from any port in development 2016-06-16 21:04:43 +01:00
Matthew Draper
a8df1bc345 Properly support reloading for Action Cable channels 2016-06-02 04:08:48 +09:30
Xavier Noria
1dcf280014 renames ActionCable::Railtie to ActionCable::Engine
This is an engine living in action_cable/engine.rb, convention is to
call these things *::Engine.

Looking at thi git history looks like the current *::Railtie was just
an accident.
2016-05-04 06:47:57 -05:00
Javan Makhmali
6689d7c7b9 Share default mount path with client side .js 2016-03-03 21:27:52 -05:00
Matthew Draper
185c93eb0c Use AS::Executor / AS::Reloader to support reloading in ActionCable 2016-03-02 02:14:20 +10:30
Jon Moss
8b69f1eeba Enable Action Cable routes by default
This also marks Action Cable routes as internal to Rails.
2016-02-24 19:05:03 -05:00
Kasper Timm Hansen
861ece99bb Default connection class to ActionCable::Connection::Base.
Instead of depending on ApplicationCable::Connection being defined at initialize
we should inject it in the Railtie.

Thus we can kill more setup in the tests too.
2016-02-14 17:46:48 +01:00
Kasper Timm Hansen
661298176c Inject Rails' channel paths in engine.
We were explicitly referencing Rails.root in ActionCable::Server::Configuration.initialize,
thereby coupling ourselves to Rails.

Instead add `app/channels` to Rails' app paths and assign the existent files
to `channel_paths`.

Users can still append to those load paths with `<<` and `push` in `config/application.rb`.

This means we can remove the custom `Dir` lookup in `channel_paths` and the Rails
and root definitions in the tests.
2016-02-14 17:46:48 +01:00
Jon Moss
75489642c8 config_opts => cable, per @kaspth 2016-01-18 18:59:28 -05:00
Jon Moss
0016e0410b Adapterize ActionCable storage and extract behavior 2016-01-18 18:58:57 -05:00
David Heinemeier Hansson
910572fffe Another stab at only mounting redis if the config is there 2015-12-16 18:17:12 +01:00
David Heinemeier Hansson
7eb12796ca Assume that the cable server is running in-process by default, offer option to change that in config/environments/production.rb 2015-12-16 18:17:12 +01:00
David Heinemeier Hansson
51ad57989d Doh, should have read ff370ee617
Indeed we need this to be an engine for the internal assets to work
2015-12-16 15:52:46 +01:00
David Heinemeier Hansson
346a7528ef We are using railtie, not engine 2015-12-16 15:28:50 +01:00
Rafael Mendonça França
649b9d9321 Move the require to the right place 2015-12-15 16:05:42 -02:00
Rafael Mendonça França
96455349ff Configure the Action Cable's redis in the engine
This will decouple Action Cable from Rails.
2015-12-15 15:59:00 -02:00
Rafael Mendonça França
ff370ee617 Action Cable need to be a engine
Otherwise assets will not work
2015-12-15 15:21:36 -02:00
David Heinemeier Hansson
a8db0328a5 Switch from engine to railtie 2015-12-15 13:10:27 +01:00
Rafael Mendonça França
3d4a423cdc Hook in ActionView::Base, not in ApplicationController
The application can have more than one ApplicationController and we
want Action Cable helpers in all controllers and their views so we
should hook in the same place that others helpers.
2015-12-14 15:54:08 -02:00
Rafael Mendonça França
f8058a6aeb Require the top level file in the engine 2015-12-14 15:53:43 -02:00
David Heinemeier Hansson
bf40bddfce Get ready to merge into Rails 2015-12-14 15:48:54 +01:00
Renamed from lib/action_cable/engine.rb (Browse further)