actioncable 5.2.8.1 → 6.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -112
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +1 -544
  5. data/app/assets/javascripts/action_cable.js +492 -0
  6. data/lib/action_cable/channel/base.rb +5 -1
  7. data/lib/action_cable/channel/test_case.rb +312 -0
  8. data/lib/action_cable/channel.rb +1 -0
  9. data/lib/action_cable/connection/authorization.rb +1 -1
  10. data/lib/action_cable/connection/base.rb +9 -7
  11. data/lib/action_cable/connection/message_buffer.rb +1 -4
  12. data/lib/action_cable/connection/stream.rb +4 -2
  13. data/lib/action_cable/connection/subscriptions.rb +1 -5
  14. data/lib/action_cable/connection/test_case.rb +236 -0
  15. data/lib/action_cable/connection/web_socket.rb +1 -3
  16. data/lib/action_cable/connection.rb +1 -0
  17. data/lib/action_cable/gem_version.rb +4 -4
  18. data/lib/action_cable/server/base.rb +3 -1
  19. data/lib/action_cable/server/worker.rb +5 -7
  20. data/lib/action_cable/subscription_adapter/postgresql.rb +24 -8
  21. data/lib/action_cable/subscription_adapter/redis.rb +2 -1
  22. data/lib/action_cable/subscription_adapter/test.rb +40 -0
  23. data/lib/action_cable/subscription_adapter.rb +1 -0
  24. data/lib/action_cable/test_case.rb +11 -0
  25. data/lib/action_cable/test_helper.rb +133 -0
  26. data/lib/action_cable.rb +15 -7
  27. data/lib/rails/generators/channel/USAGE +4 -5
  28. data/lib/rails/generators/channel/channel_generator.rb +6 -3
  29. data/lib/rails/generators/channel/templates/{assets → javascript}/channel.js.tt +3 -1
  30. data/lib/rails/generators/channel/templates/{assets/cable.js.tt → javascript/consumer.js.tt} +2 -9
  31. data/lib/rails/generators/channel/templates/javascript/index.js.tt +5 -0
  32. data/lib/rails/generators/test_unit/channel_generator.rb +20 -0
  33. data/lib/rails/generators/test_unit/templates/channel_test.rb.tt +8 -0
  34. metadata +24 -17
  35. data/lib/assets/compiled/action_cable.js +0 -601
  36. data/lib/rails/generators/channel/templates/assets/channel.coffee.tt +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c275c495cb08b541718ddfc4e2979d37a3da5afc14c03420d2a5d5a14aa148ba
4
- data.tar.gz: c6ec44589fcb7a7902e664b2473e1ebe67f80b9fe18d84cedbe10d23522f4ac8
3
+ metadata.gz: 20a6bcfcf415a9ea43c5d5c373f866bbef09a40408f9295e0977def92827b56f
4
+ data.tar.gz: ab61cfc6789eeba117d09b5472adb861d8afaade19486e6bd4b2f34917d13596
5
5
  SHA512:
6
- metadata.gz: 03cbafd5dadb32fef853347cf46c73ec8900a6f04b7329d7b89efbf6884c0d022b8e3caa0d6898e6e582ab5bf4fbb7e9a72776828199dea52bebce8a2484d62a
7
- data.tar.gz: 9927287ab8b306b8f2cf5c1107555fc86491712111d02bc53c3d266c8f9edb4f9d05cf8693a1cb2746e0e456f6099a78322510704ecc1c128dba9b349f3d3987
6
+ metadata.gz: 0fc74fe87659a01fbbb841a36de8bd2027d2c3ec73ea92f23706ae07bc8648e5c92cb1bd08bb4f6e00cbbab2c201db183badb1cecae8d7b4839232116fc43e24
7
+ data.tar.gz: b09eb6b5430aa9fe60eb41aa8a9e21ad59a49bf281f14cbcf562200ae09e9d2950cc0eb3ebc2d6019f506325cab1c7ff58ea735d4672643ca2de76fd99b86524
data/CHANGELOG.md CHANGED
@@ -1,134 +1,80 @@
1
- ## Rails 5.2.8.1 (July 12, 2022) ##
1
+ ## Rails 6.0.0.beta1 (January 18, 2019) ##
2
2
 
