hyper-model 0.99.6 → 1.0.alpha1

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: f6c137cd71251420f2573740c2000a141f53a02b9e6d81831996e7a8e0f4cead
4
- data.tar.gz: ac62850afab0e8ecd071dc778acd3c721fe7e63d5a928184d50db408d4a6081b
3
+ metadata.gz: a245fe2a742d8094103d2db9c6750b7b237ad35a264d0ad32943cfa818a1369f
4
+ data.tar.gz: 1aabdd74cf0891a044990eaad6bba04a954707ad6019cd45346503222bce4339
5
5
  SHA512:
6
- metadata.gz: 95a19207110f44eaad41e07477bc2bf3efd0922175feb04d6f65a6351f7ec406e31fb8409c1b4c4cb10cdfea6331d3d83ca17f9c37a402a639e9e5c8f8cafb89
7
- data.tar.gz: 41871531a11a6dcea8a8a3a690ad96d6ff5c490aec454d7512acd7d5cbe422e763e787c322ff747399ed4fb2d044a128f27a9a5de2ffec0d396a64ca42ea4132
6
+ metadata.gz: c01d045ff7537335365032b0d61dd3effb7e64724ca1e87e6ede22543ece2ba3985ccc3cc47b44d5bf5052807699412ef92fe87655b7768c37d4d2faa6e0ebe7
7
+ data.tar.gz: e494ac07e5b6acbad8dfd1575c1953e6ad977e85a120fcde5883f86e06e02d8ba1c8ba7ade123da11f8a549fab2f29d9494154061c62fdb2649217e4c8a93da9
data/Gemfile CHANGED
@@ -2,7 +2,8 @@ source 'https://rubygems.org'
2
2
  #gem "opal-jquery", git: "https://github.com/opal/opal-jquery.git", branch: "master"
3
3
  # hyper-model is still using an ancient inlined version of hyper-spec
4
4
  #gem 'hyper-spec', path: '../hyper-spec'
5
- gem 'hyperloop-config', path: '../hyperloop-config'
5
+ gem 'hyperstack-config', path: '../hyperstack-config'
6
+ gem 'hyper-state', path: '../hyper-state'
6
7
  gem 'hyper-store', path: '../hyper-store'
7
8
  gem 'hyper-component', path: '../hyper-component'
8
9
  gem 'hyper-operation', path: '../hyper-operation'
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: ../hyper-component
3
3
  specs:
4
- hyper-component (0.99.6)
5
- hyper-store (= 0.99.6)
6
- hyperloop-config (= 0.99.6)
7
- libv8 (~> 6.7.0)
8
- mini_racer (~> 0.2.4)
4
+ hyper-component (0.1)
5
+ hyper-state (= 0.1)
6
+ hyperstack-config (= 0.1)
7
+ libv8 (~> 6.3.0)
8
+ mini_racer (~> 0.1.15)
9
9
  opal (>= 0.11.0, < 0.12.0)
10
10
  opal-activesupport (~> 0.3.1)
11
11
  react-rails (>= 2.4.0, < 2.5.0)
@@ -13,37 +13,48 @@ PATH
13
13
  PATH
14
14
  remote: ../hyper-operation
15
15
  specs:
16
- hyper-operation (0.99.6)
16
+ hyper-operation (0.1)
17
17
  activerecord (>= 4.0.0)
18
- hyper-component (= 0.99.6)
18
+ hyper-component (= 0.1)
19
19
  mutations
20
20
  opal-activesupport (~> 0.3.1)
21
21
 
22
+ PATH
23
+ remote: ../hyper-state
24
+ specs:
25
+ hyper-state (0.1)
26
+ hyperstack-config (= 0.1)
27
+ opal (>= 0.11.0, < 0.12.0)
28
+
22
29
  PATH
23
30
  remote: ../hyper-store
24
31
  specs:
