actioncable 5.2.6.2 → 6.0.0.beta1

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