hyper-component 0.99.1 → 0.99.2

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
  SHA256:
3
- metadata.gz: 033e8c3a738c41b433d8e8ba054dabca724eec598e5b6e2b5dbad51619ebeb8c
4
- data.tar.gz: 8567e34a9e6bc8511d586f2f21bfd11a86f789f8833ab0335e4314647319d338
3
+ metadata.gz: 3eec3dbc742574274ae1bea9af9f6767412ccb1a2aebbf6e737cb247bfad64f1
4
+ data.tar.gz: e7ff055c0db0ceb8944513be3f1fb3205d9af3435453c1e02a817df3a2077381
5
5
  SHA512:
6
- metadata.gz: 7c9cae251636743fbdaf9078703f5c040188f1bc664c384617f9021950ce1a928443bd4a7aaa44f75dd35c6da3be04e4e3d6fbd7a6cfc85da95c5824d35ab4d8
7
- data.tar.gz: 412568d1fc5e3f46dfa3b47003c37921bcd75b336be1b5295bf8611d162c459379274db715a493bed8fb735f8207a4d49df444aa8d43393d76c54c556c3d725a
6
+ metadata.gz: 87180a8fbd5e0594cf66324ea67b4d4e383530613fa882191e14fd7cc9abcd81736400b511aec134037b6b72465e46889cad70d6033618157b8dfc28e4f59ead
7
+ data.tar.gz: 8ee1c764de8b086c01e81f46211158187efb7c298a2b26d4fb9f009f375f515cde96504cc3528185c0d25d56861f3f3f0f20d2f5f6067d554c0293bb78beb44c
@@ -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 (1.0.0.lap28)
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 (1.0.0.lap28)
32
- hyperloop-config (= 1.0.0.lap28)
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 (1.0.0.lap28)
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 (1.0.0.lap28)
49
- hyper-store (= 1.0.0.lap28)
50
- hyperloop-config (= 1.0.0.lap28)
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.7.2)
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.0)
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
@@ -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'
@@ -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.is_a?(Proc)
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
- `#{self.to_n}._reactrb_component_class = #{Class.new(Hyperloop::Component)}`
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
- klass = `#{self.to_n}._reactrb_component_class`
20
- klass.class_eval do
21
- render(container, params, &block)
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 if Object.const_defined?('Element')
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
  module Hyperloop
2
2
  class Component
3
- VERSION = '0.99.1'
3
+ VERSION = '0.99.2'
4
4
  end
5
5
  end
@@ -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/hyperstack rails installer
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.1
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-25 00:00:00.000000000 Z
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.1
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.1
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.1
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.1
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.1
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.1
168
+ version: 0.99.2
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: jquery-rails
171
171
  requirement: !ruby/object:Gem::Requirement