25
- hyper-store (0.99.6)
26
- hyperloop-config (= 0.99.6)
32
+ hyper-store (0.1)
33
+ hyper-state (= 0.1)
34
+ hyperstack-config (= 0.1)
27
35
  opal (>= 0.11.0, < 0.12.0)
28
36
 
29
37
  PATH
30
- remote: ../hyperloop-config
38
+ remote: ../hyperstack-config
31
39
  specs:
32
- hyperloop-config (0.99.6)
33
- libv8 (~> 6.7.0)
34
- mini_racer (~> 0.2.4)
40
+ hyperstack-config (0.1)
41
+ libv8 (~> 6.3.0)
42
+ listen (~> 3.0)
43
+ mini_racer (~> 0.1.15)
35
44
  opal (>= 0.11.0, < 0.12.0)
36
45
  opal-browser (~> 0.2.0)
37
46
  uglifier
47
+ websocket
38
48
 
39
49
  PATH
40
50
  remote: .
41
51
  specs:
42
- hyper-model (0.99.6)
52
+ hyper-model (0.1)
43
53
  activemodel
44
54
  activerecord (>= 4.0.0)
45
- hyper-component (= 0.99.6)
46
- hyper-operation (= 0.99.6)
55
+ hyper-component (= 0.1)
56
+ hyper-operation (= 0.1)
57
+ hyper-store (= 0.1)
47
58
 
48
59
  GEM
49
60
  remote: https://rubygems.org/
@@ -162,7 +173,11 @@ GEM
162
173
  rails-dom-testing (>= 1, < 3)
163
174
  railties (>= 4.2.0)
164
175
  thor (>= 0.14, < 2.0)
165
- libv8 (6.7.288.46.1)
176
+ libv8 (6.3.292.48.1)
177
+ listen (3.1.5)
178
+ rb-fsevent (~> 0.9, >= 0.9.4)
179
+ rb-inotify (~> 0.9, >= 0.9.7)
180
+ ruby_dep (~> 1.2)
166
181
  loofah (2.2.2)
167
182
  crass (~> 1.0.2)
168
183
  nokogiri (>= 1.5.9)
@@ -176,11 +191,11 @@ GEM
176
191
  mimemagic (0.3.2)
177
192
  mini_mime (1.0.1)
178
193
  mini_portile2 (2.3.0)
179
- mini_racer (0.2.4)
180
- libv8 (>= 6.3)
194
+ mini_racer (0.1.15)
195
+ libv8 (~> 6.3)
181
196
  minitest (5.11.3)
182
197
  multi_json (1.13.1)
183
- mutations (0.9.0)
198
+ mutations (0.8.3)
184
199
  activesupport
185
200
  mysql2 (0.5.2)
186
201
  nio4r (2.3.1)
@@ -223,7 +238,7 @@ GEM
223
238
  interception (>= 0.5)
224
239
  pry
225
240
  public_suffix (3.0.3)
226
- puma (3.11.4)
241
+ puma (3.12.0)
227
242
  pusher (1.3.1)
228
243
  httpclient (~> 2.7)
229
244
  multi_json (~> 1.0)
@@ -264,6 +279,9 @@ GEM
264
279
  rainbow (2.2.2)
265
280
  rake
266
281
  rake (12.3.1)
282
+ rb-fsevent (0.10.3)
283
+ rb-inotify (0.9.10)
284
+ ffi (>= 0.5.0, < 2)
267
285
  react-rails (2.4.7)
268
286
  babel-transpiler (>= 0.7.0)
269
287
  connection_pool
@@ -310,6 +328,7 @@ GEM
310
328
  ruby-progressbar (~> 1.7)
311
329
  unicode-display_width (~> 1.0, >= 1.0.1)
312
330
  ruby-progressbar (1.10.0)
331
+ ruby_dep (1.5.0)
313
332
  rubyzip (1.2.2)
314
333
  selenium-webdriver (3.14.0)
315
334
  childprocess (~> 0.5)
@@ -343,10 +362,10 @@ GEM
343
362
  timecop (0.8.1)
