hyper-react 0.12.6 → 0.12.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44aee5bb00f9e340cd5d892e7f2a38e38bc0d1d3
|
4
|
+
data.tar.gz: 6ca48472eec183e3c32300cd218234645f113fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d52361feb3a174d2453ea0f098e31ab8d04f03a06235ecdbca94fb9b9f0e1502c92cd2bd524fa688394e085240313c11535bef673afa9aae3f0a04264fa694f
|
7
|
+
data.tar.gz: 195be570e47647c4b058989be793a08b55712a2f90896116b503b60dc620239feabd15e5181016f51533f274e50b1d78d5da7cd9986017297883ba4f6a6cf79e
|
data/lib/react/config/server.rb
CHANGED
@@ -136,12 +136,16 @@ module React
|
|
136
136
|
end
|
137
137
|
|
138
138
|
class IsomorphicProcCall
|
139
|
+
|
140
|
+
attr_reader :context
|
141
|
+
|
139
142
|
def result
|
140
143
|
@result.first if @result
|
141
144
|
end
|
142
145
|
|
143
|
-
def initialize(name, block, *args)
|
146
|
+
def initialize(name, block, context, *args)
|
144
147
|
@name = name
|
148
|
+
@context = context
|
145
149
|
block.call(self, *args)
|
146
150
|
@result ||= send_to_server(*args) if IsomorphicHelpers.on_opal_server?
|
147
151
|
end
|
@@ -190,7 +194,7 @@ module React
|
|
190
194
|
if RUBY_ENGINE != 'opal'
|
191
195
|
def isomorphic_method(name, &block)
|
192
196
|
React::IsomorphicHelpers::Context.send(:define_method, name) do |args_as_json|
|
193
|
-
React::IsomorphicHelpers::IsomorphicProcCall.new(name, block, *JSON.parse(args_as_json)).result
|
197
|
+
React::IsomorphicHelpers::IsomorphicProcCall.new(name, block, self, *JSON.parse(args_as_json)).result
|
194
198
|
end
|
195
199
|
end
|
196
200
|
else
|
@@ -198,10 +202,11 @@ module React
|
|
198
202
|
|
199
203
|
def isomorphic_method(name, &block)
|
200
204
|
self.class.send(:define_method, name) do | *args |
|
201
|
-
React::IsomorphicHelpers::IsomorphicProcCall.new(name, block, *args).result
|
205
|
+
React::IsomorphicHelpers::IsomorphicProcCall.new(name, block, self, *args).result
|
202
206
|
end
|
203
207
|
end
|
204
208
|
end
|
209
|
+
|
205
210
|
end
|
206
211
|
end
|
207
212
|
end
|
@@ -10,6 +10,18 @@ module ReactiveRuby
|
|
10
10
|
ReactiveRuby::Rails::ComponentMount
|
11
11
|
end
|
12
12
|
config.after_initialize do
|
13
|
+
::ApplicationController.class_eval do
|
14
|
+
before_action do
|
15
|
+
if params.has_key? 'hyperloop-prerendering'
|
16
|
+
params['hyperloop-prerendering'].to_s == 'on'
|
17
|
+
elsif params.has_key? 'hyperloop_prerendering'
|
18
|
+
params['hyperloop_prerendering'].to_s == 'on'
|
19
|
+
else
|
20
|
+
Hyperloop.prerendering.to_s == 'on'
|
21
|
+
end && next
|
22
|
+
params[:no_prerender] = '1'
|
23
|
+
end
|
24
|
+
end
|
13
25
|
class ::HyperloopController < ::ApplicationController
|
14
26
|
def action_missing(name)
|
15
27
|
render_component
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper-react
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chang
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-06-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: opal
|