isomorfeus-preact 23.9.0.rc8 → 23.9.0.rc9

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: 1ee612350269b6b9f4010cd90e0663ba14d4db803936db613891732f826641e9
4
- data.tar.gz: 7a87897f5d468e213e0c06b2d4077c6293a6bdd8ea04125f754eca2a2f1fc41c
3
+ metadata.gz: fc7967e40af3865c729c12628d252d950d9fcb6ac1dc66c7043805d422c15cda
4
+ data.tar.gz: a01a076af444ff136da418a997aae6f45fe9419c6ef6a6573b027335958977e1
5
5
  SHA512:
6
- metadata.gz: e2a9266c8529c0300e7b40b411e564efe6a8cabb914483297c278e094eb23a8166429219d6ee11a71526f7d9619786889f316eccb81330dfb7e2857c245803dc
7
- data.tar.gz: db97df5c37d9177e0214fb7bfa317648a6944274f6a8324561fa2e646d80ac471a35860062cf204378380b44c451fb04bb2d87afb2fc986da7fa1f7cbd2202bf
6
+ metadata.gz: 935475cdc19f4e3d329fbf1feb8714d216011a19785887771695cdb1144c3e8ba1985cef1f86d9ea5c787fa11fd31857a7697dec5a5b089c84836a827b750c2f
7
+ data.tar.gz: 6aa27c2d7d2f38d0b7c7fb8b1a474b4f6047ac883b68f45cba8e2fcc4286c24ebceaa7bb6d4719574904e81704111466e5109d96e53cd18720f6ba6e3e206dce
@@ -7,14 +7,16 @@ module Isomorfeus
7
7
  @locale = locale
8
8
  end
9
9
 
10
- def render(skip_ssr)
10
+ def render(skip_ssr, keep_state)
11
11
  Isomorfeus.browser_location = Browser::Location.new(@location)
12
12
  Isomorfeus.current_locale = @locale if @locale
13
13
  Isomorfeus.ssr_response_status = 200
14
14
  NanoCSS.instance = NanoCSS.new(given_renderer: NanoCSS.global_instance.renderer.deep_dup)
15
- Isomorfeus.init_store
16
- Isomorfeus.store.clear!
17
- Isomorfeus.store.dispatch(type: 'I18N_MERGE', data: { locale: @locale, domain: Isomorfeus.i18n_domain })
15
+ unless keep_state
16
+ Isomorfeus.init_store
17
+ Isomorfeus.store.clear!
18
+ Isomorfeus.store.dispatch(type: 'I18N_INIT', data: { locale: @locale, domain: Isomorfeus.i18n_domain })
19
+ end
18
20
  return '' if skip_ssr
19
21
  c = Isomorfeus.current_user
20
22
  if c.respond_to?(:reload)
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Preact
3
- VERSION = '23.9.0.rc8'
3
+ VERSION = '23.9.0.rc9'
4
4
  end
5
5
  end
@@ -17,13 +17,13 @@ module Preact
17
17
  render_result
18
18
  end
19
19
 
20
- def mount_component(component_name, props = {}, skip_ssr: false)
20
+ def mount_component(component_name, props = {}, skip_ssr: false, keep_state: false)
21
21
  ssr_start_time = Time.now if Isomorfeus.development?
22
22
  locale = props.delete(:locale)
23
23
  location_host = props[:location_host] ? props[:location_host] : 'localhost'
24
24
  location = "#{props[:location_scheme] || 'http:'}//#{location_host}#{props[:location]}"
25
25
 
26
- rendered_tree, application_state, @_ssr_styles = Isomorfeus::TopLevel.mount_component(component_name, props, location, locale, skip_ssr)
26
+ rendered_tree, application_state, @_ssr_styles = Isomorfeus::TopLevel.mount_component(component_name, props, location, locale, skip_ssr, keep_state)
27
27
  component_name = component_name.to_s unless component_name.is_a?(String)
28
28
  usids = if Isomorfeus.respond_to?(:current_user) && Isomorfeus.current_user && !Isomorfeus.current_user.anonymous?
29
29
  Isomorfeus.current_user.sid.to_s
@@ -116,8 +116,8 @@ module Isomorfeus
116
116
  Isomorfeus.top_component = top
117
117
  end
118
118
  else
119
- def mount_component(component, props, location, locale, skip_ssr = false)
120
- rendered_tree = Isomorfeus::PreactSSR.new(component, props, location, locale).render(skip_ssr)
119
+ def mount_component(component, props, location, locale, skip_ssr = false, keep_state = false)
120
+ rendered_tree = Isomorfeus::PreactSSR.new(component, props, location, locale).render(skip_ssr, keep_state)
121
121
  [rendered_tree, Isomorfeus.store.get_state, NanoCSS.instance.renderer[:raw]]
122
122
  end
123
123
  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: 23.9.0.rc8
4
+ version: 23.9.0.rc9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -78,28 +78,28 @@ dependencies:
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 23.9.0.rc8
81
+ version: 23.9.0.rc9
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 23.9.0.rc8
88
+ version: 23.9.0.rc9
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: isomorfeus-redux
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 23.9.0.rc8
95
+ version: 23.9.0.rc9
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 23.9.0.rc8
102
+ version: 23.9.0.rc9
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: benchmark-ips
105
105
  requirement: !ruby/object:Gem::Requirement