jason-rails 0.8.4 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/app/controllers/jason/jason_controller.rb +1 -0
- data/client/lib/transportAdapters/pusherAdapter.js +9 -5
- data/client/package.json +1 -1
- data/client/src/transportAdapters/pusherAdapter.ts +14 -6
- data/lib/jason/version.rb +1 -1
- data/lib/jason.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b766be80d826748b141369620c08ecd14c107b5473e47b5da61bcc30587f1f91
|
4
|
+
data.tar.gz: d3b7c5fbfe078bd6235ad623add82bc64b3f8ea3c022241b089b25604b5a657a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feeb87b727b1517b22885b94c0b88f35baa886caefb5514d30c919d7902f520f5530273887badff425cb14c6ba0e067ecc17106299d2f823bb51e0d0e740c1de
|
7
|
+
data.tar.gz: 179e9ea89836b4dae0f3402e99a640642e5b5dd06e47587e79fe20d0e672099f8df74b56242e200d403fd4de1cca17c305c4a2ff0d7c65c898daec7bdc6f913d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## v0.8.6
|
2
|
+
- Fix config usage, to allow changing websocket provider
|
3
|
+
|
1
4
|
## v0.8.4
|
2
5
|
- Fix implicit kwargs that fail in Ruby 3+
|
3
6
|
|
@@ -63,4 +66,4 @@ act.posts.add({ name: 'new post' })
|
|
63
66
|
## v0.6.5
|
64
67
|
- Added `reset!` and `reset!(hard: true)` methods to `Subscription`. Reset will load the IDs that should be part of the subscription from the database, and ensure that the graph matches those. It then re-broadcasts the payloads to all connected clients. Hard reset will do the same, but also clear all cached IDs and subscription hooks on instances - this is equivalent from starting from scratch.
|
65
68
|
- Added `enforce: boolean` option to GraphHelper
|
66
|
-
- When subscriptions are re-activated they now set the IDs with `enforce: true`, as there could be conditions where updates that were made while a subscription was not active would not be properly registered.
|
69
|
+
- When subscriptions are re-activated they now set the IDs with `enforce: true`, as there could be conditions where updates that were made while a subscription was not active would not be properly registered.
|
@@ -9,12 +9,16 @@ const uuid_1 = require("uuid");
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
10
10
|
function pusherAdapter(jasonConfig, handlePayload, dispatch) {
|
11
11
|
const consumerId = uuid_1.v4();
|
12
|
-
const { pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig;
|
13
|
-
|
14
|
-
cluster:
|
12
|
+
const { pusherHost, pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig;
|
13
|
+
let config = {
|
14
|
+
cluster: pusherRegion,
|
15
15
|
forceTLS: true,
|
16
|
-
authEndpoint: '/jason/api/pusher/auth'
|
17
|
-
}
|
16
|
+
authEndpoint: '/jason/api/pusher/auth',
|
17
|
+
};
|
18
|
+
if (pusherHost) {
|
19
|
+
config = Object.assign(Object.assign({}, config), { wsHost: pusherHost, httpHost: pusherHost });
|
20
|
+
}
|
21
|
+
const pusher = new pusher_js_1.default(pusherKey, config);
|
18
22
|
pusher.connection.bind('state_change', ({ current }) => {
|
19
23
|
if (current === 'connected') {
|
20
24
|
dispatch({ type: 'jason/upsert', payload: { connected: true } });
|
data/client/package.json
CHANGED
@@ -6,12 +6,20 @@ import _ from 'lodash'
|
|
6
6
|
export default function pusherAdapter(jasonConfig, handlePayload, dispatch) {
|
7
7
|
const consumerId = uuidv4()
|
8
8
|
|
9
|
-
const { pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig
|
10
|
-
|
11
|
-
cluster:
|
9
|
+
const { pusherHost, pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig
|
10
|
+
let config : any = {
|
11
|
+
cluster: pusherRegion,
|
12
12
|
forceTLS: true,
|
13
|
-
authEndpoint: '/jason/api/pusher/auth'
|
14
|
-
}
|
13
|
+
authEndpoint: '/jason/api/pusher/auth',
|
14
|
+
}
|
15
|
+
if (pusherHost) {
|
16
|
+
config = {
|
17
|
+
...config,
|
18
|
+
wsHost: pusherHost,
|
19
|
+
httpHost: pusherHost,
|
20
|
+
}
|
21
|
+
}
|
22
|
+
const pusher = new Pusher(pusherKey, config)
|
15
23
|
pusher.connection.bind('state_change', ({ current }) => {
|
16
24
|
if (current === 'connected') {
|
17
25
|
dispatch({ type: 'jason/upsert', payload: { connected: true } })
|
@@ -68,4 +76,4 @@ export default function pusherAdapter(jasonConfig, handlePayload, dispatch) {
|
|
68
76
|
}
|
69
77
|
|
70
78
|
return { getPayload, createSubscription, removeSubscription }
|
71
|
-
}
|
79
|
+
}
|
data/lib/jason/version.rb
CHANGED
data/lib/jason.rb
CHANGED
@@ -22,6 +22,7 @@ module Jason
|
|
22
22
|
self.mattr_accessor :transport_service
|
23
23
|
self.mattr_accessor :redis
|
24
24
|
self.mattr_accessor :pusher
|
25
|
+
self.mattr_accessor :pusher_host
|
25
26
|
self.mattr_accessor :pusher_key
|
26
27
|
self.mattr_accessor :pusher_region
|
27
28
|
self.mattr_accessor :pusher_channel_prefix
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jason-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Rees
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
262
|
- !ruby/object:Gem::Version
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
|
-
rubygems_version: 3.1
|
265
|
+
rubygems_version: 3.4.1
|
266
266
|
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: Reactive user interfaces with minimal boilerplate, using Rails + Redux
|