isomorfeus-react 16.12.1 → 16.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22fa45d257e25f237d954259c9d66fca99d450042826751040cece604e9e7aa1
4
- data.tar.gz: 2ef09e16a227fbb1af0a40b5cbc3dd584a32c4bfe1f1057fb803451880237dfa
3
+ metadata.gz: e2f2cf299b88aea2632443beec126b7d0407eb85dced22573d0ad712c92019a9
4
+ data.tar.gz: d4af259b498ae72fc0a09dc099a307587ae383630a77f578de1b364feeb752ff
5
5
  SHA512:
6
- metadata.gz: 6adbdf97368ff21022a140723919722c0dd6263990c3ceae8072ca14f4411eac6014d1e6df3aedaa07aa8183e81c6b70b71e03465b1e9b2263f06907530501b3
7
- data.tar.gz: ef33dc1ad3b0f3f10bfcde9ca9996462fcfd168acd29ea78da99de3e4b13db7d9888ca309c820bade3be9da2bff6c7aa33080fec30c7c685de9f28d5c2d2aa0f
6
+ metadata.gz: 3eea5b7f5db17a5d788b1fcc110329b00c7ef4e0ba82513e717a799ad8a456ec02ed7659e540b3ca5f544d10df04c9c1f4bc6cea38b0c650ff691879360accdf
7
+ data.tar.gz: 862dfd20043bcfaae2a6aa1b416e3fadd7bc3d8d0f64faf406a92089691d132fc2125ec73c69512be7814a6e65c9f6490dc95e8ec3222da477c00b186afc3ad9
@@ -5,6 +5,7 @@ module Isomorfeus
5
5
  Isomorfeus.init
6
6
  Isomorfeus::TopLevel.on_ready do
7
7
  root_element = `document.querySelector('div[data-iso-root]')`
8
+ raise "Isomorfeus root element not found!" unless root_element
8
9
  component_name = root_element.JS.getAttribute('data-iso-root')
9
10
  Isomorfeus.env = root_element.JS.getAttribute('data-iso-env')
10
11
  component = nil
@@ -37,11 +38,13 @@ module Isomorfeus
37
38
  }
38
39
  end
39
40
  begin
40
- Isomorfeus::TopLevel.mount_component(component, props, root_element, hydrated)
41
+ result = Isomorfeus::TopLevel.mount_component(component, props, root_element, hydrated)
42
+ @tried_another_time = false
43
+ result
41
44
  rescue Exception => e
42
- @timeout_start = Time.now unless @timeout_start
43
- if (Time.now - @timeout_start) < 10
44
- `setTimeout(Opal.Isomorfeus.TopLevel['$mount!'], 100)`
45
+ if !@tried_another_time
46
+ @tried_another_time = true
47
+ `setTimeout(Opal.Isomorfeus.TopLevel['$mount!'], 250)`
45
48
  else
46
49
  `console.error("Unable to mount '" + #{component_name} + "'! Error: " + #{e.message} + "!")`
47
50
  `console.error(#{e.backtrace.join("\n")})`
@@ -63,7 +63,7 @@ module LucidApp
63
63
  oper.render_buffer.push([]);
64
64
  // console.log("lucid app pushed", oper.render_buffer, oper.render_buffer.toString());
65
65
  oper.active_components.push(this);
66
- oper.active_redux_components.push(this.__ruby_instance);
66
+ oper.active_redux_components.push(this);
67
67
  let block_result;
