anycable-rails 1.0.0.rc1 → 1.0.0.rc2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36b6e47a498bfc2d1156e4635a5c30f60258c925142c59ad837c1b6708f1ff73
4
- data.tar.gz: f27c94856df0db9d178537e8ac75598f8a355b338e725a80a5cb06a6e0ac610c
3
+ metadata.gz: e0de4d95da59574a14f3f56219154cf3e12513a74e677520acf0cffbbf566e49
4
+ data.tar.gz: c6a4e9b87c3c59aac495663f8acc9f3150a8de5f43d5ab55d19c265039ba2af1
5
5
  SHA512:
6
- metadata.gz: 28b72e3f6a9950d3a95eb8d4f1c6a59f24a704ff63ac50384ffb2d22aa97c9f6b6e1f0c882a89cc6a0fd9ac22ea553a381514d56885f6f1cce41e7146153ab24
7
- data.tar.gz: ac7c402d2b57a332ced9372a4546709d6b41a0fb082c823d292b87c8b11e4bf741047cbc10258f68acd228712f0ca974b6723246bd3ddc689920f656b1488974
6
+ metadata.gz: 93f85efbfa20cffe71b3b52115b98321158577a36439b9875e6bbfb18ecee32c44fd31376a05f8883b8eff7d8b06b4d2d5abf762f86f6765248e3051869f3b17
7
+ data.tar.gz: 2ca2cd646321b0ed567af383847e4ae5f5cab116be0a7c410ea18d91f43378c024c47e3002c0aa70ddd0970a4e2bad50fd173c0b1fdf9088f229bad3ea53a05d
@@ -1,5 +1,18 @@
1
1
  # Change log
2
2
 
3
+ ## master
4
+
5
+ ## 1.0.0.rc2 (2020-06-16)
6
+
7
+ - Fix connection identifiers deserialization regression. ([@palkan][])
8
+
9
+ Using non-strings or non-GlobalId-encoded objects was broken.
10
+
11
+ - Improve `anycable:setup` generator. ([@palkan][])
12
+
13
+ Update Docker snippet, do not enable persistent sessions automatically,
14
+ fix setting `config.action_cable.url` in environment configuration.
15
+
3
16
  ## 1.0.0.rc1 (2020-06-10)
4
17
 
5
18
  - Add `state_attr_accessor` for channels. ([@palkan][])
@@ -35,7 +35,7 @@ module AnyCable
35
35
  # If the resulting object is a Hash, make it indifferent
36
36
  def deserialize(str, json: false)
37
37
  str.yield_self do |val|
38
- next unless val.is_a?(String)
38
+ next val unless val.is_a?(String)
39
39
 
40
40
  gval = GlobalID::Locator.locate(val)
41
41
  return gval if gval
@@ -21,7 +21,7 @@ module ActionCable
21
21
  end
22
22
 
23
23
  def commit_session!
24
- return unless request_loaded? && request.session.loaded?
24
+ return unless request_loaded? && request.session.respond_to?(:loaded?) && request.session.loaded?
25
25
 
26
26
  socket.session = request.session.to_json
27
27
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "1.0.0.rc1"
5
+ VERSION = "1.0.0.rc2"
6
6
  end
7
7
  end
@@ -49,14 +49,18 @@ module AnyCableRailsGenerators
49
49
  environment(nil, env: :development) do
50
50
  <<~SNIPPET
51
51
  # Specify AnyCable WebSocket server URL to use by JS client
52
- config.action_cable.url = ENV.fetch("CABLE_URL", "ws://localhost:8080/cable") if AnyCable::Rails.enabled?
52
+ config.after_initialize do
53
+ config.action_cable.url = ActionCable.server.config.url = ENV.fetch("CABLE_URL", "ws://localhost:8080/cable") if AnyCable::Rails.enabled?
54
+ end
53
55
  SNIPPET
54
56
  end
55
57
 
56
58
  environment(nil, env: :production) do
57
59
  <<~SNIPPET
58
60
  # Specify AnyCable WebSocket server URL to use by JS client
59
- config.action_cable.url = ENV.fetch("CABLE_URL") if AnyCable::Rails.enabled?
61
+ config.after_initialize do
62
+ config.action_cable.url = ActionCable.server.config.url = ENV.fetch("CABLE_URL") if AnyCable::Rails.enabled?
63
+ end
60
64
  SNIPPET
61
65
  end
62
66
 
@@ -111,6 +115,12 @@ module AnyCableRailsGenerators
111
115
  say_status :info, "✅ config/initializers/anycable.rb with Devise configuration has been added"
112
116
  end
113
117
 
118
+ def stimulus_reflex
119
+ return unless stimulus_reflex?
120
+
121
+ say_status :help, "⚠️ Please, check out the documentation on using AnyCable with Stimulus Reflex: https://docs.anycable.io/v1/#/ruby/stimulus_reflex"
122
+ end
123
+
114
124
  def rubocop_compatibility
115
125
  return unless rubocop?
116
126
 
@@ -155,14 +165,16 @@ module AnyCableRailsGenerators
155
165
  say <<~YML
156
166
  ─────────────────────────────────────────
157
167
  ws:
158
- image: anycable/anycable-go:1.0.0.preview1
168
+ image: anycable/anycable-go:1.0
159
169
  ports:
160
170
  - '8080:8080'
161
171
  environment:
172
+ ANYCABLE_HOST: "0.0.0.0"
162
173
  ANYCABLE_REDIS_URL: redis://redis:6379/0
163
174
  ANYCABLE_RPC_HOST: anycable:50051
175
+ ANYCABLE_DEBUG: 1
164
176
  depends_on:
165
- - anycable-rpc
177
+ - anycable
166
178
  - redis
167
179
 
168
180
  anycable:
@@ -12,8 +12,8 @@
12
12
  default: &default
13
13
  # Turn on/off access logs ("Started..." and "Finished...")
14
14
  access_logs_disabled: false
15
- # Persist "dirty" session between RPC calls (might be required for StimulusReflex apps)
16
- persistent_session_enabled: <%= stimulus_reflex? %>
15
+ # Persist "dirty" session between RPC calls (might be required for apps using stimulus_reflex <3.0)
16
+ # persistent_session_enabled: true
17
17
  # This is the host and the port to run AnyCable RPC server on.
18
18
  # You must configure your WebSocket server to connect to it, e.g.:
19
19
  # $ anycable-go --rpc-host="<rpc hostname>:50051"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable