isomorfeus-react 16.12.7 → 16.12.8

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: 0f96948bf037f1b78dab34b59fe4d6ff0f94a2cd13582f9645338c6c96e908d9
4
- data.tar.gz: 0f2e08f924bc7f29d610eb5480cb3f8d539e41c46da71e8fac512a7849b937f0
3
+ metadata.gz: c5d90a7865eb93c6d4fe0355e0dbaf8e03cae4bb2ebaabf33f78adecd9203f26
4
+ data.tar.gz: bbd20f3e1025ae402846b5688677922ba23c54802d9ed87ea36b670282bb1244
5
5
  SHA512:
6
- metadata.gz: 8f2cb2de9ef94c191b6458250f1c4f00389bf516963245afce072efb809951785a569e41fad5b1e8c30b0dd447fed4366fd72c96a8dbf0f357f4b75540a702ae
7
- data.tar.gz: 82a37cee63c365ba0102eec88fb0667c8cfbf2b40a2d8430fbf7d137e349a9cb7330f32c414e1e177f37f20330752f9e2c36a62cc49f1491b224468b90fe763a
6
+ metadata.gz: 3a50131debc40514af9eb558afe63137679d4b16a1b0b08baefa303c27a20ac3d9cc2a669eca9ca5900d1125712eb10bd5d465d6fd716a687aefdf19c8e0e0d6
7
+ data.tar.gz: 0ad176660638690cecf5eb8d36152ea567dc3b61af5e193f3fe6f0538830b02cec831d352a3aa69d3fd05984867c06fbe935ec81b252ffb70b14828113d9d7e5
@@ -154,10 +154,6 @@ else
154
154
 
155
155
  Opal.append_path(__dir__.untaint)
156
156
 
157
- if Dir.exist?('isomorfeus')
158
- Opal.append_path(File.expand_path('isomorfeus')) unless Opal.paths.include?(File.expand_path('isomorfeus'))
159
- end
160
-
161
157
  require 'concurrent'
162
158
  require 'zeitwerk'
163
159
 
@@ -75,8 +75,11 @@ module LucidApp
75
75
  if (block_result && (block_result.constructor === String || block_result.constructor === Number)) { oper.render_buffer[oper.render_buffer.length - 1].push(block_result); }
76
76
  oper.active_redux_components.pop();
77
77
  oper.active_components.pop();
78
+ let children = oper.render_buffer.pop();
79
+ if (children.length === 1) { children = children[0]; }
80
+ else if (children.length === 0) { children = null; }
78
81
  // console.log("lucid app popping", oper.render_buffer, oper.render_buffer.toString());
79
- return Opal.global.React.createElement(Opal.global.LucidApplicationContext.Provider, { value: this.state.isomorfeus_store_state }, oper.render_buffer.pop());
82
+ return Opal.global.React.createElement(Opal.global.LucidApplicationContext.Provider, { value: this.state.isomorfeus_store_state }, children);
80
83
  }
81
84
  data_access() {
82
85
  this.state.isomorfeus_store_state;
@@ -64,7 +64,9 @@ module LucidComponent
64
64
  oper.active_redux_components.pop();
65
65
  oper.active_components.pop();
66
66
  // console.log("lucid component popping", oper.render_buffer, oper.render_buffer.toString());
67
- return oper.render_buffer.pop();
67
+ let result = oper.render_buffer.pop();
68
+ if (result.length === 1) { return result[0]; }
69
+ return result;
68
70
  }
69
71
  data_access() {
70
72
  return this.props.store;
@@ -46,7 +46,9 @@ module LucidFunc
46
46
  oper.active_redux_components.pop();
47
47
  oper.active_components.pop();
48
48
  // console.log("function popping", oper.render_buffer, oper.render_buffer.toString());
49
- return oper.render_buffer.pop();
49
+ let result = oper.render_buffer.pop();
50
+ if (result.length === 1) { return result[0]; }
51
+ return result;
50
52
  }, base.equality_checker);
51
53
  base.react_component.displayName = #{component_name};
52
54
  }
@@ -23,7 +23,9 @@ module React
23
23
  if (block_result && (block_result.constructor === String || block_result.constructor === Number)) { oper.render_buffer[oper.render_buffer.length - 1].push(block_result); }
24
24
  oper.active_components.pop();
25
25
  // console.log("memo popping", oper.render_buffer, oper.render_buffer.toString());
26
- return oper.render_buffer.pop();
26
+ let result = oper.render_buffer.pop();
27
+ if (result.length === 1) { return result[0]; }
28
+ return result;
27
29
  }, base.equality_checker);
28
30
  base.react_component.displayName = #{component_name};
29
31
  }
@@ -47,7 +47,9 @@ module LucidMaterial
47
47
  oper.active_redux_components.pop();
48
48
  oper.active_components.pop();
49
49
  // console.log("function popping", oper.render_buffer, oper.render_buffer.toString());
50
- return oper.render_buffer.pop();
50
+ let result = oper.render_buffer.pop();
51
+ if (result.length === 1) { return result[0]; }
52
+ return result;
51
53
  }, base.equality_checker);
52
54
  base.react_component.displayName = #{component_name};
