isomorfeus-preact 10.6.24 → 10.6.25

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: 6bf4eaa022b76cf456aff65c04257f0f7d8877ac285c9b0dfcece7a4c95d6f93
4
- data.tar.gz: c8d50c5a3a92e2ebad7a215746f0fd0aa21f910585187a645fffb6f5bfc4e9fd
3
+ metadata.gz: 5297a6babb3f48a4cebfe2a957fdfcb8b3e3e7de5a928956e0b93f7d3d2741c8
4
+ data.tar.gz: a2af099fbf9f129b1fb6054249c99b6387b79ad4ea10493f9b481672afdc8ed2
5
5
  SHA512:
6
- metadata.gz: 85cc46da828b1aee16afd1c5f68e251514eabdfc168f6537ce65c084edecf2d43dd96ede48e30fa88ee694cb066e9e5795c84966ac2cea940e493a652133f286
7
- data.tar.gz: 05a90b9e5fe7165008558dcb226040af5c839bf6a703c80bd73c4ad09212222c411906eb94e1539b1cc4f0c2f153101f5a4b3b96797cf6c35129d0d240edfe5c
6
+ metadata.gz: d4098d558db9b42dc5c35ae1602c83829a80ae64e986fb9f843af1321cec415b314acee4ac292b3c891628b4fc7b1b8628605561a7858af5d5e18d8a6c0d2ad3
7
+ data.tar.gz: c726635dc08b8e506551e3e28ada187bd1327bbe30bad51f4095b56e242b412db83d0028c4d33a9608f958986b04d4b8ad090ebff40862d1776db01beb261cc7
@@ -4,19 +4,19 @@ 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')
7
+ def cached_mount_component(component_name, props = {}, asset_key = 'ssr.js', skip_ssr: false, use_ssr: false, max_passes: 4)
8
8
  key = "#{component_name}#{props}#{asset}"
9
9
  if Isomorfeus.production?
10
10
  render_result, @ssr_response_status, @ssr_styles = component_cache.fetch(key)
11
11
  return render_result if render_result
12
12
  end
13
- render_result = mount_component(component_name, props, asset_key)
13
+ render_result = mount_component(component_name, props, asset_key, skip_ssr: skip_ssr, use_ssr: use_ssr, max_passes: max_passes)
14
14
  status = ssr_response_status
15
15
  component_cache.store(key, render_result, status, ssr_styles) if status >= 200 && status < 300
16
16
  render_result
17
17
  end
18
18
 
19
- def mount_component(component_name, props = {}, asset_key = 'ssr.js', skip_ssr: false, use_ssr: false)
19
+ def mount_component(component_name, props = {}, asset_key = 'ssr.js', skip_ssr: false, use_ssr: false, max_passes: 4)
20
20
  @ssr_response_status = nil
21
21
  @ssr_styles = nil
22
22
  thread_id_asset = "#{Thread.current.object_id}#{asset_key}"
@@ -137,7 +137,6 @@ module Isomorfeus
137
137
  JAVASCRIPT
138
138
  # execute further render passes
139
139
  rendered_tree, application_state, @ssr_styles, @ssr_response_status, transport_busy, exception = Isomorfeus.ssr_contexts[thread_id_asset].exec(javascript)
140
- break_while = false
141
140
  start_time = Time.now
142
141
  while transport_busy
143
142
  break if (Time.now - start_time) > 5
@@ -149,7 +148,7 @@ module Isomorfeus
149
148
  # execute third render pass
150
149
  pass += 1
151
150
  rendered_tree, application_state, @ssr_styles, @ssr_response_status, transport_busy, exception = Isomorfeus.ssr_contexts[thread_id_asset].exec(javascript)
152
- break if break_while || pass > 5
151
+ break if pass > max_passes
153
152
  end
154
153
  javascript = <<~JAVASCRIPT
155
154
  if (typeof global.Opal.Isomorfeus.Transport !== 'undefined') { global.Opal.Isomorfeus.Transport.$disconnect(); }
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.24'
2
+ VERSION = '10.6.25'
3
3
  end
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.24
4
+ version: 10.6.25
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-01 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby