hyper-component 0.99.1 → 0.99.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -20
- data/lib/hyper-component.rb +1 -1
- data/lib/react/api.rb +3 -1
- data/lib/react/ext/opal-jquery/element.rb +14 -8
- data/lib/react/top_level_render.rb +3 -1
- data/lib/reactive-ruby/version.rb +1 -1
- data/misc/generators/reactive_ruby/test_app/test_app_generator.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eec3dbc742574274ae1bea9af9f6767412ccb1a2aebbf6e737cb247bfad64f1
|
4
|
+
data.tar.gz: e7ff055c0db0ceb8944513be3f1fb3205d9af3435453c1e02a817df3a2077381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87180a8fbd5e0594cf66324ea67b4d4e383530613fa882191e14fd7cc9abcd81736400b511aec134037b6b72465e46889cad70d6033618157b8dfc28e4f59ead
|
7
|
+
data.tar.gz: 8ee1c764de8b086c01e81f46211158187efb7c298a2b26d4fb9f009f375f515cde96504cc3528185c0d25d56861f3f3f0f20d2f5f6067d554c0293bb78beb44c
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,9 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/opal/opal-jquery.git
|
3
|
-
revision: 6249dfaf406ecd7199079b4f4d9dc67cfdf4d602
|
4
|
-
branch: master
|
5
|
-
specs:
|
6
|
-
opal-jquery (0.4.3)
|
7
|
-
opal (>= 0.10.0, < 0.12.0)
|
8
|
-
|
9
1
|
PATH
|
10
2
|
remote: ../hyper-spec
|
11
3
|
specs:
|
12
|
-
hyper-spec (
|
4
|
+
hyper-spec (0.99.1)
|
13
5
|
capybara
|
14
|
-
chromedriver-helper
|
6
|
+
chromedriver-helper (= 1.2.0)
|
15
7
|
libv8 (~> 6.3.0)
|
16
8
|
method_source
|
17
9
|
mini_racer (~> 0.1.15)
|
@@ -28,14 +20,14 @@ PATH
|
|
28
20
|
PATH
|
29
21
|
remote: ../hyper-store
|
30
22
|
specs:
|
31
|
-
hyper-store (
|
32
|
-
hyperloop-config (=
|
23
|
+
hyper-store (0.99.1)
|
24
|
+
hyperloop-config (= 0.99.1)
|
33
25
|
opal (>= 0.11.0, < 0.12.0)
|
34
26
|
|
35
27
|
PATH
|
36
28
|
remote: ../hyperloop-config
|
37
29
|
specs:
|
38
|
-
hyperloop-config (
|
30
|
+
hyperloop-config (0.99.1)
|
39
31
|
libv8 (~> 6.3.0)
|
40
32
|
mini_racer (~> 0.1.15)
|
41
33
|
opal (>= 0.11.0, < 0.12.0)
|
@@ -45,9 +37,9 @@ PATH
|
|
45
37
|
PATH
|
46
38
|
remote: .
|
47
39
|
specs:
|
48
|
-
hyper-component (
|
49
|
-
hyper-store (=
|
50
|
-
hyperloop-config (=
|
40
|
+
hyper-component (0.99.1)
|
41
|
+
hyper-store (= 0.99.1)
|
42
|
+
hyperloop-config (= 0.99.1)
|
51
43
|
libv8 (~> 6.3.0)
|
52
44
|
mini_racer (~> 0.1.15)
|
53
45
|
opal (>= 0.11.0, < 0.12.0)
|
@@ -113,7 +105,7 @@ GEM
|
|
113
105
|
babel-source (>= 4.0, < 6)
|
114
106
|
execjs (~> 2.0)
|
115
107
|
builder (3.2.3)
|
116
|
-
capybara (3.
|
108
|
+
capybara (3.8.2)
|
117
109
|
addressable
|
118
110
|
mini_mime (>= 0.1.3)
|
119
111
|
nokogiri (~> 1.8)
|
@@ -148,7 +140,7 @@ GEM
|
|
148
140
|
rails-dom-testing (>= 1, < 3)
|
149
141
|
railties (>= 4.2.0)
|
150
142
|
thor (>= 0.14, < 2.0)
|
151
|
-
libv8 (6.3.292.48.1)
|
143
|
+
libv8 (6.3.292.48.1-x86_64-darwin-15)
|
152
144
|
listen (3.1.5)
|
153
145
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
154
146
|
rb-inotify (~> 0.9, >= 0.9.7)
|
@@ -185,6 +177,8 @@ GEM
|
|
185
177
|
opal-browser (0.2.0)
|
186
178
|
opal
|
187
179
|
paggio
|
180
|
+
opal-jquery (0.4.3)
|
181
|
+
opal (>= 0.10.0, < 0.12.0)
|
188
182
|
opal-rails (0.9.5)
|
189
183
|
jquery-rails
|
190
184
|
opal (>= 0.11.0, < 0.12)
|
@@ -309,7 +303,7 @@ GEM
|
|
309
303
|
equalizer (~> 0.0.9)
|
310
304
|
parser (>= 2.3.1.2, < 2.6)
|
311
305
|
procto (~> 0.0.2)
|
312
|
-
webdrivers (3.4.
|
306
|
+
webdrivers (3.4.1)
|
313
307
|
nokogiri (~> 1.6)
|
314
308
|
rubyzip (~> 1.0)
|
315
309
|
selenium-webdriver (~> 3.0)
|
@@ -333,7 +327,7 @@ DEPENDENCIES
|
|
333
327
|
listen
|
334
328
|
mime-types
|
335
329
|
nokogiri
|
336
|
-
opal-jquery
|
330
|
+
opal-jquery
|
337
331
|
opal-rails (~> 0.9.4)
|
338
332
|
opal-rspec
|
339
333
|
pry
|
data/lib/hyper-component.rb
CHANGED
@@ -25,7 +25,7 @@ if RUBY_ENGINE == 'opal'
|
|
25
25
|
require 'react/state'
|
26
26
|
require 'react/object'
|
27
27
|
require 'react/to_key'
|
28
|
-
require 'react/ext/opal-jquery/element'
|
28
|
+
#require 'react/ext/opal-jquery/element' # now have to manually require this
|
29
29
|
require 'reactive-ruby/isomorphic_helpers'
|
30
30
|
require 'react/top_level'
|
31
31
|
require 'react/top_level_render'
|
data/lib/react/api.rb
CHANGED
@@ -238,7 +238,9 @@ module React
|
|
238
238
|
elsif key == "key"
|
239
239
|
props["key"] = value.to_key
|
240
240
|
|
241
|
-
elsif key == 'ref' && value.
|
241
|
+
elsif key == 'ref' && value.respond_to?(:call)
|
242
|
+
# currently react still accepts the syntax ref: :foo meaning set refs.foo to the ref.
|
243
|
+
# in hyperstack release 0.1 we can put this behavior on a switch or use the notation `ref_key: :foo` for old school
|
242
244
|
props[key] = %x{
|
243
245
|
function(dom_node){
|
244
246
|
if (dom_node !== null && dom_node.__opalInstance !== undefined && dom_node.__opalInstance !== null) {
|
@@ -13,15 +13,21 @@ Element.instance_eval do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
define_method :render do |container = nil, params = {}, &block|
|
16
|
+
# create an invisible component class and hang it off the DOM element
|
16
17
|
if `#{self.to_n}._reactrb_component_class === undefined`
|
17
|
-
|
18
|
+
klass = Class.new(Hyperloop::Component) do
|
19
|
+
# react won't rerender the components unless it sees some params
|
20
|
+
# changing, so we just copy them all in, but we still just reuse
|
21
|
+
# the render macro to define the action
|
22
|
+
others :all_the_params
|
23
|
+
end
|
24
|
+
`#{self.to_n}._reactrb_component_class = #{klass}`
|
25
|
+
else
|
26
|
+
klass = `#{self.to_n}._reactrb_component_class`
|
18
27
|
end
|
19
|
-
|
20
|
-
klass.
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
React.render(React.create_element(`#{self.to_n}._reactrb_component_class`), self)
|
28
|
+
# define / redefine the render method
|
29
|
+
klass.render(container, params, &block)
|
30
|
+
React.render(React.create_element(klass, {container: container, params: params, block: block}), self)
|
25
31
|
end
|
26
32
|
|
27
33
|
# mount_components is useful for dynamically generated page segments for example
|
@@ -34,4 +40,4 @@ Element.instance_eval do
|
|
34
40
|
}
|
35
41
|
}
|
36
42
|
Element.expose :mount_components
|
37
|
-
end
|
43
|
+
end
|
@@ -16,7 +16,9 @@ module React
|
|
16
16
|
else
|
17
17
|
native = `ReactDOM.render(#{element.to_n}, container)`
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
|
+
return unless `#{native} !== null`
|
21
|
+
|
20
22
|
if `#{native}.__opalInstance !== undefined && #{native}.__opalInstance !== null`
|
21
23
|
`#{native}.__opalInstance`
|
22
24
|
elsif `ReactDOM.findDOMNode !== undefined && #{native}.nodeType === undefined`
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Although we are not using this it would be good to move back to this model in future.
|
2
|
-
# For one thing it would be a good way to test the hyperloop/
|
2
|
+
# For one thing it would be a good way to test the hyperloop/Hyperloop rails installer
|
3
3
|
# so for now keep these files here as a template
|
4
4
|
|
5
5
|
require 'rails/generators/rails/app/app_generator'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.99.
|
4
|
+
version: 0.99.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chang
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-09
|
15
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: hyper-store
|
@@ -20,28 +20,28 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - '='
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.99.
|
23
|
+
version: 0.99.2
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - '='
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.99.
|
30
|
+
version: 0.99.2
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: hyperloop-config
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - '='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.99.
|
37
|
+
version: 0.99.2
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - '='
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.99.
|
44
|
+
version: 0.99.2
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: libv8
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,14 +158,14 @@ dependencies:
|
|
158
158
|
requirements:
|
159
159
|
- - '='
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: 0.99.
|
161
|
+
version: 0.99.2
|
162
162
|
type: :development
|
163
163
|
prerelease: false
|
164
164
|
version_requirements: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - '='
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version: 0.99.
|
168
|
+
version: 0.99.2
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: jquery-rails
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|