isomorfeus-react 16.9.6 → 16.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/config.rb +8 -1
- data/lib/isomorfeus/top_level_browser.rb +18 -13
- data/lib/lucid_material/component/api.rb +16 -3
- data/lib/react/version.rb +1 -1
- data/lib/react_dom.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8597a16d99c067226f1832565d36bf5c9021a4f5b54a1ee2cd23c1c6da4309a
|
4
|
+
data.tar.gz: e712d0ebd4a43cf8e6311dfb1cf7b8dacdc1da3aed607f846f28fbd9a95c82dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46507c9416c5c04f684e4ceea2e7667c8c90976ded05c8ddb0e268b7420fc97bb1a41a2a37a57f5aa39d2b0ad5699d4ae74e3e93582251b56aa726c7ff30e497
|
7
|
+
data.tar.gz: 5884fb376630de3ae0fe2100dd86dd59c38b9918f9beb79ce38339a43049aa897b353a3e3dfe2630575187786c5515efc94e02e0307e394934db69ee325ed225
|
data/lib/isomorfeus/config.rb
CHANGED
@@ -73,7 +73,14 @@ module Isomorfeus
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def force_render
|
76
|
-
|
76
|
+
begin
|
77
|
+
if top_component
|
78
|
+
ReactDOM.find_dom_node(top_component) # if not mounted will raise
|
79
|
+
top_component.JS.forceUpdate()
|
80
|
+
end
|
81
|
+
rescue
|
82
|
+
`location.reload()` if on_browser?
|
83
|
+
end
|
77
84
|
nil
|
78
85
|
end
|
79
86
|
end
|
@@ -6,21 +6,26 @@ module Isomorfeus
|
|
6
6
|
root_element = `document.querySelector('div[data-iso-root]')`
|
7
7
|
component_name = root_element.JS.getAttribute('data-iso-root')
|
8
8
|
Isomorfeus.env = root_element.JS.getAttribute('data-iso-env')
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
begin
|
10
|
+
component = component_name.constantize
|
11
|
+
props_json = root_element.JS.getAttribute('data-iso-props')
|
12
|
+
props = `Opal.Hash.$new(JSON.parse(props_json))`
|
13
|
+
hydrated = root_element.JS.getAttribute('data-iso-hydrated')
|
14
|
+
state_json = root_element.JS.getAttribute('data-iso-state')
|
15
|
+
if state_json
|
16
|
+
%x{
|
17
|
+
var state = JSON.parse(state_json);
|
18
|
+
var keys = Object.keys(state);
|
19
|
+
for(var i=0; i < keys.length; i++) {
|
20
|
+
global.Opal.Isomorfeus.store.native.dispatch({ type: keys[i].toUpperCase(), set_state: state[keys[i]] });
|
21
|
+
}
|
20
22
|
}
|
21
|
-
|
23
|
+
end
|
24
|
+
mount_component(component, props, root_element, hydrated)
|
25
|
+
rescue
|
26
|
+
@timeout_start = Time.now unless @timeout_start
|
27
|
+
`setTimeout(#{mount!}, 100)` if (Time.now - @timeout_start) < 10
|
22
28
|
end
|
23
|
-
mount_component(component, props, root_element, hydrated)
|
24
29
|
end
|
25
30
|
end
|
26
31
|
|
@@ -4,9 +4,22 @@ module LucidMaterial
|
|
4
4
|
def self.included(base)
|
5
5
|
base.instance_exec do
|
6
6
|
def styles(styles_hash = nil, &block)
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
if block_given?
|
8
|
+
%x{
|
9
|
+
base.jss_styles = function(theme) {
|
10
|
+
var result = block.$call(Opal.Hash.$new(theme));
|
11
|
+
return result.$to_n();
|
12
|
+
}
|
13
|
+
}
|
14
|
+
nil
|
15
|
+
elsif styles_hash
|
16
|
+
`base.jss_styles = #{styles_hash.to_n}` if styles_hash
|
17
|
+
styles_hash
|
18
|
+
elsif `typeof base.jss_styles === 'object'`
|
19
|
+
`Opal.Hash.$new(base.jss_styles)`
|
20
|
+
else
|
21
|
+
nil
|
22
|
+
end
|
10
23
|
end
|
11
24
|
end
|
12
25
|
|
data/lib/react/version.rb
CHANGED
data/lib/react_dom.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.7
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|