react_on_rails 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: 4a68c1b72267dce9d0864c0e21429df7e89011e8
4
- data.tar.gz: 1bbf750bdf7b128fba4c393a7716b2eef962674e
3
+ metadata.gz: b19c93747fab84bdc395c8f9dc2d664581863fca
4
+ data.tar.gz: 57488190d54beecdbc25296efd1d4ad0bc769cae
5
5
  SHA512:
6
- metadata.gz: 82077ea1833158fb45c76c6ab5de0235e42f753257ff7f9a254938db05b2fe9a4262a126f729224a1be1f838139866111e0cefd6a4068f075c96b32dbb3ee616
7
- data.tar.gz: b0f8347d48219798ceffede4bd9d83c5eeb9b8f0509913fac16a6ab22a5b5dc2eb6d9bff094ce1ce7a23f2bcbf6555245dcbc43c388cb335dc91edc3c8536321
6
+ metadata.gz: 480d293755f22424befb537760ccce6e3e148ce82adf015efa5a2fa3699486d615c7ab332e3b980bb22f423355c15027d706b6423824d24f3755e56bf605cf59
7
+ data.tar.gz: 5eeecc42bbe0e439ad468b42b683632101608fa4b0fbba72e4c01fd6619c673ac3f18716d6aa39df121021a4fee4555ea2b4e1e5916c3433830848d11ac5582c
@@ -78,7 +78,7 @@ module ReactOnRailsHelper
78
78
  content_tag_options[:id] = dom_id
79
79
 
80
80
  rendered_output = content_tag(:div,
81
- server_rendered_html,
81
+ server_rendered_html.html_safe,
82
82
  content_tag_options)
83
83
 
84
84
  # IMPORTANT: Ensure that we mark string as html_safe to avoid escaping.
@@ -95,6 +95,7 @@ module ReactOnRailsHelper
95
95
  end
96
96
 
97
97
  # Returns Array [0]: html, [1]: script to console log
98
+ # NOTE, these are NOT html_safe!
98
99
  def server_rendered_react_component_html(options, props_string, react_component_name, data_variable, dom_id)
99
100
  if prerender(options)
100
101
  render_js_expression = <<-JS
@@ -57,7 +57,7 @@ var console = { history: [] };
57
57
  var htmlResult = '';
58
58
  var consoleReplay = '';
59
59
  #{ReactOnRails::ReactRenderer.wrap_code_with_exception_handler(result_js_code, component_name)}
60
- #{console_replay_js_code}
60
+ #{console_replay_js_code}
61
61
  return JSON.stringify([htmlResult, consoleReplay]);
62
62
  })()
63
63
  JS
@@ -82,10 +82,12 @@ var console = { history: [] };
82
82
  console_script_lines = console_script.split("\n")
83
83
  console_script_lines = console_script_lines[2..-2]
84
84
  re = /console\.log\.apply\(console, \["\[SERVER\] (?<msg>.*)"\]\);/
85
- console_script_lines.each do |line|
86
- match = re.match(line)
87
- if match
88
- Rails.logger.info { "[react_on_rails] #{match[:msg]}"}
85
+ if console_script_lines
86
+ console_script_lines.each do |line|
87
+ match = re.match(line)
88
+ if match
89
+ Rails.logger.info { "[react_on_rails] #{match[:msg]}" }
90
+ end
89
91
  end
90
92
  end
91
93
  end
@@ -153,7 +155,7 @@ var console = { history: [] };
153
155
  def base_js_code(bundle_js_code)
154
156
  <<-JS
155
157
  #{CONSOLE_POLYFILL}
156
- #{bundle_js_code};
158
+ #{bundle_js_code};
157
159
  JS
158
160
  end
159
161
 
@@ -1,3 +1,3 @@
1
1
  module ReactOnRails
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon