isomorfeus-react 16.12.17 → 16.12.18

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: 8704edb4695c6a3bbdcc883561efa8805fc7ed90c1d3543ac745af3eb068b8e4
4
- data.tar.gz: 753f031d5802e73bd33cda45864af5bcdc18390ab298c8b5c218fcb652e33d56
3
+ metadata.gz: 0cdb3fe9f9ac0989e122cd62cebb2eb9c9d906e65b160d6ec89311410673c796
4
+ data.tar.gz: 4fe01c1d3bba31402af4fc1e3d12a208735178f66f42c54beb9a49d4e725f75d
5
5
  SHA512:
6
- metadata.gz: 9efe68df61847675035ff10854adc02c4d0b655a009b628786e643b1b52b8d9e429718bbce851c355e2755e610bd4778b67db10806a4348cfbab2e0de7ebb51b
7
- data.tar.gz: 1f5ee48f594bc5f1f1a46b5669a8100b56086ef2444ad9566d65e5c75c472a24ea0933209f1ab6042cc20b54d936127485070a8ac3d8d832e65667de8ea0dcb5
6
+ metadata.gz: 2f4d13ca4f1d3ca81f3563a57e72ff7ef338606e2abcdfd41518cd8e85e4a1a5fe952904d6382a9100c1db7d882e0387effa6568b71b2d8375ac6d1a0cd173ad
7
+ data.tar.gz: d7887ef8e4ab8f5b0a91de7feeebd0bfcb6bfa613b2a2cfc389c39a4a020d91c373bd95e5311f6431f3d3813767f71f95eff8e849ac8afd92625bae40d95f87c
@@ -1,6 +1,7 @@
1
1
  module Isomorfeus
2
2
  if RUBY_ENGINE == 'opal'
3
3
  class << self
4
+ attr_accessor :current_user_sid
4
5
  attr_accessor :initial_state_fetched
5
6
  attr_accessor :top_component
6
7
  attr_accessor :ssr_response_status
@@ -66,6 +66,7 @@ module Isomorfeus
66
66
  global.Opal.React.active_redux_components = [];
67
67
  global.FirstPassFinished = false;
68
68
  global.Exception = false;
69
+ global.IsomorfeusSessionId = '#{Thread.current[:isomorfeus_session_id]}';
69
70
  global.Opal.Isomorfeus['$env=']('#{Isomorfeus.env}');
70
71
  if (typeof global.Opal.Isomorfeus.$negotiated_locale === 'function') {
71
72
  global.Opal.Isomorfeus["$negotiated_locale="]('#{props[:locale]}');
@@ -188,6 +189,9 @@ module Isomorfeus
188
189
 
189
190
  # build result
190
191
  render_result << " data-iso-hydrated='true'" if rendered_tree
192
+ if Isomorfeus.respond_to?(:current_user) && Isomorfeus.current_user && !Isomorfeus.current_user.anonymous?
193
+ render_result << " data-iso-usid=#{Oj.dump(Isomorfeus.current_user.to_sid, mode: :strict)}"
194
+ end
191
195
  render_result << " data-iso-nloc='#{props[:locale]}'>"
192
196
  render_result << (rendered_tree ? rendered_tree : "SSR didn't work")
193
197
  else
@@ -8,6 +8,8 @@ module Isomorfeus
8
8
  Isomorfeus.raise_error(message: "Isomorfeus root element not found!") unless root_element
9
9
  component_name = root_element.JS.getAttribute('data-iso-root')
10
10
  Isomorfeus.env = root_element.JS.getAttribute('data-iso-env')
11
+ user_sid = root_element.JS.getAttribute('data-iso-usid')
12
+ Isomorfeus.current_user_sid =`JSON.parse(user_sid)` if user_sid
11
13
  component = nil
12
14
  begin
13
15
  component = component_name.constantize
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '16.12.17'
2
+ VERSION = '16.12.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.12.17
4
+ version: 16.12.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-09 00:00:00.000000000 Z
11
+ date: 2020-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -277,7 +277,7 @@ metadata:
277
277
  github_repo: ssh://github.com/isomorfeus/gems
278
278
  post_install_message: |2+
279
279
 
280
- isomorfeus-react 16.12.17:
280
+ isomorfeus-react 16.12.18:
281
281
  Breaking change:
282
282
  The event_handler DSL is gone. Instead use normal methods and method_ref, see:
283
283
  https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/events.md