53
55
  }
@@ -4,12 +4,13 @@ module React
4
4
  self.render_buffer = [];
5
5
 
6
6
  self.set_validate_prop = function(component, prop_name) {
7
- if (typeof component.react_component.propTypes == "undefined") {
8
- component.react_component.propTypes = {};
9
- component.react_component.propValidations = {};
10
- component.react_component.propValidations[prop_name] = {};
7
+ let core = component.react_component;
8
+ if (typeof core.propTypes == "undefined") {
9
+ core.propTypes = {};
10
+ core.propValidations = {};
11
+ core.propValidations[prop_name] = {};
11
12
  }
12
- component.react_component.propTypes[prop_name] = component.react_component.prototype.validateProp;
13
+ core.propTypes[prop_name] = core.prototype.validateProp;
13
14
  };
14
15
 
15
16
  self.lower_camelize = function(snake_cased_word) {
@@ -62,7 +63,7 @@ module React
62
63
  };
63
64
 
64
65
  self.internal_prepare_args_and_render = function(component, args, block) {
65
- let operain = Opal.React.internal_render;
66
+ const operain = Opal.React.internal_render;
66
67
  if (args.length > 0) {
67
68
  let last_arg = args[args.length - 1];
68
69
  if (last_arg && last_arg.constructor === String) {
@@ -73,7 +74,7 @@ module React
73
74
  };
74
75
 
75
76
  self.internal_render = function(component, props, string_child, block) {
76
- let operabu = Opal.React.render_buffer;
77
+ const operabu = Opal.React.render_buffer;
77
78
  let children;
78
79
  let native_props = null;
79
80
  if (string_child) {
@@ -132,19 +133,20 @@ module React
132
133
 
133
134
  def self.create_element(type, props = nil, children = nil, &block)
134
135
  %x{
136
+ const operabu = Opal.React.render_buffer;
135
137
  let component = null;
136
138
  let native_props = null;
137
139
  if (typeof type.react_component !== 'undefined') { component = type.react_component; }
138
140
  else { component = type; }
139
141
  if (block !== nil) {
140
- Opal.React.render_buffer.push([]);
142
+ operabu.push([]);
141
143
  // console.log("create_element pushed", Opal.React.render_buffer, Opal.React.render_buffer.toString());
142
144
  let block_result = block.$call();
143
145
  if (block_result && (block_result.constructor === String || block_result.constructor === Number)) {
144
- Opal.React.render_buffer[Opal.React.render_buffer.length - 1].push(block_result);
146
+ operabu[operabu.length - 1].push(block_result);
145
147
  }
146
148
  // console.log("create_element popping", Opal.React.render_buffer, Opal.React.render_buffer.toString());
147
- children = Opal.React.render_buffer.pop();
149
+ children = operabu.pop();
148
150
  if (children.length == 1) { children = children[0]; }
149
151
  else if (children.length == 0) { children = null; }
150
152
  } else if (children === nil) { children = null; }
@@ -98,6 +98,15 @@ module React
98
98
  end
99
99
  alias gre get_react_element
100
100
 
101
+ def method_ref(method_symbol)
102
+ %x{
103
+ if (#@native.method_refs && #@native.method_refs[#{method_symbol}]) { return #@native.method_refs[#{method_symbol}]; }
104
+ if (!#@native.method_refs) { #@native.method_refs = {}; }
105
+ #@native.method_refs[#{method_symbol}] = #{method(method_symbol)};
106
+ return #@native.method_refs[#{method_symbol}];
107
+ }
108
+ end
109
+
101
110
  def render_react_element(el)
102
111
  # push el to buffer
103
112
  `Opal.React.render_buffer[Opal.React.render_buffer.length - 1].push(el)`
@@ -26,7 +26,9 @@ module React
26
26
  }
27
27
  }
28
28
  // console.log("portal popping", operabu, operabu.toString());
29
- var react_element = Opal.global.React.createPortal(operabu.pop(), element);
29
+ let result = operabu.pop();
30
+ if (result.length === 1) { result = result[0]; }
31
+ var react_element = Opal.global.React.createPortal(result, element);
30
32
  operabu[operabu.length - 1].push(react_element);
31
33
  // console.log("portal pushed", operabu, operabu.toString());
32
34
  }
@@ -50,7 +50,9 @@ module React
50
50
  if (block_result && (block_result.constructor === String || block_result.constructor === Number)) { oper.render_buffer[oper.render_buffer.length - 1].push(block_result); }
51
51
  // console.log("react component popping", oper.render_buffer, oper.render_buffer.toString());
52
52
  oper.active_components.pop();
53
- return oper.render_buffer.pop();
53
+ let result = oper.render_buffer.pop();
54
+ if (result.length === 1) { return result[0]; }
55
+ return result;
54
56
  }
55
57
  shouldComponentUpdate(next_props, next_state) {
56
58
  if (base.should_component_update_block) {
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '16.12.7'
2
+ VERSION = '16.12.8'
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.7
4
+ version: 16.12.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.0
145
+ version: 0.3.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.3.0
152
+ version: 0.3.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rake
155
155
  requirement: !ruby/object:Gem::Requirement