isomorfeus-preact 10.6.37 → 10.6.41

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: f82bf99a53bc67d3fd34a366579d35c1e560c6dd860e9981dca3c24e58a4bed6
4
- data.tar.gz: c031adbcb8102d1225012d1526e602b70275b872be1b74c96828c1e53c20c78d
3
+ metadata.gz: b5dcd6f47b6c1ee434ae284faa284963185a2e112ff2d31af183b3d14a1a7bbc
4
+ data.tar.gz: 8317315227778cd9a5ef6f5228eee20676ca87b27e850536ecac4a475b91631d
5
5
  SHA512:
6
- metadata.gz: c238454b703626f7db793109fe26c81443e55ffe6bae3e0a717132369bcdb8854c5319bc56db2780f976b4721e1e0f26bd07ddb21cddcb04fe0d8a15bc63e4cf
7
- data.tar.gz: 28b3a937f2e305534e7cfc038de0f76445128b58c464d6596b5de36e79d3f25f709956d34969f8e681d3780c0d2fe9e4a07d672005aba5cc205c9ab477493e15
6
+ metadata.gz: 6dd8b2248f31ccbc1fbdf96a4bdeb9bfac4e402f482e5bbc96380af80f462a66f666459ed48fc3060a489dfe6dfc18da56e337b1553c9cf9bf99d58da8ff2bc8
7
+ data.tar.gz: d1f318b2e409084902e83beeb5c2803c676a079ed381df72d0db97f7ab056865bfdfce4d7ebd5d734d782068701df6152f81c895ab59c12acb3f3fd7b8d3ef9b
@@ -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
@@ -92,7 +92,7 @@ module Isomorfeus
92
92
  else
93
93
  start_time = Time.now
94
94
  script_key = if has_transport && has_store
95
- :sill_busy
95
+ :still_busy
96
96
  elsif has_transport
97
97
  :transport_busy
98
98
  elsif has_store
@@ -13,7 +13,7 @@ module Isomorfeus
13
13
  global.HasTransport = (typeof global.Opal.Isomorfeus.Transport !== 'undefined') && (api_ws_path !== '');
14
14
  global.HasStore = typeof global.Opal.Isomorfeus.store !== 'undefined';
15
15
  global.Opal.Isomorfeus['$env='](env);
16
- if (typeof global.Opal.Isomorfeus["$current_locale="] === 'function') { global.Opal.Isomorfeus["$current_locale="](''); }
16
+ if (typeof global.Opal.Isomorfeus["$current_locale="] === 'function') { global.Opal.Isomorfeus["$current_locale="](locale); }
17
17
  global.Opal.Isomorfeus['$force_init!']();
18
18
  global.Opal.Isomorfeus['$ssr_response_status='](200);
19
19
  global.Opal.Isomorfeus.TopLevel['$ssr_route_path='](location);
@@ -24,7 +24,7 @@ module Isomorfeus
24
24
  global.RenderedTree = global.Opal.Isomorfeus.TopLevel.$render_component_to_string(component_name, props);
25
25
  let nfp = global.Opal.Isomorfeus.Transport["$busy?"]() || global.Opal.Isomorfeus.store['$recently_dispatched?']();
26
26
  global.NeedFurtherPass = (nfp == nil) ? false : nfp;
27
- global.FirstPassFinished = false;
27
+ global.FirstPassFinished = true;
28
28
  } catch (e) {
29
29
  global.Exception = e;
30
30
  global.NeedFurtherPass = false;
@@ -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.41'
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,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.37
4
+ version: 10.6.41
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-19 00:00:00.000000000 Z
11
+ date: 2022-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -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.17
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.17
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: isomorfeus-redux
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '3.10'
201
+ version: '3.11'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '3.10'
208
+ version: '3.11'
209
209
  description: Write Preact Components in Ruby, including styles and reactive data access.
210
210
  email:
211
211
  - jan@kursator.com
@@ -476,7 +476,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
476
476
  - !ruby/object:Gem::Version
477
477
  version: '0'
478
478
  requirements: []
479
- rubygems_version: 3.3.3
479
+ rubygems_version: 3.3.7
480
480
  signing_key:
481
481
  specification_version: 4
482
482
  summary: Preact Components for Isomorfeus.