344
363
  tzinfo (1.2.5)
345
364
  thread_safe (~> 0.1)
346
- uglifier (4.1.20)
365
+ uglifier (4.1.19)
347
366
  execjs (>= 0.3.0, < 3)
348
367
  unicode-display_width (1.4.0)
349
- unparser (0.3.0)
368
+ unparser (0.2.8)
350
369
  abstract_type (~> 0.0.7)
351
370
  adamantium (~> 0.2.0)
352
371
  concord (~> 0.1.5)
@@ -354,6 +373,7 @@ GEM
354
373
  equalizer (~> 0.0.9)
355
374
  parser (>= 2.3.1.2, < 2.6)
356
375
  procto (~> 0.0.2)
376
+ websocket (1.2.8)
357
377
  websocket-driver (0.7.0)
358
378
  websocket-extensions (>= 0.1.0)
359
379
  websocket-extensions (0.1.3)
@@ -372,10 +392,11 @@ DEPENDENCIES
372
392
  hyper-component!
373
393
  hyper-model!
374
394
  hyper-operation!
395
+ hyper-state!
375
396
  hyper-store!
376
- hyperloop-config!
377
- libv8 (~> 6.7.0)
378
- mini_racer (~> 0.2.4)
397
+ hyperstack-config!
398
+ libv8 (~> 6.3.0)
399
+ mini_racer (~> 0.1.15)
379
400
  mysql2
380
401
  opal-activesupport (~> 0.3.1)
381
402
  opal-browser (~> 0.2.0)
@@ -404,7 +425,7 @@ DEPENDENCIES
404
425
  spring-commands-rspec
405
426
  sqlite3
406
427
  timecop (~> 0.8.1)
407
- unparser (~> 0.3.0)
428
+ unparser
408
429
 
409
430
  BUNDLED WITH
410
- 1.17.3
431
+ 1.16.1
@@ -13,11 +13,11 @@ Gem::Specification.new do |spec|
13
13
  'API. HyperModel also implements push notifications (via a number of '\
14
14
  'possible technologies) so changes to records on the server are '\
15
15
  'dynamically updated on all authorised clients.'
16
- spec.homepage = 'http://ruby-hyperloop.org'
16
+ spec.homepage = 'http://ruby-hyperstack.org'
17
17
  spec.license = 'MIT'
18
18
  # spec.metadata = {
19
- # "homepage_uri" => 'http://ruby-hyperloop.org',
20
- # "source_code_uri" => 'https://github.com/ruby-hyperloop/hyper-component'
19
+ # "homepage_uri" => 'http://ruby-hyperstack.org',
20
+ # "source_code_uri" => 'https://github.com/ruby-hyperstack/hyper-component'
21
21
  # }
22
22
 
23
23
  spec.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(examples|gemfiles|pkg|reactive_record_test_app|spec)/}) }
@@ -29,11 +29,12 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency 'activerecord', '>= 4.0.0'
30
30
  spec.add_dependency 'hyper-component', HyperModel::VERSION
31
31
  spec.add_dependency 'hyper-operation', HyperModel::VERSION
32
+ spec.add_dependency 'hyper-store', HyperModel::VERSION # only for Hyperstack::Internal::Store::State which should be moved
32
33
  spec.add_development_dependency 'bundler'
33
34
  spec.add_development_dependency 'capybara'
34
35
  spec.add_development_dependency 'chromedriver-helper', '1.2.0'
35
- spec.add_development_dependency 'libv8', '~> 6.7.0'
36
- spec.add_development_dependency 'mini_racer', '~> 0.2.4'
36
+ spec.add_development_dependency 'libv8', '~> 6.3.0' # see https://github.com/discourse/mini_racer/issues/92
37
+ spec.add_development_dependency 'mini_racer', '~> 0.1.15'
37
38
  spec.add_development_dependency 'selenium-webdriver'
38
39
  spec.add_development_dependency 'database_cleaner'