3
- * No changes.
3
+ * Merge [`action-cable-testing`](https://github.com/palkan/action-cable-testing) to Rails.
4
4
 
5
+ *Vladimir Dementyev*
5
6
 
6
- ## Rails 5.2.8 (May 09, 2022) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 5.2.7.1 (April 26, 2022) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 5.2.7 (March 10, 2022) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 5.2.6.3 (March 08, 2022) ##
22
-
23
- * No changes.
24
-
25
-
26
- ## Rails 5.2.6.2 (February 11, 2022) ##
27
-
28
- * No changes.
29
-
30
-
31
- ## Rails 5.2.6.1 (February 11, 2022) ##
32
-
33
- * No changes.
34
-
35
-
36
- ## Rails 5.2.6 (May 05, 2021) ##
37
-
38
- * No changes.
39
-
40
-
41
- ## Rails 5.2.5 (March 26, 2021) ##
42
-
43
- * No changes.
44
-
45
-
46
- ## Rails 5.2.4.6 (May 05, 2021) ##
47
-
48
- * No changes.
49
-
50
-
51
- ## Rails 5.2.4.5 (February 10, 2021) ##
52
-
53
- * No changes.
54
-
55
-
56
- ## Rails 5.2.4.4 (September 09, 2020) ##
57
-
58
- * No changes.
59
-
60
-
61
- ## Rails 5.2.4.3 (May 18, 2020) ##
62
-
63
- * No changes.
64
-
65
-
66
- ## Rails 5.2.4.2 (March 19, 2020) ##
67
-
68
- * No changes.
69
-
70
-
71
- ## Rails 5.2.4.1 (December 18, 2019) ##
72
-
73
- * No changes.
74
-
75
-
76
- ## Rails 5.2.4 (November 27, 2019) ##
77
-
78
- * No changes.
79
-
80
-
81
- ## Rails 5.2.3 (March 27, 2019) ##
82
-
83
- * No changes.
84
-
85
-
86
- ## Rails 5.2.2.1 (March 11, 2019) ##
87
-
88
- * No changes.
89
-
90
-
91
- ## Rails 5.2.2 (December 04, 2018) ##
92
-
93
- * No changes.
94
-
7
+ * The JavaScript WebSocket client will no longer try to reconnect
8
+ when you call `reject_unauthorized_connection` on the connection.
95
9
 
96
- ## Rails 5.2.1.1 (November 27, 2018) ##
10
+ *Mick Staugaard*
97
11
 
98
- * No changes.
12
+ * `ActionCable.Connection#getState` now references the configurable
13
+ `ActionCable.adapters.WebSocket` property rather than the `WebSocket` global
14
+ variable, matching the behavior of `ActionCable.Connection#open`.
99
15
 
16
+ *Richard Macklin*
100
17
 
101
- ## Rails 5.2.1 (August 07, 2018) ##
18
+ * The ActionCable javascript package has been converted from CoffeeScript
19
+ to ES2015, and we now publish the source code in the npm distribution.
102
20
 
103
- * No changes.
21
+ This allows ActionCable users to depend on the javascript source code
22
+ rather than the compiled code, which can produce smaller javascript bundles.
104
23
 
24
+ This change includes some breaking changes to optional parts of the
25
+ ActionCable javascript API:
105
26
 
106
- ## Rails 5.2.0 (April 09, 2018) ##
27
+ - Configuration of the WebSocket adapter and logger adapter have been moved
28
+ from properties of `ActionCable` to properties of `ActionCable.adapters`.
29
+ If you are currently configuring these adapters you will need to make
30
+ these changes when upgrading:
107
31
 
108
- * Removed deprecated evented redis adapter.
32
+ ```diff
33
+ - ActionCable.WebSocket = MyWebSocket
34
+ + ActionCable.adapters.WebSocket = MyWebSocket
35
+ ```
36
+ ```diff
37
+ - ActionCable.logger = myLogger
38
+ + ActionCable.adapters.logger = myLogger
39
+ ```
109
40
 
110
- *Rafael Mendonça França*
41
+ - The `ActionCable.startDebugging()` and `ActionCable.stopDebugging()`
42
+ methods have been removed and replaced with the property
43
+ `ActionCable.logger.enabled`. If you are currently using these methods you
44
+ will need to make these changes when upgrading:
111
45
 
112
- * Support redis-rb 4.0.
46
+ ```diff
47
+ - ActionCable.startDebugging()
48
+ + ActionCable.logger.enabled = true
49
+ ```
50
+ ```diff
51
+ - ActionCable.stopDebugging()
52
+ + ActionCable.logger.enabled = false
53
+ ```
113
54
 
114
- *Jeremy Daer*
55
+ *Richard Macklin*
115
56
 
116
- * Hash long stream identifiers when using PostgreSQL adapter.
57
+ * Add `id` option to redis adapter so now you can distinguish
58
+ ActionCable's redis connections among others. Also, you can set
59
+ custom id in options.
117
60
 
118
- PostgreSQL has a limit on identifiers length (63 chars, [docs](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)).
119
- Provided fix minifies identifiers longer than 63 chars by hashing them with SHA1.
61
+ Before:
62
+ ```
63
+ $ redis-cli client list
64
+ id=669 addr=127.0.0.1:46442 fd=8 name= age=18 ...
65
+ ```
120
66
 
121
- Fixes #28751.
67
+ After:
68
+ ```
69
+ $ redis-cli client list
70
+ id=673 addr=127.0.0.1:46516 fd=8 name=ActionCable-PID-19413 age=2 ...
71
+ ```
122
72
 
123
- *Vladimir Dementyev*
73
+ *Ilia Kasianenko*
124
74
 
125
- * Action Cable's `redis` adapter allows for other common redis-rb options (`host`, `port`, `db`, `password`) in cable.yml.
75
+ * Rails 6 requires Ruby 2.5.0 or newer.
126
76
 
127
- Previously, it accepts only a [redis:// url](https://www.iana.org/assignments/uri-schemes/prov/redis) as an option.
128
- While we can add all of these options to the `url` itself, it is not explicitly documented. This alternative setup
129
- is shown as the first example in the [Redis rubygem](https://github.com/redis/redis-rb#getting-started), which
130
- makes this set of options as sensible as using just the `url`.
77
+ *Jeremy Daer*, *Kasper Timm Hansen*
131
78
 
132
- *Marc Rendl Ignacio*
133
79
 
134
- Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actioncable/CHANGELOG.md) for previous changes.
80
+ Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actioncable/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2018 Basecamp, LLC
1
+ Copyright (c) 2015-2019 Basecamp, LLC
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the