isomorfeus-preact 10.6.40 → 10.6.44

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: 48b042cd2e0345a4ebdec7b8991b500d027098042f77bfb66ed73d5d92f4f82b
4
- data.tar.gz: aab88a16f927559d005bdf8ac4c1bb79416a0aa82f1f404c3b7b49777d52307d
3
+ metadata.gz: f82e19631cd8c955b035dec4b355db1f787bb2e16f11e34fd23b4aedc0e68229
4
+ data.tar.gz: 58db551e7d0d0c8254e506762833ac6fdf303335a7db5aeef55a091e92876c4e
5
5
  SHA512:
6
- metadata.gz: 2d5aca2872e195df87e5449ab0e25efa3f40034395a31906b6d2a746f60109937663126149669b648e07d62d7ec11a4546fe5def9df0758699b01a7133d04e26
7
- data.tar.gz: 329f125f6eea1bbb551070919a0b19af80f5e87c16b40c5397f84f47ee876bc9d4e36ee1a17256cd8a7a4c7dbfb634ad47758fe036c4bfe00432571e6c6e8c1d
6
+ metadata.gz: 7adb8071b41c381fcbc3ee4aa9f89e90ed1749c8fc518f7b35868c3de6291009465a7c09f745cb18affe7303a23fb3873b4c7e9551fcb3b1a8401c812ab6f7e9
7
+ data.tar.gz: ff1f52873da1efdbbbd9d6387d05f3683d3d99aea8ad00246e6bc803ea96862023c9ef2ebd879c165d5d326ad3efe707362b62dcc0b651a5581897df6ef4b643
@@ -27,7 +27,12 @@ module Isomorfeus
27
27
  begin
28
28
  init_speednode_context(asset_key, thread_id_asset)
29
29
  rescue Exception => e
30
- Isomorfeus.raise_error(message: "Server Side Rendering: Failed creating context for #{asset_key}. Error: #{e.message}", stack: e.backtrace)
30
+ if e.message.include?('@hash[:js][:js][:raw]') # asset bundling did not yet finish
31
+ sleep 2
32
+ return mount_component(component_name, props, asset_key, skip_ssr: skip_ssr, use_ssr: use_ssr, max_passes: max_passes)
33
+ else
34
+ Isomorfeus.raise_error(message: "Server Side Rendering: Failed creating context for #{asset_key}. Error: #{e.message}", stack: e.backtrace)
35
+ end
31
36
  end
32
37
  else
33
38
  unless Isomorfeus.ssr_contexts.key?(thread_id_asset)
@@ -37,8 +42,7 @@ module Isomorfeus
37
42
 
38
43
  ctx = Isomorfeus.ssr_contexts[thread_id_asset]
39
44
  pass = 0
40
- # if location_host and scheme are given and if Transport is loaded, connect and then render,
41
- # otherwise do not render because only one pass is required
45
+ # if location_host and scheme are given and if Transport is loaded, connect and then render
42
46
  ws_scheme = props[:location_scheme] == 'https:' ? 'wss:' : 'ws:'
43
47
  location_host = props[:location_host] ? props[:location_host] : 'localhost'
44
48
  api_ws_path = Isomorfeus.respond_to?(:api_websocket_path) ? Isomorfeus.api_websocket_path : ''
@@ -92,7 +96,7 @@ module Isomorfeus
92
96
  else
93
97
  start_time = Time.now
94
98
  script_key = if has_transport && has_store
95
- :sill_busy
99
+ :still_busy
96
100
  elsif has_transport
97
101
  :transport_busy
98
102
  elsif has_store
@@ -110,11 +114,11 @@ module Isomorfeus
110
114
  Isomorfeus.raise_error(message: "Server Side Rendering: #{exception['message']}", stack: exception['stack']) if exception
111
115
  if need_further_pass && script_key
112
116
  break if (Time.now - start_time) > 5
113
- need_further_pass = ctx.eval_script(key: script_key)
114
- while need_further_pass
115
- break if (Time.now - start_time) > 4
116
- sleep 0.01
117
- need_further_pass = ctx.eval_script(key: script_key)
117
+ still_busy = ctx.eval_script(key: script_key)
118
+ while still_busy
119
+ break if (Time.now - start_time) > 5
120
+ sleep 0.005
121
+ still_busy = ctx.eval_script(key: script_key)
118
122
  end
119
123
  break if pass >= max_passes
120
124
  else
@@ -179,8 +183,8 @@ module Isomorfeus
179
183
  ctx.exec(ssr_mod)
180
184
  ctx.add_script(key: :first_pass_check, source: '[global.FirstPassFinished, global.NeedFurtherPass, global.Exception ? { message: global.Exception.message, stack: global.Exception.stack } : false ]')
181
185
  ctx.add_script(key: :first_pass_result, source: 'Opal.Isomorfeus.SSR.first_pass_result()')
182
- ctx.add_script(key: :still_busy, source: 'let nfp = global.Opal.Isomorfeus.Transport["$busy?"]() || global.Opal.Isomorfeus.store["$recently_dispatched?"](); (nfp == nil) ? false : nfp;')
183
- ctx.add_script(key: :store_busy, source: 'let nfp = global.Opal.Isomorfeus.store["$recently_dispatched?"](); (nfp == nil) ? false : nfp;')
186
+ ctx.add_script(key: :still_busy, source: 'Opal.Isomorfeus.SSR.still_busy()')
187
+ ctx.add_script(key: :store_busy, source: 'Opal.Isomorfeus.SSR.store_busy()')
184
188
  ctx.add_script(key: :transport_busy, source: 'global.Opal.Isomorfeus.Transport["$busy?"]()')
185
189
  ctx.add_script(key: :transport_disconnect, source: 'global.Opal.Isomorfeus.Transport.$disconnect()')
186
190
  end
@@ -70,6 +70,16 @@ module Isomorfeus
70
70
  global.NeedFurtherPass = (nfp == nil) ? false : nfp;
71
71
  return [rendered_tree, application_state, ssr_styles, global.Opal.Isomorfeus['$ssr_response_status'](), global.NeedFurtherPass, global.Exception ? { message: global.Exception.message, stack: global.Exception.stack } : false];
72
72
  }
73
+
74
+ self.still_busy = function(){
75
+ if (global.Opal.Isomorfeus.Transport["$busy?"]()) { return true; }
76
+ return self.store_busy();
77
+ }
78
+
79
+ self.store_busy = function() {
80
+ let nfp = global.Opal.Isomorfeus.store["$recently_dispatched?"]();
81
+ return (nfp == global.Opal.nil) ? false : nfp;
82
+ }
73
83
  }
74
84
  end
75
85
  end
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.40'
2
+ VERSION = '10.6.44'
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.40
4
+ version: 10.6.44
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-20 00:00:00.000000000 Z
11
+ date: 2022-02-21 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.16
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.16
96
+ version: 0.14.17
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: isomorfeus-redux
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -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.