39
40
  spec.add_development_dependency 'factory_bot_rails'
@@ -65,5 +66,5 @@ Gem::Specification.new do |spec|
65
66
  spec.add_development_dependency 'spring-commands-rspec'
66
67
  spec.add_development_dependency 'sqlite3'
67
68
  spec.add_development_dependency 'timecop', '~> 0.8.1'
68
- spec.add_development_dependency 'unparser', '~> 0.3.0' # 0.4.x is incompatible
69
+ spec.add_development_dependency 'unparser'
69
70
  end
@@ -1,6 +1,6 @@
1
1
  # Monkey patches to ActiveRecord for scoping, security, and to synchronize models
2
2
  module ActiveRecord
3
- # hyperloop adds new features to scopes to allow for computing scopes on client side
3
+ # hyperstack adds new features to scopes to allow for computing scopes on client side
4
4
  # and for hinting at what joins are involved in a scope. _synchromesh_scope_args_check
5
5
  # processes these arguments, and the will always leave the true server side scoping
6
6
  # proc in the `:server` opts. This method is common to client and server.
@@ -43,7 +43,7 @@ module ActiveRecord
43
43
  return self if __synchromesh_permission_granted
44
44
  return self if __secure_remote_access_to_all(self, acting_user).__synchromesh_permission_granted
45
45
  return self if __secure_remote_access_to_unscoped(self, acting_user).__synchromesh_permission_granted
46
- Hyperloop::InternalPolicy.raise_operation_access_violation(:scoped_permission_not_granted, "Last relation: #{self}, acting_user: #{acting_user}")
46
+ Hyperstack::InternalPolicy.raise_operation_access_violation(:scoped_permission_not_granted, "Last relation: #{self}, acting_user: #{acting_user}")
47
47
  end
48
48
  end
49
49
  # Monkey patches and extensions to base
@@ -53,11 +53,11 @@ module ActiveRecord
53
53
  # __secure_remote_access_to_
54
54
 
55
55
  # The wrapper method may simply return the normal result or may act to secure the data.
56
- # The simpliest case is for the method to call `denied!` which will raise a Hyperloop
56
+ # The simpliest case is for the method to call `denied!` which will raise a Hyperstack
57
57
  # access protection fault.
58
58
 
59
59
  def denied!
60
- Hyperloop::InternalPolicy.raise_operation_access_violation(:scoped_denied, "#{self} regulation denies scope access. Called from #{caller_locations(1)}")
60
+ Hyperstack::InternalPolicy.raise_operation_access_violation(:scoped_denied, "#{self} regulation denies scope access. Called from #{caller_locations(1)}")
61
61
  end
62
62
 
63
63
  # Here we set up the base `all` and `unscoped` methods. See below for more on how
@@ -199,7 +199,7 @@ module ActiveRecord
199
199
  regulate_scope(:all, &block)
200
200
  end
201
201
 
202
- # monkey patch scope and default_scope macros to process hyperloop special opts,
202
+ # monkey patch scope and default_scope macros to process hyperstack special opts,
203
203
  # and add regulations if present
204
204
 
205
205
  alias pre_synchromesh_scope scope
@@ -276,7 +276,7 @@ module ActiveRecord
276
276
  end
277
277
 
278
278
  def denied!
279
- Hyperloop::InternalPolicy.raise_operation_access_violation(:scoped_denied, "#{self.class} regulation denies scope access. Called from #{caller_locations(1)}")
279
+ Hyperstack::InternalPolicy.raise_operation_access_violation(:scoped_denied, "#{self.class} regulation denies scope access. Called from #{caller_locations(1)}")
280
280
  end
281
281
 
282
282
  # call do_not_synchronize to block synchronization of a model
@@ -314,9 +314,9 @@ module ActiveRecord
314
314
  ReactiveRecord::Broadcast.after_commit :destroy, self
315
315
  end
316
316
 
