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 +4 -4
- data/lib/preact/component_resolution.rb +10 -11
- data/lib/preact/version.rb +1 -1
- data/lib/preact.rb +6 -32
- 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: 73f8b8f7d14be7b8a80efda0f1cba6be6edb00ceb1043c5339b1360bfa791924
|
4
|
+
data.tar.gz: 76be3664fce68b8dbdc29a62068366cc417805664bab7ecd60fcbda689742e66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
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') {
|
data/lib/preact/version.rb
CHANGED
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(
|
235
|
-
if (
|
236
|
-
if (
|
237
|
-
|
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.
|
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-
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|