isomorfeus-preact 10.6.26 → 10.6.27

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: 0d26f73d028c328b0dc47a55e0bb2c7c413df5b8ab7b186952e50949d96dde08
4
- data.tar.gz: 5952469a0ea71a67f3176f6551e91ed1968dbf0c58131026c6a81d938acc9e75
3
+ metadata.gz: 73f8b8f7d14be7b8a80efda0f1cba6be6edb00ceb1043c5339b1360bfa791924
4
+ data.tar.gz: 76be3664fce68b8dbdc29a62068366cc417805664bab7ecd60fcbda689742e66
5
5
  SHA512:
6
- metadata.gz: 3c44c6fc3355ff2f600e9db9debc14804ff7578339af433a5fb271962412a4f530fd401fb592a3267a3845908f328fb94fa9721ca6859a3c701335298a5d3b8f
7
- data.tar.gz: 65728c2ecc71694b1794d6c4f5d94c5cc9e962db84e4c38569bb36beb6985e408aeaad8e1c77cade61f842c5a8c3d1af0138a80569859b8d3f37a995ddfe74fd
6
+ metadata.gz: 0ee3ac614f2156b22425ec55e89b97d44c4c216d30358718de94b75aa6c44abc5161fd064fdd69c58f3166d4dcea36eacdfb6bf5a58a72352a731f97925e76cf
7
+ data.tar.gz: e2e92fe0838eb9dd82bb24bacd88f7ec420a69f7df6f3f559d7fda08fba3f4823507c3df7539028146afbaa0347a157fc409ee0e77f45021ccfd7dc04ab28e28
@@ -29,19 +29,19 @@ module Preact
29
29
  # check for ruby component and render it
30
30
  # otherwise pass on method missing
31
31
  %x{
32
- var constant;
32
+ var constant = null;
33
33
  if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
34
- try {
35
- if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
36
- constant = self.iso_preact_const_cache[component_name]
37
- } else {
34
+ if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
35
+ constant = self.iso_preact_const_cache[component_name]
36
+ } else {
37
+ try {
38
38
  constant = self.$const_get(component_name);
39
39
  self.iso_preact_const_cache[component_name] = constant;
40
- }
41
- if (typeof constant.preact_component !== 'undefined') {
42
- return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
43
- }
44
- } catch(err) { }
40
+ } catch(err) { }
41
+ }
42
+ if (constant && typeof constant.preact_component !== 'undefined') {
43
+ return Opal.Preact.internal_prepare_args_and_render(constant.preact_component, args, block);
44
+ }
45
45
  return #{_preact_component_class_resolution_original_method_missing(component_name, *args, block)};
46
46
  }
47
47
  end
@@ -59,7 +59,6 @@ module Preact
59
59
  %x{
60
60
  var constant;
61
61
  if (typeof self.iso_preact_const_cache === 'undefined') { self.iso_preact_const_cache = {}; }
62
-
63
62
  if (typeof self.iso_preact_const_cache[component_name] !== 'undefined') {
64
63
  constant = self.iso_preact_const_cache[component_name]
65
64
  } else if (typeof self.$$is_a_module !== 'undefined') {
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.26'
2
+ VERSION = '10.6.27'
3
3
  end
data/lib/preact.rb CHANGED
@@ -110,25 +110,6 @@ module Preact
110
110
  self.active_components.pop();
111
111
  };
112
112
 
113
- function isObject(obj) { return (obj && typeof obj === 'object'); }
114
-
115
- self.merge_deep = function(one, two) {
116
- return [one, two].reduce(function(pre, obj) {
117
- Object.keys(obj).forEach(function(key){
118
- let pVal = pre[key];
119
- let oVal = obj[key];
120
- if (Array.isArray(pVal) && Array.isArray(oVal)) {
121
- pre[key] = pVal.concat.apply(this, oVal);
122
- } else if (isObject(pVal) && isObject(oVal)) {
123
- pre[key] = self.merge_deep(pVal, oVal);
124
- } else {
125
- pre[key] = oVal;
126
- }
127
- });
128
- return pre;
129
- }, {});
130
- };
131
-
132
113
  self.prop_dictionary = {};
133
114
 
134
115
  self.to_native_preact_props = function(ruby_style_props) {
@@ -231,23 +212,16 @@ module Preact
231
212
  }
232
213
  };
233
214
 
234
- self.deep_force_update = function(component) {
235
- if (component.forceUpdate) { component.forceUpdate(); }
236
- if (component.__c) { self.deep_force_update(component.__c); }
237
- else if (component.base) { self.update_components_from_dom(component.base); }
238
- };
239
-
240
- self.update_components_from_dom = function(node, fn) {
241
- let children = node.childNodes;
242
- for (let i=children && children.length; i--;) {
243
- let child = children[i];
244
- if (child.__c) { self.deep_force_update(child.__c); }
245
- else { self.update_components_from_dom(child, fn); }
215
+ self.deep_force_update = function(vnode) {
216
+ if (vnode.__c && vnode.__c.forceUpdate) { vnode.__c.forceUpdate(); }
217
+ if (vnode.__k) {
218
+ for (let i=vnode.__k.length-1; i>=0; i--) {
219
+ self.deep_force_update(vnode.__k[i]);
220
+ }
246
221
  }
247
222
  };
248
223
  }
249
224
 
250
-
251
225
  def self.create_element(type, props = nil, children = nil, &block)
252
226
  %x{
253
227
  const operabu = self.render_buffer;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.26
4
+ version: 10.6.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-03 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby