actioncable 5.2.8 → 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 -107
  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 +21 -14
  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: 8ce063d166e88ff88c70dc608fd96349cdf6b8df88d00d90769e12493675be7c
4
- data.tar.gz: 2e269ba23af4895d32c96e61136d3676ff9ecabb72042da8cf50a899c46b8800
3
+ metadata.gz: 20a6bcfcf415a9ea43c5d5c373f866bbef09a40408f9295e0977def92827b56f
4
+ data.tar.gz: ab61cfc6789eeba117d09b5472adb861d8afaade19486e6bd4b2f34917d13596
5
5
  SHA512:
6
- metadata.gz: e77ebb607e5a74504e0c4c7c142ed6582a6daf26603cf3f3a0e7374a0c0971970054edb8f4a221f2acc6a551fe679ac80a3276abdbbdc63a6331dd1928ca29ce
7
- data.tar.gz: 8b963957e485dafc1f6f1d4e72345f601155d65a7601b2d9e57423ad6c14856d4cba986b51f5e6f5d0a7ad008914c77d4aac568a35cadd043d77ef78ff30f9eb
6
+ metadata.gz: 0fc74fe87659a01fbbb841a36de8bd2027d2c3ec73ea92f23706ae07bc8648e5c92cb1bd08bb4f6e00cbbab2c201db183badb1cecae8d7b4839232116fc43e24
7
+ data.tar.gz: b09eb6b5430aa9fe60eb41aa8a9e21ad59a49bf281f14cbcf562200ae09e9d2950cc0eb3ebc2d6019f506325cab1c7ff58ea735d4672643ca2de76fd99b86524
data/CHANGELOG.md CHANGED
@@ -1,129 +1,80 @@
1
- ## Rails 5.2.8 (May 09, 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.7.1 (April 26, 2022) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 5.2.7 (March 10, 2022) ##
12
-
13
- * No changes.
14
-
15
-
16
- ## Rails 5.2.6.3 (March 08, 2022) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 5.2.6.2 (February 11, 2022) ##
22
-
23
- * No changes.
24
-
25
-
26
- ## Rails 5.2.6.1 (February 11, 2022) ##
27
-
28
- * No changes.
29
-
30
-
31
- ## Rails 5.2.6 (May 05, 2021) ##
32
-
33
- * No changes.
34
-
35
-
36
- ## Rails 5.2.5 (March 26, 2021) ##
37
-
38
- * No changes.
39
-
40
-
41
- ## Rails 5.2.4.6 (May 05, 2021) ##
42
-
43
- * No changes.
44
-
45
-
46
- ## Rails 5.2.4.5 (February 10, 2021) ##
47
-
48
- * No changes.
49
-
50
-
51
- ## Rails 5.2.4.4 (September 09, 2020) ##
52
-
53
- * No changes.
54
-
55
-
56
- ## Rails 5.2.4.3 (May 18, 2020) ##
57
-
58
- * No changes.
59
-
60
-
61
- ## Rails 5.2.4.2 (March 19, 2020) ##
62
-
63
- * No changes.
64
-
65
-
66
- ## Rails 5.2.4.1 (December 18, 2019) ##
67
-
68
- * No changes.
69
-
70
-
71
- ## Rails 5.2.4 (November 27, 2019) ##
72
-
73
- * No changes.
74
-
75
-
76
- ## Rails 5.2.3 (March 27, 2019) ##
77
-
78
- * No changes.
79
-
80
-
81
- ## Rails 5.2.2.1 (March 11, 2019) ##
82
-
83
- * No changes.
84
-
85
-
86
- ## Rails 5.2.2 (December 04, 2018) ##
87
-
88
- * No changes.
89
-
7
+ * The JavaScript WebSocket client will no longer try to reconnect
8
+ when you call `reject_unauthorized_connection` on the connection.
90
9
 
91
- ## Rails 5.2.1.1 (November 27, 2018) ##
10
+ *Mick Staugaard*
92
11
 
93
- * 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`.
94
15
 
16
+ *Richard Macklin*
95
17
 
96
- ## 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.
97
20
 
98
- * 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.
99
23
 
24
+ This change includes some breaking changes to optional parts of the
25
+ ActionCable javascript API:
100
26
 
101
- ## 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:
102
31
 
103
- * 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
+ ```
104
40
 
105
- *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:
106
45
 
107
- * 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
+ ```
108
54
 
109
- *Jeremy Daer*
55
+ *Richard Macklin*
110
56
 
111
- * 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.
112
60
 
113
- PostgreSQL has a limit on identifiers length (63 chars, [docs](https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)).
114
- 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
+ ```
115
66
 
116
- 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
+ ```
117
72
 
118
- *Vladimir Dementyev*
73
+ *Ilia Kasianenko*
119
74
 
120
- * 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.
121
76
 
122
- Previously, it accepts only a [redis:// url](https://www.iana.org/assignments/uri-schemes/prov/redis) as an option.
123
- While we can add all of these options to the `url` itself, it is not explicitly documented. This alternative setup
124
- is shown as the first example in the [Redis rubygem](https://github.com/redis/redis-rb#getting-started), which
125
- makes this set of options as sensible as using just the `url`.
77
+ *Jeremy Daer*, *Kasper Timm Hansen*
126
78
 
127
- *Marc Rendl Ignacio*
128
79
 
129
- 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