isomorfeus-preact 10.6.37 → 10.6.38

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: f82bf99a53bc67d3fd34a366579d35c1e560c6dd860e9981dca3c24e58a4bed6
4
- data.tar.gz: c031adbcb8102d1225012d1526e602b70275b872be1b74c96828c1e53c20c78d
3
+ metadata.gz: b30e858561f1445d46b9c27372532ea200adbd31099ffd29998c993c8e825f9e
4
+ data.tar.gz: 2de138ef131476a58950c5d475acc654b565a9bc8f7663960ca0b1add0a04c08
5
5
  SHA512:
6
- metadata.gz: c238454b703626f7db793109fe26c81443e55ffe6bae3e0a717132369bcdb8854c5319bc56db2780f976b4721e1e0f26bd07ddb21cddcb04fe0d8a15bc63e4cf
7
- data.tar.gz: 28b3a937f2e305534e7cfc038de0f76445128b58c464d6596b5de36e79d3f25f709956d34969f8e681d3780c0d2fe9e4a07d672005aba5cc205c9ab477493e15
6
+ metadata.gz: 38dca7808937f6a0357da67d6187c3854126f396973e4ad05d6760cc7c6d0e7ddaa2c4b086339ae4346a955d2b1f960964ac80ef4a8164a058c0433079c7e833
7
+ data.tar.gz: af9224dd12c9321c84840098f9d557ce7e793963f9aef615612636c9b2fb83c597b4cb063e1652dc3985874fbff3cf7633fa4bb3ca9b61308a0c7302ea97307b
@@ -4,9 +4,9 @@ module Isomorfeus
4
4
  base.include Isomorfeus::AssetManager::ViewHelper
5
5
  end
6
6
 
7
- def cached_mount_component(component_name, props = {}, asset_key = 'ssr.js', skip_ssr: false, use_ssr: false, max_passes: 4, force: false)
7
+ def cached_mount_component(component_name, props = {}, asset_key = 'ssr.js', skip_ssr: false, use_ssr: false, max_passes: 4, refresh: false)
8
8
  key = "#{component_name}#{props}#{asset}"
9
- if Isomorfeus.production? && !force
9
+ if !Isomorfeus.development? && !refresh
10
10
  render_result, @ssr_response_status, @ssr_styles = component_cache.fetch(key)
11
11
  return render_result if render_result
12
12
  end
@@ -1,10 +1,7 @@
1
1
  module LucidComponent
2
2
  class AppStoreProxy
3
- def initialize(component_instance)
4
- if component_instance
5
- @native = component_instance.to_n
6
- @component_instance = component_instance
7
- end
3
+ def initialize(native)
4
+ @native = native
8
5
  end
9
6
 
10
7
  def [](key)
@@ -22,10 +19,8 @@ module LucidComponent
22
19
  Isomorfeus.store.collect_and_defer_dispatch(action)
23
20
  else
24
21
  # check if we have a component local state value
25
- if @native && `#@native.props.iso_store`
26
- if `#@native.props.iso_store.application_state && #@native.props.iso_store.application_state.hasOwnProperty(key)`
27
- return @native.JS[:props].JS[:iso_store].JS[:application_state].JS[key]
28
- end
22
+ if `#@native?.props?.iso_store?.application_state?.hasOwnProperty?.(key)`
23
+ return `#@native.props.iso_store.application_state[key]`
29
24
  else
30
25
  return AppStore[key]
31
26
  end
@@ -1,11 +1,8 @@
1
1
  module LucidComponent
2
2
  class ClassStoreProxy
3
- def initialize(component_name, component_instance = nil, native = nil)
3
+ def initialize(component_name, native = nil)
4
4
  @component_name = component_name
5
- if component_instance
6
- @native = native
7
- @component_instance = component_instance
8
- end
5
+ @native = native
9
6
  end
10
7
 
11
8
  def [](key)
@@ -24,12 +21,8 @@ module LucidComponent
24
21
  else
25
22
  # get class state
26
23
  # check if we have a component local state value
27
- if @native && @native.JS[:props].JS[:iso_store]
28
- if @native.JS[:props].JS[:iso_store].JS[:class_state] &&
29
- @native.JS[:props].JS[:iso_store].JS[:class_state].JS[@component_name] &&
30
- @native.JS[:props].JS[:iso_store].JS[:class_state].JS[@component_name].JS.hasOwnProperty(key)
31
- return @native.JS[:props].JS[:iso_store].JS[:class_state].JS[@component_name].JS[key]
32
- end
24
+ if `#@native?.props?.iso_store?.class_state?.[#@component_name]?.hasOwnProperty?.(key)`
25
+ return `#@native.props.iso_store.class_state[#@component_name][key]`
33
26
  else
34
27
  a_state = Isomorfeus.store.get_state
35
28
  if a_state.key?(:class_state) && a_state[:class_state].key?(@component_name) && a_state[:class_state][@component_name].key?(key)
@@ -1,8 +1,8 @@
1
1
  module LucidComponent::Initializer
2
2
  def initialize(native_component)
3
3
  @native = native_component
4
- @app_store = LucidComponent::AppStoreProxy.new(self)
5
- @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, self, @native)
4
+ @app_store = LucidComponent::AppStoreProxy.new(@native)
5
+ @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, @native)
6
6
  @props = `Opal.Preact.Props.$new(#@native)`
7
7
  @state = `Opal.Preact.State.$new(#@native)`
8
8
  end
@@ -3,6 +3,6 @@ module LucidFunc::Initializer
3
3
  self.JS[:native_props] = `{ props: null }`
4
4
  @native_props = `Opal.Preact.Props.$new(#{self})`
5
5
  @app_store = LucidComponent::AppStoreProxy.new(self)
6
- @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, self, self)
6
+ @class_store = LucidComponent::ClassStoreProxy.new(self.class.to_s, self)
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.37'
2
+ VERSION = '10.6.38'
3
3
  end
data/lib/preact.rb CHANGED
@@ -216,12 +216,10 @@ module Preact
216
216
  };
217
217
 
218
218
  self.deep_force_update = function(vnode) {
219
- if(vnode) {
220
- if (vnode.__c && vnode.__c.forceUpdate) { vnode.__c.forceUpdate(); }
221
- if (vnode.__k) {
222
- for (let i=0; i<vnode.__k.length; i++) {
223
- self.deep_force_update(vnode.__k[i]);
224
- }
219
+ vnode?.__c?.forceUpdate?.();
220
+ if (vnode?.__k) {
221
+ for (let i=0; i<vnode.__k.length; i++) {
222
+ self.deep_force_update(vnode.__k[i]);
225
223
  }
226
224
  }
227
225
  };
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.37
4
+ version: 10.6.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.14.14
89
+ version: 0.14.15
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.14.14
96
+ version: 0.14.15
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: isomorfeus-redux
99
99
  requirement: !ruby/object:Gem::Requirement