68
68
  if (base.preload_block && base.while_loading_block && !this.state.preloaded) { block_result = #{`this.__ruby_instance`.instance_exec(&`base.while_loading_block`)}; }
69
69
  else { block_result = #{`this.__ruby_instance`.instance_exec(&`base.render_block`)}; }
@@ -5,7 +5,12 @@ module LucidFunc
5
5
  %x{
6
6
  base.store_updates = true;
7
7
  base.equality_checker = null;
8
- base.instance_init = function(initial) { return { instance: #{base.new(`{}`)} }; }
8
+ base.instance_init = function(initial) {
9
+ let ruby_instance = { instance: #{base.new(`{}`)} };
10
+ ruby_instance.data_access = function() { return this.props.store; }
11
+ ruby_instance.data_access.bind(ruby_instance);
12
+ return ruby_instance;
13
+ }
9
14
  base.instance_reducer = function(state, action) { return state; }
10
15
  base.react_component = Opal.global.React.memo(function(props) {
11
16
  const og = Opal.global;
@@ -6,7 +6,12 @@ module LucidMaterial
6
6
  %x{
7
7
  base.store_updates = true;
8
8
  base.equality_checker = null;
9
- base.instance_init = function(initial) { return { instance: #{base.new(`{}`)} }; }
9
+ base.instance_init = function(initial) {
10
+ let ruby_instance = { instance: #{base.new(`{}`)} };
11
+ ruby_instance.data_access = function() { return this.props.store; }
12
+ ruby_instance.data_access.bind(ruby_instance);
13
+ return ruby_instance;
14
+ }
10
15
  base.instance_reducer = function(state, action) { return state; }
11
16
  base.react_component = Opal.global.React.memo(function(props) {
12
17
  const og = Opal.global;
@@ -7,7 +7,7 @@ module React
7
7
  # TODO convert error and info
8
8
  %x{
9
9
  var fun = function(error, info) {
10
- Opal.React.active_redux_components.push(this.__ruby_instance);
10
+ Opal.React.active_redux_components.push(this);
11
11
  #{`this.__ruby_instance`.instance_exec(`error`, `info`, &block)};
12
12
  Opal.React.active_redux_components.pop();
13
13
  }
@@ -19,7 +19,7 @@ module React
19
19
  def component_did_mount(&block)
20
20
  %x{
21
21
  let fun = function() {
22
- Opal.React.active_redux_components.push(this.__ruby_instance);
22
+ Opal.React.active_redux_components.push(this);
23
23
  #{`this.__ruby_instance`.instance_exec(&block)};
24
24
  Opal.React.active_redux_components.pop();
25
25
  }
@@ -40,7 +40,7 @@ module React
40
40
  def component_did_update(&block)
41
41
  %x{
42
42
  var fun = function(prev_props, prev_state, snapshot) {
43
- Opal.React.active_redux_components.push(this.__ruby_instance);
43
+ Opal.React.active_redux_components.push(this);
44
44
  #{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: prev_props})`,
45
45
  `Opal.React.Component.State.$new({state: prev_state})`,
46
46
  `snapshot`, &block)};
@@ -55,7 +55,7 @@ module React
55
55
  %x{
56
56
  var fun = function() {
57
57
  if (typeof this.unsubscriber === "function") { this.unsubscriber(); };
58
- Opal.React.active_redux_components.push(this.__ruby_instance);
58
+ Opal.React.active_redux_components.push(this);
59
59
  #{`this.__ruby_instance`.instance_exec(&block)};
60
60
  Opal.React.active_redux_components.pop();
61
61
  }
@@ -81,7 +81,7 @@ module React
81
81
  def get_derived_state_from_props(&block)
82
82
  %x{
83
83
  var fun = function(props, state) {
84
- Opal.React.active_redux_components.push(this.__ruby_instance);
84
+ Opal.React.active_redux_components.push(this);
85
85
  var result = #{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: props})`,
86
86
  `Opal.React.Component.State.$new({state: state})`, &block)};
87
87
  Opal.React.active_redux_components.pop();
@@ -97,7 +97,7 @@ module React
97
97
  def get_snapshot_before_update(&block)
98
98
  %x{
99
99
  var fun = function(prev_props, prev_state) {
100
-
100
+ Opal.React.active_redux_components.push(this);
101
101
  var result = #{`this.__ruby_instance`.instance_exec(`Opal.React.Component.Props.$new({props: prev_props})`,
102
102
  `Opal.React.Component.State.$new({state: prev_state})`, &block)};
103
103
  Opal.React.active_redux_components.pop();
data/lib/react/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '16.12.1'
2
+ VERSION = '16.12.2'
3
3
  end
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.12.1
4
+ version: 16.12.2
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-12-13 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.8'
33
+ version: '3.10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.8'
40
+ version: '3.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: opal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -279,16 +279,9 @@ files:
279
279
  homepage: http://isomorfeus.com
280
280
  licenses:
281
281
  - MIT
282
- metadata: {}
283
- post_install_message: |2+
284
-
285
- isomorfeus-react 16.12.1:
286
- Major improvement:
287
- Using Zeitwerk and Opal-Zeitwerk for autoloading, may break existing installations which use opal-autoloader.
288
- - existing installations may lock isomorfeus-react to 16.11.1 or upgrade to isomorfeus 1.0.0.zeta6
289
- - new installations with isomorfeus 1.0.0.zeta5 should lock to 16.11.1
290
- - new installations with isomorfeus 1.0.0.zeta6 and up -> enjoy the latest isomorfeus-react
291
-
282
+ metadata:
283
+ github_repo: ssh://github.com/isomorfeus/gems
284
+ post_install_message:
292
285
  rdoc_options: []
293
286
  require_paths:
294
287
  - lib