isomorfeus-preact 10.6.44 → 10.6.45

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: f82e19631cd8c955b035dec4b355db1f787bb2e16f11e34fd23b4aedc0e68229
4
- data.tar.gz: 58db551e7d0d0c8254e506762833ac6fdf303335a7db5aeef55a091e92876c4e
3
+ metadata.gz: 3363983634e71069a60fa277a03d0394993690dcf7cab706fb8a28fc22367072
4
+ data.tar.gz: d8a9855c74eb31e3de87dba1c5bd5c5362a6f2cda93d7bbcb42e8b1ceec6d7ea
5
5
  SHA512:
6
- metadata.gz: 7adb8071b41c381fcbc3ee4aa9f89e90ed1749c8fc518f7b35868c3de6291009465a7c09f745cb18affe7303a23fb3873b4c7e9551fcb3b1a8401c812ab6f7e9
7
- data.tar.gz: ff1f52873da1efdbbbd9d6387d05f3683d3d99aea8ad00246e6bc803ea96862023c9ef2ebd879c165d5d326ad3efe707362b62dcc0b651a5581897df6ef4b643
6
+ metadata.gz: 8a2e5544a14afdb95e1ca54a679285fffffacb9d25b8c8ab7971acd70d71221fde8b4c28733ee0aa4ca8900226653db6273de1d1d14552214a7c8458e6f51b88
7
+ data.tar.gz: 2cf4331a001fce697899ebaacb409a50a8d1873efad53f52ebf4612cac50f02f8616eac13b9ab62518417f78503c7077750f8fc5a361ff53e3c4d36a865f4bce
@@ -186,7 +186,7 @@ module Isomorfeus
186
186
  ctx.add_script(key: :still_busy, source: 'Opal.Isomorfeus.SSR.still_busy()')
187
187
  ctx.add_script(key: :store_busy, source: 'Opal.Isomorfeus.SSR.store_busy()')
188
188
  ctx.add_script(key: :transport_busy, source: 'global.Opal.Isomorfeus.Transport["$busy?"]()')
189
- ctx.add_script(key: :transport_disconnect, source: 'global.Opal.Isomorfeus.Transport.$disconnect()')
189
+ ctx.add_script(key: :transport_disconnect, source: 'global.Opal.Isomorfeus.SSR.$disconnect_transport()')
190
190
  end
191
191
  end
192
192
 
@@ -81,5 +81,14 @@ module Isomorfeus
81
81
  return (nfp == global.Opal.nil) ? false : nfp;
82
82
  }
83
83
  }
84
+
85
+ def self.disconnect_transport
86
+ Isomorfeus::Transport::RequestAgent.agents.each do |agent_id, agent|
87
+ agent.promise.reject() unless agent.promise.realized?
88
+ Isomorfeus::Transport::RequestAgent.del!(agent_id)
89
+ end
90
+ Isomorfeus::Transport.instance_variable_set(:@requests_in_progress, { requests: {}, agent_ids: {} })
91
+ Isomorfeus::Transport.disconnect
92
+ end
84
93
  end
85
94
  end
@@ -1,3 +1,9 @@
1
+ module Preact
2
+ def self.render_to_string(native_preact_element)
3
+ `Opal.global.Preact.renderToString(native_preact_element)`
4
+ end
5
+ end
6
+
1
7
  module Isomorfeus
2
8
  class TopLevel
3
9
  class << self
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.44'
2
+ VERSION = '10.6.45'
3
3
  end
data/lib/preact.rb CHANGED
@@ -294,11 +294,7 @@ module Preact
294
294
  end
295
295
  end
296
296
 
297
- if on_ssr?
298
- def self.render_to_string(native_preact_element)
299
- `Opal.global.Preact.renderToString(native_preact_element)`
300
- end
301
- end
297
+ # render_to_string is in top_level_ssr.rb
302
298
 
303
299
  def self.unmount_component_at_node(element_or_query)
304
300
  if `(typeof element_or_query === 'string')` || (`(typeof element_or_query.$class === 'function')` && element_or_query.class == String)
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.44
4
+ version: 10.6.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann