isomorfeus-react 16.9.2 → 16.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/react_view_helper.rb +3 -2
- data/lib/react/component/callbacks.rb +12 -9
- data/lib/react/version.rb +1 -1
- 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: 81bc6523000cdabde5e53469a494472e5fc2bbf8afdfdc4ba90b5d0483f5aae5
|
4
|
+
data.tar.gz: f8c768ab6fadb01f0199b0cec8db35356b30759897369ba8db0c340ad5f2b15a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 613e7d265c470bab6690c0808395f699438dfcba5b71a1a346ebbbf9a0f897c8678d2afdd05409493ba64aa920c8af7fc3ad1c7a173ac5f2627cd369fb3f6c02
|
7
|
+
data.tar.gz: dbd5819a705824b0701650c5ea7e9c61a176d03eae852eb698de96652b7e89681f8d6e4e54353ee69b2308f274b77acd970a159601d862727c9eb8dc22cca4f7
|
@@ -19,12 +19,13 @@ module Isomorfeus
|
|
19
19
|
|
20
20
|
# if location_host and scheme are given and if Transport is loaded, connect and then render, otherwise do not render
|
21
21
|
ws_scheme = props[:location_scheme] == 'https:' ? 'wss:' : 'ws:'
|
22
|
+
location_host = props[:location_host] ? props[:location_host] : 'localhost'
|
22
23
|
api_ws_path = Isomorfeus.respond_to?(:api_websocket_path) ? Isomorfeus.api_websocket_path : ''
|
23
24
|
javascript << <<~JAVASCRIPT
|
24
|
-
var location_host = '#{
|
25
|
+
var location_host = '#{location_host}';
|
25
26
|
var ws_scheme = '#{ws_scheme}';
|
26
27
|
var api_ws_path = '#{api_ws_path}';
|
27
|
-
if (typeof global.Opal.Isomorfeus.Transport !== 'undefined' &&
|
28
|
+
if (typeof global.Opal.Isomorfeus.Transport !== 'undefined' && api_ws_path !== '') {
|
28
29
|
global.Opal.Isomorfeus.TopLevel["$transport_ws_url="](ws_scheme + location_host + api_ws_path);
|
29
30
|
global.Opal.send(global.Opal.Isomorfeus.Transport.$promise_connect(), 'then', [], ($$1 = function(){
|
30
31
|
try {
|
@@ -60,8 +60,8 @@ module React
|
|
60
60
|
%x{
|
61
61
|
var fun = function(error) {
|
62
62
|
var result = #{`this.__ruby_instance`.instance_exec(`error`, &block)};
|
63
|
-
if (result ===
|
64
|
-
if (
|
63
|
+
if (typeof result.$to_n === 'function') { result = result.$to_n() }
|
64
|
+
if (result === Opal.nil) { return null; }
|
65
65
|
return result;
|
66
66
|
}
|
67
67
|
if (self.lucid_react_component) { self.lucid_react_component.prototype.getDerivedStateFromError = fun; }
|
@@ -73,10 +73,12 @@ module React
|
|
73
73
|
%x{
|
74
74
|
var fun = function(props, state) {
|
75
75
|
Opal.React.active_redux_components.push(this.__ruby_instance);
|
76
|
-
#{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: props})`,
|
77
|
-
|
78
|
-
&block)};
|
76
|
+
var result = #{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: props})`,
|
77
|
+
`Opal.React.Component.State.$new({state: state})`, &block)};
|
79
78
|
Opal.React.active_redux_components.pop();
|
79
|
+
if (typeof result.$to_n === 'function') { result = result.$to_n() }
|
80
|
+
if (result === Opal.nil) { return null; }
|
81
|
+
return result;
|
80
82
|
}
|
81
83
|
if (self.lucid_react_component) { self.lucid_react_component.prototype.getDerivedStateFromProps = fun; }
|
82
84
|
else { self.react_component.prototype.getDerivedStateFromProps = fun; }
|
@@ -86,11 +88,12 @@ module React
|
|
86
88
|
def get_snapshot_before_update(&block)
|
87
89
|
%x{
|
88
90
|
var fun = function(prev_props, prev_state) {
|
89
|
-
|
90
|
-
#{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: prev_props})`,
|
91
|
-
|
92
|
-
&block)};
|
91
|
+
|
92
|
+
var result = #{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: prev_props})`,
|
93
|
+
`Opal.React.Component.State.$new({state: prev_state})`, &block)};
|
93
94
|
Opal.React.active_redux_components.pop();
|
95
|
+
if (result === Opal.nil) { return null; }
|
96
|
+
return result;
|
94
97
|
}
|
95
98
|
if (self.lucid_react_component) { self.lucid_react_component.prototype.getSnapshotBeforeUpdate = fun; }
|
96
99
|
else { self.react_component.prototype.getSnapshotBeforeUpdate = fun; }
|
data/lib/react/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-react
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.9.
|
4
|
+
version: 16.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
258
|
- !ruby/object:Gem::Version
|
259
259
|
version: '0'
|
260
260
|
requirements: []
|
261
|
-
rubygems_version: 3.0.
|
261
|
+
rubygems_version: 3.0.6
|
262
262
|
signing_key:
|
263
263
|
specification_version: 4
|
264
264
|
summary: React for Opal Ruby.
|