isomorfeus-preact 10.6.21 → 10.6.22

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: 76c5ba07f42c9e53b189fed74f0ac51e7041cd9d243b080295e86492cfc12bd8
4
- data.tar.gz: 5ae156acd8f5c22acfdca4642df719459183727df885d141a1b72b37268c4304
3
+ metadata.gz: 0c7377e941df8a5dd82b65906faa7353cd463aff37722ef42e7545b00967bed8
4
+ data.tar.gz: 3e4a52c1ea3ab9db460e06deba29a42e915e6e01a2d8c43bbdf7c9eaa8153c3f
5
5
  SHA512:
6
- metadata.gz: 7aecd0b46f5d6901d435444fe02080d2aa114778bf3de8ce1ee42052226bd06a3d91644bfe73456a8bce24f336769e1347a079b38894f63ef16f3186732a98dd
7
- data.tar.gz: a3c3ae921ad2bd80cc5fae87857b299ff206c9026300c99a177b96249b5517eb09b1401a56e287b629cfabf4a613dd37cc39b0fffc95afd64beda63f97bda6ce
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.active_redux_components.push(this);
49
+ oper.register_active_component(this);
48
50
  this.state.preloaded = this.__ruby_instance.$execute_preload_block();
49
- oper.active_redux_components.pop();
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.active_redux_components.push(this);
45
+ oper.register_active_component(this);
44
46
  this.state.preloaded = this.__ruby_instance.$execute_preload_block();
45
- oper.active_redux_components.pop();
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
- element = Opal.Preact.native_element_or_component_to_ruby(element);
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
- return #{!!`this.__ruby_instance`.instance_exec(`Opal.Preact.Props.$new({props: next_props})`, `Opal.Preact.State.$new({state: next_state })`, &`base.should_component_update_block`)};
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 (!Opal.Preact.props_are_equal(this.props, next_props)) { return true; }
51
- if (Opal.Preact.state_is_not_equal(this.state, next_state)) { return true; }
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) {
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.21'
2
+ VERSION = '10.6.22'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.21
4
+ version: 10.6.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann