hyper-model 1.0.alpha1.1 → 1.0.alpha1.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 +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +11 -21
- data/hyper-model.gemspec +0 -1
- data/lib/hyper-model.rb +0 -1
- data/lib/hyper_model/version.rb +1 -1
- data/lib/reactive_record/active_record/errors.rb +2 -2
- data/lib/reactive_record/active_record/instance_methods.rb +1 -1
- data/lib/reactive_record/active_record/reactive_record/base.rb +6 -6
- data/lib/reactive_record/active_record/reactive_record/collection.rb +4 -4
- data/lib/reactive_record/active_record/reactive_record/getters.rb +1 -1
- data/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb +1 -1
- data/lib/reactive_record/active_record/reactive_record/setters.rb +4 -4
- data/lib/reactive_record/active_record/reactive_record/while_loading.rb +9 -9
- metadata +6 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87c3f5488b0d7290f9fd974234351fae079e3830db6e57e953b54f9063ae41ab
|
|
4
|
+
data.tar.gz: cfd1b544e23337620f978df7bb625503bfd2b6cdaa832f874e4dd94a15f02e34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e17c81b272167cd39b48b1c63fb7c451100966ede28e886ad2a8e0ddf328a961cb01dd63af6341fc166e8095fed23d0d13e98d589e873fd39d205168851e5cac
|
|
7
|
+
data.tar.gz: bb7a6021e96284469580667b58304e3aaa41ae3fdae4196f14123a09d44be53908dbf4ea0165d5edd903132f84a9f8d144629d6292eea55063681a814e8e908b
|
data/Gemfile
CHANGED
|
@@ -4,7 +4,6 @@ source 'https://rubygems.org'
|
|
|
4
4
|
#gem 'hyper-spec', path: '../hyper-spec'
|
|
5
5
|
gem 'hyperstack-config', path: '../hyperstack-config'
|
|
6
6
|
gem 'hyper-state', path: '../hyper-state'
|
|
7
|
-
gem 'hyper-store', path: '../hyper-store'
|
|
8
7
|
gem 'hyper-component', path: '../hyper-component'
|
|
9
8
|
gem 'hyper-operation', path: '../hyper-operation'
|
|
10
9
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ../hyper-component
|
|
3
3
|
specs:
|
|
4
|
-
hyper-component (0.1)
|
|
5
|
-
hyper-state (= 0.1)
|
|
6
|
-
hyperstack-config (= 0.1)
|
|
4
|
+
hyper-component (1.0.alpha1.1)
|
|
5
|
+
hyper-state (= 1.0.alpha1.1)
|
|
6
|
+
hyperstack-config (= 1.0.alpha1.1)
|
|
7
7
|
libv8 (~> 6.3.0)
|
|
8
8
|
mini_racer (~> 0.1.15)
|
|
9
9
|
opal (>= 0.11.0, < 0.12.0)
|
|
@@ -13,31 +13,23 @@ PATH
|
|
|
13
13
|
PATH
|
|
14
14
|
remote: ../hyper-operation
|
|
15
15
|
specs:
|
|
16
|
-
hyper-operation (0.1)
|
|
16
|
+
hyper-operation (1.0.alpha1.1)
|
|
17
17
|
activerecord (>= 4.0.0)
|
|
18
|
-
hyper-component (= 0.1)
|
|
18
|
+
hyper-component (= 1.0.alpha1.1)
|
|
19
19
|
mutations
|
|
20
20
|
opal-activesupport (~> 0.3.1)
|
|
21
21
|
|
|
22
22
|
PATH
|
|
23
23
|
remote: ../hyper-state
|
|
24
24
|
specs:
|
|
25
|
-
hyper-state (0.1)
|
|
26
|
-
hyperstack-config (= 0.1)
|
|
27
|
-
opal (>= 0.11.0, < 0.12.0)
|
|
28
|
-
|
|
29
|
-
PATH
|
|
30
|
-
remote: ../hyper-store
|
|
31
|
-
specs:
|
|
32
|
-
hyper-store (0.1)
|
|
33
|
-
hyper-state (= 0.1)
|
|
34
|
-
hyperstack-config (= 0.1)
|
|
25
|
+
hyper-state (1.0.alpha1.1)
|
|
26
|
+
hyperstack-config (= 1.0.alpha1.1)
|
|
35
27
|
opal (>= 0.11.0, < 0.12.0)
|
|
36
28
|
|
|
37
29
|
PATH
|
|
38
30
|
remote: ../hyperstack-config
|
|
39
31
|
specs:
|
|
40
|
-
hyperstack-config (0.1)
|
|
32
|
+
hyperstack-config (1.0.alpha1.1)
|
|
41
33
|
libv8 (~> 6.3.0)
|
|
42
34
|
listen (~> 3.0)
|
|
43
35
|
mini_racer (~> 0.1.15)
|
|
@@ -49,12 +41,11 @@ PATH
|
|
|
49
41
|
PATH
|
|
50
42
|
remote: .
|
|
51
43
|
specs:
|
|
52
|
-
hyper-model (0.1)
|
|
44
|
+
hyper-model (1.0.alpha1.1)
|
|
53
45
|
activemodel
|
|
54
46
|
activerecord (>= 4.0.0)
|
|
55
|
-
hyper-component (= 0.1)
|
|
56
|
-
hyper-operation (= 0.1)
|
|
57
|
-
hyper-store (= 0.1)
|
|
47
|
+
hyper-component (= 1.0.alpha1.1)
|
|
48
|
+
hyper-operation (= 1.0.alpha1.1)
|
|
58
49
|
|
|
59
50
|
GEM
|
|
60
51
|
remote: https://rubygems.org/
|
|
@@ -393,7 +384,6 @@ DEPENDENCIES
|
|
|
393
384
|
hyper-model!
|
|
394
385
|
hyper-operation!
|
|
395
386
|
hyper-state!
|
|
396
|
-
hyper-store!
|
|
397
387
|
hyperstack-config!
|
|
398
388
|
libv8 (~> 6.3.0)
|
|
399
389
|
mini_racer (~> 0.1.15)
|
data/hyper-model.gemspec
CHANGED
|
@@ -29,7 +29,6 @@ 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
|
|
33
32
|
spec.add_development_dependency 'bundler'
|
|
34
33
|
spec.add_development_dependency 'capybara'
|
|
35
34
|
spec.add_development_dependency 'chromedriver-helper', '1.2.0'
|
data/lib/hyper-model.rb
CHANGED
|
@@ -10,7 +10,6 @@ if RUBY_ENGINE == 'opal'
|
|
|
10
10
|
require 'object/tap'
|
|
11
11
|
require 'active_model_client_stubs'
|
|
12
12
|
require 'hyper-state'
|
|
13
|
-
require 'hyper-store'
|
|
14
13
|
require "reactive_record/active_record_error"
|
|
15
14
|
require "reactive_record/active_record/errors"
|
|
16
15
|
require "reactive_record/active_record/error"
|
data/lib/hyper_model/version.rb
CHANGED
|
@@ -210,7 +210,7 @@ module ActiveModel
|
|
|
210
210
|
alias :blank? :empty?
|
|
211
211
|
|
|
212
212
|
def reactive_empty?
|
|
213
|
-
Hyperstack::Internal::
|
|
213
|
+
Hyperstack::Internal::State::Variable.get(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
|
-
Hyperstack::Internal::
|
|
371
|
+
Hyperstack::Internal::State::Variable.set(self, 'ERRORS?', state) unless ReactiveRecord::Base.data_loading?
|
|
372
372
|
end
|
|
373
373
|
end
|
|
374
374
|
end
|
|
@@ -180,10 +180,10 @@ module ReactiveRecord
|
|
|
180
180
|
|
|
181
181
|
def changed?(*args)
|
|
182
182
|
if args.count == 0
|
|
183
|
-
Hyperstack::Internal::
|
|
183
|
+
Hyperstack::Internal::State::Variable.get(self, "!CHANGED!")
|
|
184
184
|
!changed_attributes.empty?
|
|
185
185
|
else
|
|
186
|
-
Hyperstack::Internal::
|
|
186
|
+
Hyperstack::Internal::State::Variable.get(self, args[0])
|
|
187
187
|
changed_attributes.include? args[0]
|
|
188
188
|
end
|
|
189
189
|
end
|
|
@@ -288,7 +288,7 @@ module ReactiveRecord
|
|
|
288
288
|
end
|
|
289
289
|
|
|
290
290
|
def saving!
|
|
291
|
-
Hyperstack::Internal::
|
|
291
|
+
Hyperstack::Internal::State::Variable.set(self, self, :saving) unless data_loading?
|
|
292
292
|
@saving = true
|
|
293
293
|
end
|
|
294
294
|
|
|
@@ -306,9 +306,9 @@ module ReactiveRecord
|
|
|
306
306
|
notify_waiting_for_save
|
|
307
307
|
return self if save_only
|
|
308
308
|
if errors.empty?
|
|
309
|
-
Hyperstack::Internal::
|
|
309
|
+
Hyperstack::Internal::State::Variable.set(self, self, :saved)
|
|
310
310
|
elsif !data_loading?
|
|
311
|
-
Hyperstack::Internal::
|
|
311
|
+
Hyperstack::Internal::State::Variable.set(self, self, :error)
|
|
312
312
|
end
|
|
313
313
|
self
|
|
314
314
|
end
|
|
@@ -334,7 +334,7 @@ module ReactiveRecord
|
|
|
334
334
|
end
|
|
335
335
|
|
|
336
336
|
def saving?
|
|
337
|
-
Hyperstack::Internal::
|
|
337
|
+
Hyperstack::Internal::State::Variable.get(self, self)
|
|
338
338
|
@saving
|
|
339
339
|
end
|
|
340
340
|
|
|
@@ -292,7 +292,7 @@ To determine this sync_scopes first asks if the record being changed is in the s
|
|
|
292
292
|
# end of stuff to move
|
|
293
293
|
|
|
294
294
|
def reload_from_db(force = nil)
|
|
295
|
-
if force || Hyperstack::Internal::
|
|
295
|
+
if force || Hyperstack::Internal::State::Variable.observed?(self, :collection)
|
|
296
296
|
@out_of_date = false
|
|
297
297
|
ReactiveRecord::Base.load_from_db(nil, *@vector, '*all') if @collection
|
|
298
298
|
ReactiveRecord::Base.load_from_db(nil, *@vector, '*count')
|
|
@@ -308,7 +308,7 @@ To determine this sync_scopes first asks if the record being changed is in the s
|
|
|
308
308
|
@observing = true
|
|
309
309
|
link_to_parent
|
|
310
310
|
reload_from_db(true) if @out_of_date
|
|
311
|
-
Hyperstack::Internal::
|
|
311
|
+
Hyperstack::Internal::State::Variable.get(self, :collection)
|
|
312
312
|
ensure
|
|
313
313
|
@observing = false
|
|
314
314
|
end
|
|
@@ -316,7 +316,7 @@ To determine this sync_scopes first asks if the record being changed is in the s
|
|
|
316
316
|
|
|
317
317
|
def set_count_state(val)
|
|
318
318
|
unless ReactiveRecord::WhileLoading.observed?
|
|
319
|
-
Hyperstack::Internal::
|
|
319
|
+
Hyperstack::Internal::State::Variable.set(self, :collection, collection, true)
|
|
320
320
|
end
|
|
321
321
|
@count = val
|
|
322
322
|
end
|
|
@@ -549,7 +549,7 @@ To determine this sync_scopes first asks if the record being changed is in the s
|
|
|
549
549
|
end
|
|
550
550
|
|
|
551
551
|
def notify_of_change(value = nil)
|
|
552
|
-
Hyperstack::Internal::
|
|
552
|
+
Hyperstack::Internal::State::Variable.set(self, "collection", collection) unless ReactiveRecord::Base.data_loading?
|
|
553
553
|
value
|
|
554
554
|
end
|
|
555
555
|
|
|
@@ -99,7 +99,7 @@ module ReactiveRecord
|
|
|
99
99
|
else
|
|
100
100
|
virtual_fetch_on_server_warning(attribute) if on_opal_server? && changed?
|
|
101
101
|
yield false, attribute
|
|
102
|
-
end.tap { |value| Hyperstack::Internal::
|
|
102
|
+
end.tap { |value| Hyperstack::Internal::State::Variable.get(self, attribute) unless data_loading? }
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def find_association(association, id)
|
|
@@ -132,7 +132,7 @@ module ReactiveRecord
|
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def self.schedule_fetch
|
|
135
|
-
Hyperstack::Internal::
|
|
135
|
+
Hyperstack::Internal::State::Variable.set(WhileLoading, :quiet, false) # moved from while loading module see loading! method
|
|
136
136
|
return if @fetch_scheduled
|
|
137
137
|
@current_fetch_id = Time.now
|
|
138
138
|
@fetch_scheduled = after(0) do
|
|
@@ -92,7 +92,7 @@ module ReactiveRecord
|
|
|
92
92
|
@attributes[attr] = new_value
|
|
93
93
|
if !data_loading? ||
|
|
94
94
|
(on_opal_client? && had_key && current_value.loaded? && current_value != new_value)
|
|
95
|
-
Hyperstack::Internal::
|
|
95
|
+
Hyperstack::Internal::State::Variable.set(self, attr, new_value, data_loading?)
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
98
|
end
|
|
@@ -101,7 +101,7 @@ module ReactiveRecord
|
|
|
101
101
|
def set_change_status_and_notify_only(attr, changed)
|
|
102
102
|
return if @virgin
|
|
103
103
|
change_status_and_notify_helper(attr, changed) do
|
|
104
|
-
Hyperstack::Internal::
|
|
104
|
+
Hyperstack::Internal::State::Variable.set(self, attr, nil) unless data_loading?
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
@@ -117,7 +117,7 @@ module ReactiveRecord
|
|
|
117
117
|
yield @attributes.key?(attr), @attributes[attr]
|
|
118
118
|
return unless empty_before != changed_attributes.empty?
|
|
119
119
|
if on_opal_client? && !data_loading?
|
|
120
|
-
Hyperstack::Internal::
|
|
120
|
+
Hyperstack::Internal::State::Variable.set(self, '!CHANGED!', !changed_attributes.empty?, true)
|
|
121
121
|
end
|
|
122
122
|
return unless aggregate_owner
|
|
123
123
|
aggregate_owner.set_change_status_and_notify_only(
|
|
@@ -135,7 +135,7 @@ module ReactiveRecord
|
|
|
135
135
|
return if value.nil?
|
|
136
136
|
value.attributes[inverse_attr] = @ar_instance
|
|
137
137
|
return if data_loading?
|
|
138
|
-
Hyperstack::Internal::
|
|
138
|
+
Hyperstack::Internal::State::Variable.set(value.backing_record, inverse_attr, @ar_instance)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
def update_inverse_collections(association, value)
|
|
@@ -92,7 +92,7 @@ module ReactiveRecord
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
def self.has_observers?
|
|
95
|
-
Hyperstack::Internal::
|
|
95
|
+
Hyperstack::Internal::State::Variable.observed?(self, :loaded_at)
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
class << self
|
|
@@ -126,28 +126,28 @@ module ReactiveRecord
|
|
|
126
126
|
|
|
127
127
|
def loading!
|
|
128
128
|
Hyperstack::Internal::Component::RenderingContext.waiting_on_resources = true
|
|
129
|
-
Hyperstack::Internal::
|
|
129
|
+
Hyperstack::Internal::State::Variable.get(self, :loaded_at)
|
|
130
130
|
# this was moved to where the fetch is actually pushed on to the fetch array in isomorphic base
|
|
131
|
-
# Hyperstack::Internal::
|
|
131
|
+
# Hyperstack::Internal::State::Variable.set(self, :quiet, false)
|
|
132
132
|
@is_loading = true
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def loaded_at(loaded_at)
|
|
136
|
-
Hyperstack::Internal::
|
|
136
|
+
Hyperstack::Internal::State::Variable.set(self, :loaded_at, loaded_at)
|
|
137
137
|
@is_loading = false
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
def quiet?
|
|
141
|
-
Hyperstack::Internal::
|
|
141
|
+
Hyperstack::Internal::State::Variable.get(self, :quiet)
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
def page_loaded?
|
|
145
|
-
Hyperstack::Internal::
|
|
145
|
+
Hyperstack::Internal::State::Variable.get(self, :page_loaded)
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
def quiet!
|
|
149
|
-
Hyperstack::Internal::
|
|
150
|
-
after(1) { Hyperstack::Internal::
|
|
149
|
+
Hyperstack::Internal::State::Variable.set(self, :quiet, true)
|
|
150
|
+
after(1) { Hyperstack::Internal::State::Variable.set(self, :page_loaded, true) } unless on_opal_server? or @page_loaded
|
|
151
151
|
@page_loaded = true
|
|
152
152
|
end
|
|
153
153
|
|
|
@@ -204,7 +204,7 @@ module ReactiveRecord
|
|
|
204
204
|
@waiting_on_resources = @Loading
|
|
205
205
|
end
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
render do
|
|
208
208
|
props = @ElementProps.dup
|
|
209
209
|
classes = [props[:class], props[:className], "reactive_record_while_loading_container_#{@uniq_id}"].compact.join(" ")
|
|
210
210
|
props.merge!({
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hyper-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.alpha1.
|
|
4
|
+
version: 1.0.alpha1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mitch VanDuyn
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-11-
|
|
12
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activemodel
|
|
@@ -45,42 +45,28 @@ dependencies:
|
|
|
45
45
|
requirements:
|
|
46
46
|
- - '='
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: 1.0.alpha1.
|
|
48
|
+
version: 1.0.alpha1.2
|
|
49
49
|
type: :runtime
|
|
50
50
|
prerelease: false
|
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
53
|
- - '='
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 1.0.alpha1.
|
|
55
|
+
version: 1.0.alpha1.2
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
57
|
name: hyper-operation
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
60
|
- - '='
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 1.0.alpha1.
|
|
62
|
+
version: 1.0.alpha1.2
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
67
|
- - '='
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 1.0.alpha1.
|
|
70
|
-
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: hyper-store
|
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - '='
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: 1.0.alpha1.1
|
|
77
|
-
type: :runtime
|
|
78
|
-
prerelease: false
|
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
-
requirements:
|
|
81
|
-
- - '='
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: 1.0.alpha1.1
|
|
69
|
+
version: 1.0.alpha1.2
|
|
84
70
|
- !ruby/object:Gem::Dependency
|
|
85
71
|
name: bundler
|
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|