isomorfeus-preact 10.6.21 → 10.6.22
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c7377e941df8a5dd82b65906faa7353cd463aff37722ef42e7545b00967bed8
|
4
|
+
data.tar.gz: 3e4a52c1ea3ab9db460e06deba29a42e915e6e01a2d8c43bbdf7c9eaa8153c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9010971c7c91b3dd4ee6f97c36d42b783b1885ca6a8ef74aae2c921c4e67f4cc9c1acc5a7b3997808f48338afe9a0fd4518c17d93bced3f12960c816bbd3fe94
|
7
|
+
data.tar.gz: 52d34fd59be865c5edac53bf371813b430f3b2ff85d94047a30b4c64cdb42bb2470435533d19bfeb405eab89597085de8cafaee6d6b8a380953df2902e7bb1ef
|
@@ -36,7 +36,9 @@ module LucidApp
|
|
36
36
|
let r = ref; // to ensure closure for function below gets correct ref name
|
37
37
|
this[ref] = function(element) {
|
38
38
|
element = oper.native_element_or_component_to_ruby(element);
|
39
|
+
oper.register_active_component(this);
|
39
40
|
#{`this.__ruby_instance`.instance_exec(`element`, &`defined_refs[r]`)}
|
41
|
+
oper.unregister_active_component(this);
|
40
42
|
}
|
41
43
|
this[ref] = this[ref].bind(this);
|
42
44
|
} else {
|
@@ -44,9 +46,9 @@ module LucidApp
|
|
44
46
|
}
|
45
47
|
}
|
46
48
|
if (base.preload_block) {
|
47
|
-
oper.
|
49
|
+
oper.register_active_component(this);
|
48
50
|
this.state.preloaded = this.__ruby_instance.$execute_preload_block();
|
49
|
-
oper.
|
51
|
+
oper.unregister_active_component(this);
|
50
52
|
}
|
51
53
|
this.listener = this.listener.bind(this);
|
52
54
|
this.unsubscriber = Opal.Isomorfeus.store.native.subscribe(this.listener);
|
@@ -32,7 +32,9 @@ module LucidComponent
|
|
32
32
|
let r = ref; // to ensure closure for function below gets correct ref name
|
33
33
|
this[ref] = function(element) {
|
34
34
|
element = oper.native_element_or_component_to_ruby(element);
|
35
|
+
oper.register_active_component(this);
|
35
36
|
#{`this.__ruby_instance`.instance_exec(`element`, &`defined_refs[r]`)}
|
37
|
+
oper.unregister_active_component(this);
|
36
38
|
}
|
37
39
|
this[ref] = this[ref].bind(this);
|
38
40
|
} else {
|
@@ -40,9 +42,9 @@ module LucidComponent
|
|
40
42
|
}
|
41
43
|
}
|
42
44
|
if (base.preload_block) {
|
43
|
-
oper.
|
45
|
+
oper.register_active_component(this);
|
44
46
|
this.state.preloaded = this.__ruby_instance.$execute_preload_block();
|
45
|
-
oper.
|
47
|
+
oper.unregister_active_component(this);
|
46
48
|
}
|
47
49
|
}
|
48
50
|
static get displayName() {
|
@@ -21,8 +21,11 @@ module Preact
|
|
21
21
|
if (defined_refs[ref] != null) {
|
22
22
|
let r = ref; // to ensure closure for function below gets correct ref name
|
23
23
|
this[ref] = function(element) {
|
24
|
-
|
24
|
+
const oper = Opal.Preact;
|
25
|
+
element = oper.native_element_or_component_to_ruby(element);
|
26
|
+
oper.register_active_component(this);
|
25
27
|
#{`this.__ruby_instance`.instance_exec(`element`, &`defined_refs[r]`)}
|
28
|
+
oper.unregister_active_component(this);
|
26
29
|
}
|
27
30
|
this[ref] = this[ref].bind(this);
|
28
31
|
} else {
|
@@ -44,11 +47,14 @@ module Preact
|
|
44
47
|
return (result.length === 1) ? result[0] : result;
|
45
48
|
}
|
46
49
|
shouldComponentUpdate(next_props, next_state) {
|
50
|
+
const oper = Opal.Preact;
|
47
51
|
if (base.should_component_update_block) {
|
48
|
-
|
52
|
+
oper.register_active_component(this);
|
53
|
+
return #{!!`this.__ruby_instance`.instance_exec(`oper.Props.$new({props: next_props})`, `oper.State.$new({state: next_state })`, &`base.should_component_update_block`)};
|
54
|
+
oper.unregister_active_component(this);
|
49
55
|
}
|
50
|
-
if (!
|
51
|
-
if (
|
56
|
+
if (!oper.props_are_equal(this.props, next_props)) { return true; }
|
57
|
+
if (oper.state_is_not_equal(this.state, next_state)) { return true; }
|
52
58
|
return false;
|
53
59
|
}
|
54
60
|
validateProp(props, propName, componentName) {
|
data/lib/preact/version.rb
CHANGED