317
- def __hyperloop_secure_attributes(acting_user)
317
+ def __hyperstack_secure_attributes(acting_user)
318
318
  accessible_attributes =
319
- Hyperloop::InternalPolicy.accessible_attributes_for(self, acting_user)
319
+ Hyperstack::InternalPolicy.accessible_attributes_for(self, acting_user)
320
320
  attributes.select { |attr| accessible_attributes.include? attr.to_sym }
321
321
  end
322
322
 
@@ -1,5 +1,5 @@
1
1
  require 'set'
2
- require 'hyperloop-config'
2
+ require 'hyperstack-config'
3
3
  require 'hyper-component'
4
4
  if RUBY_ENGINE == 'opal'
5
5
  require 'hyper-operation'
@@ -9,6 +9,8 @@ if RUBY_ENGINE == 'opal'
9
9
  require 'kernel/itself' unless Object.instance_methods.include?(:itself)
10
10
  require 'object/tap'
11
11
  require 'active_model_client_stubs'
12
+ require 'hyper-state'
13
+ require 'hyper-store'
12
14
  require "reactive_record/active_record_error"
13
15
  require "reactive_record/active_record/errors"
14
16
  require "reactive_record/active_record/error"
@@ -36,14 +38,14 @@ if RUBY_ENGINE == 'opal'
36
38
  require "reactive_record/active_record/instance_methods"
37
39
  require "reactive_record/active_record/base"
38
40
  require 'hyper_react/input_tags'
39
- require 'hyperloop/model/load'
41
+ require 'hyperstack/model/load'
40
42
  require_relative 'hyper_model/version'
41
43
  require_relative 'opal/parse_patch'
42
44
  require_relative 'opal/set_patches'
43
45
  require_relative 'opal/equality_patches'
44
- React::IsomorphicHelpers.log(
46
+ Hyperstack::Component::IsomorphicHelpers.log(
45
47
  "The gem 'hyper-mesh' is deprecated. Use gem 'hyper-model' instead.", :warning
46
- ) unless defined? Hyperloop::Model
48
+ ) unless defined? Hyperstack::Model
47
49
  else
48
50
  require 'opal'
49
51
  require 'hyper-operation'
@@ -1,3 +1,3 @@
1
1
  module HyperModel
2
- VERSION = '0.99.6'
2
+ VERSION = '1.0.alpha1'
3
3
  end
@@ -7,40 +7,43 @@
7
7
  # flag then we know that within that expression there is a value still being loaded, and the react
8
8
  # key will be set accordingly.
9
9
 
10
- module React
11
- module Component
12
- module Tags
13
- %i[INPUT SELECT TEXTAREA].each do |component|
14
- remove_method component
15
- send(:remove_const, component)
16
- tag = component.downcase
17
- klass = Class.new(Hyperloop::Component) do
18
- collect_other_params_as :opts
19
- render do
20
- opts = props.dup # should be opts = params.opts.dup but requires next release candiate of hyper-react
21
- default_value = opts[:defaultValue] || opts[:defaultChecked]
22
- if default_value.respond_to? :call
23
- begin
24
- saved_waiting_on_resources = React::RenderingContext.waiting_on_resources
25
- React::RenderingContext.waiting_on_resources = false
26
- default_value = default_value.call
27
- opts[:key] = React::RenderingContext.waiting_on_resources
28
- if opts[:defaultValue]
29
- opts[:defaultValue] = default_value
30
- else
31
- opts[:defaultChecked] = default_value
10
+ module Hyperstack
11
+ module Internal
12
+ module Component
13
+ module Tags
14
+ %i[INPUT SELECT TEXTAREA].each do |component|
15
+ remove_method component
16
+ send(:remove_const, component)
17
+ tag = component.downcase
18
+ klass = Class.new do
19
+ include Hyperstack::Component
20
+ collect_other_params_as :opts
21
+ render do
22
+ opts = props.dup # should be opts = params.opts.dup but requires next release candiate of hyper-react
23
+ default_value = opts[:defaultValue] || opts[:defaultChecked]
24
+ if default_value.respond_to? :call
25
+ begin
26
+ saved_waiting_on_resources = Hyperstack::Internal::Component::RenderingContext.waiting_on_resources
27
+ Hyperstack::Internal::Component::RenderingContext.waiting_on_resources = false
28
+ default_value = default_value.call
29
+ opts[:key] = Hyperstack::Internal::Component::RenderingContext.waiting_on_resources
30
+ if opts[:defaultValue]
31
+ opts[:defaultValue] = default_value
32
+ else
33
+ opts[:defaultChecked] = default_value
34
+ end
35
+ ensure
36
+ Hyperstack::Internal::Component::RenderingContext.waiting_on_resources = !!saved_waiting_on_resources
32
37
  end
33
- ensure
34
- React::RenderingContext.waiting_on_resources = !!saved_waiting_on_resources
38
+ else
39
+ opts[:key] = !!default_value.loading?
35
40
  end
36
- else
37
- opts[:key] = !!default_value.loading?
41
+ opts[:value] = opts[:value].to_s if opts.key? :value # this may not be needed
42
+ Hyperstack::Internal::Component::RenderingContext.render(tag, opts) { children.each(&:render) }
38
43
  end
39
- opts[:value] = opts[:value].to_s if opts.key? :value # this may not be needed
40
- React::RenderingContext.render(tag, opts) { children.each(&:render) }
41
44
  end
45
+ const_set component, klass
42
46
  end
43
- const_set component, klass
44
47
  end
45
48
  end
46
49
  end
@@ -1,4 +1,4 @@
1
- module Hyperloop
1
+ module Hyperstack
2
2
  module Model
3
3
  def self.load(&block)
4
4
  ReactiveRecord.load(&block)
@@ -210,7 +210,7 @@ module ActiveModel
210
210
  alias :blank? :empty?
211
211
 
212
212
  def reactive_empty?
213
- React::State.get_state(self, 'ERRORS?')
213
+ Hyperstack::Internal::Store::State.get_state(self, 'ERRORS?')
214
214
  end
215
215
 
216
216
  # Clear the error messages.
@@ -368,7 +368,7 @@ module ActiveModel
368
368
  end
369
369
 
370
370
  def reactive_empty!(state = empty?)
371
- React::State.set_state(self, 'ERRORS?', state) unless ReactiveRecord::Base.data_loading?
371
+ Hyperstack::Internal::Store::State.set_state(self, 'ERRORS?', state) unless ReactiveRecord::Base.data_loading?
372
372
  end
373
373
  end
374
374
  end
@@ -149,7 +149,7 @@ module ActiveRecord
149
149
  end
150
150
 
151
151
  def errors
152
- React::State.get_state(@backing_record, @backing_record)
152
+ Hyperstack::Internal::Store::State.get_state(@backing_record, @backing_record)
153
153
  @backing_record.errors
154
154
  end
155
155
 
@@ -1,5 +1,5 @@
1
- module Hyperloop
2
- define_setting :public_model_directories, [File.join('app','hyperloop','models'), File.join('app','models','public')]
1
+ module Hyperstack
2
+ define_setting :public_model_directories, [File.join('app','hyperstack','models'), File.join('app','models','public')]
3
3
  end
4
4
 
5
5
  module ActiveRecord
@@ -9,7 +9,7 @@ module ActiveRecord
9
9
  def self.public_columns_hash
10
10
  return @public_columns_hash if @public_columns_hash && Rails.env.production?
11
11
  files = []
12
- Hyperloop.public_model_directories.each do |dir|
12
+ Hyperstack.public_model_directories.each do |dir|
13
13
  dir_length = Rails.root.join(dir).to_s.length + 1
14
14
  Dir.glob(Rails.root.join(dir, '**', '*.rb')).each do |file|
15
15
  require_dependency(file) # still the file is loaded to make sure for development and test env