hyper-component 1.0.alpha1 → 1.0.alpha1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/lib/hyperstack/component.rb +9 -4
- data/lib/hyperstack/component/version.rb +1 -1
- data/lib/hyperstack/internal/component.rb +0 -9
- data/lib/hyperstack/internal/component/class_methods.rb +12 -0
- data/lib/hyperstack/internal/component/tags.rb +0 -4
- 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: 913095570e036cd245e669fabf4ff0a7fcdf4e08acf5742d405ea701a3d9c1e8
|
4
|
+
data.tar.gz: 5518a5a4f50529f4972cd26cd1fcc24cc90311800ca1d7703e39b9a353988edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526f42bedbb8c7c16c6dda09a61795316aca083f4fdb6c468f0907c304debd94ccc6059c1c271b7140f94d274cef65310829b8f2b9e95727082cf8196975f166
|
7
|
+
data.tar.gz: 647b5d89b107e933e243eba3d584f1bb566be559b164d728312e10ba96080935286992ddf37c3d3056de763660911cf1bf754c150cbbaa4425f456125b39856b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../hyper-spec
|
3
3
|
specs:
|
4
|
-
hyper-spec (1.0.
|
4
|
+
hyper-spec (1.0.alpha1)
|
5
5
|
capybara
|
6
6
|
chromedriver-helper (= 1.2.0)
|
7
7
|
libv8 (~> 6.3.0)
|
@@ -20,22 +20,22 @@ PATH
|
|
20
20
|
PATH
|
21
21
|
remote: ../hyper-state
|
22
22
|
specs:
|
23
|
-
hyper-state (1.0.
|
24
|
-
hyperstack-config (= 1.0.
|
23
|
+
hyper-state (1.0.alpha1)
|
24
|
+
hyperstack-config (= 1.0.alpha1)
|
25
25
|
opal (>= 0.11.0, < 0.12.0)
|
26
26
|
|
27
27
|
PATH
|
28
28
|
remote: ../hyper-store
|
29
29
|
specs:
|
30
|
-
hyper-store (1.0.
|
31
|
-
hyper-state (= 1.0.
|
32
|
-
hyperstack-config (= 1.0.
|
30
|
+
hyper-store (1.0.alpha1)
|
31
|
+
hyper-state (= 1.0.alpha1)
|
32
|
+
hyperstack-config (= 1.0.alpha1)
|
33
33
|
opal (>= 0.11.0, < 0.12.0)
|
34
34
|
|
35
35
|
PATH
|
36
36
|
remote: ../hyperstack-config
|
37
37
|
specs:
|
38
|
-
hyperstack-config (1.0.
|
38
|
+
hyperstack-config (1.0.alpha1)
|
39
39
|
libv8 (~> 6.3.0)
|
40
40
|
listen (~> 3.0)
|
41
41
|
mini_racer (~> 0.1.15)
|
@@ -47,9 +47,9 @@ PATH
|
|
47
47
|
PATH
|
48
48
|
remote: .
|
49
49
|
specs:
|
50
|
-
hyper-component (1.0.
|
51
|
-
hyper-state (= 1.0.
|
52
|
-
hyperstack-config (= 1.0.
|
50
|
+
hyper-component (1.0.alpha1)
|
51
|
+
hyper-state (= 1.0.alpha1)
|
52
|
+
hyperstack-config (= 1.0.alpha1)
|
53
53
|
libv8 (~> 6.3.0)
|
54
54
|
mini_racer (~> 0.1.15)
|
55
55
|
opal (>= 0.11.0, < 0.12.0)
|
data/lib/hyperstack/component.rb
CHANGED
@@ -30,10 +30,15 @@ module Hyperstack
|
|
30
30
|
base.extend(Hyperstack::Internal::Component::ClassMethods)
|
31
31
|
end
|
32
32
|
|
33
|
+
def self.mounted_components
|
34
|
+
@__hyperstack_component_mounted_components ||= Set.new
|
35
|
+
end
|
36
|
+
|
33
37
|
def self.force_update!
|
34
|
-
components =
|
38
|
+
components = mounted_components.to_a # need a copy as force_update may change the list
|
35
39
|
components.each do |comp|
|
36
|
-
|
40
|
+
# check if its still mounted
|
41
|
+
next unless mounted_components.include? comp
|
37
42
|
comp.force_update!
|
38
43
|
end
|
39
44
|
end
|
@@ -62,7 +67,7 @@ module Hyperstack
|
|
62
67
|
@__hyperstack_component_params_wrapper = self.class.props_wrapper.new(self)
|
63
68
|
IsomorphicHelpers.load_context(true) if IsomorphicHelpers.on_opal_client?
|
64
69
|
observing(immediate_update: true) do
|
65
|
-
Hyperstack::
|
70
|
+
Hyperstack::Component.mounted_components << self
|
66
71
|
run_callback(:before_mount, props)
|
67
72
|
end
|
68
73
|
end
|
@@ -96,7 +101,7 @@ module Hyperstack
|
|
96
101
|
observing do
|
97
102
|
unmount # runs unmount callbacks as well
|
98
103
|
remove
|
99
|
-
Hyperstack::
|
104
|
+
Hyperstack::Component.mounted_components.delete self
|
100
105
|
end
|
101
106
|
end
|
102
107
|
|
@@ -4,6 +4,14 @@ module Hyperstack
|
|
4
4
|
# class level methods (macros) for components
|
5
5
|
module ClassMethods
|
6
6
|
|
7
|
+
def create_element(*params, &children)
|
8
|
+
ReactWrapper.create_element(self, *params, &children)
|
9
|
+
end
|
10
|
+
|
11
|
+
def insert_element(*params, &children)
|
12
|
+
RenderingContext.render(self, *params, &children)
|
13
|
+
end
|
14
|
+
|
7
15
|
def deprecation_warning(message)
|
8
16
|
Hyperstack.deprecation_warning(self, message)
|
9
17
|
end
|
@@ -12,6 +20,10 @@ module Hyperstack
|
|
12
20
|
true
|
13
21
|
end
|
14
22
|
|
23
|
+
def mounted_components
|
24
|
+
Hyperstack::Component.mounted_components.select { |c| c.class <= self }
|
25
|
+
end
|
26
|
+
|
15
27
|
def param_accessor_style(*args)
|
16
28
|
props_wrapper.param_accessor_style(*args)
|
17
29
|
end
|
@@ -59,10 +59,6 @@ module Hyperstack
|
|
59
59
|
define_method name do |*params, &children|
|
60
60
|
RenderingContext.render(component, *params, &children)
|
61
61
|
end
|
62
|
-
# handle deprecated _as_node style
|
63
|
-
define_method "#{name}_as_node" do |*params, &children|
|
64
|
-
RenderingContext.build_only(component, *params, &children)
|
65
|
-
end
|
66
62
|
end
|
67
63
|
parent.extend(tag_names_module)
|
68
64
|
end
|
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: 1.0.alpha1
|
4
|
+
version: 1.0.alpha1.1
|
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-11-
|
15
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: hyper-state
|
@@ -20,28 +20,28 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - '='
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.0.alpha1
|
23
|
+
version: 1.0.alpha1.1
|
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: 1.0.alpha1
|
30
|
+
version: 1.0.alpha1.1
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: hyperstack-config
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - '='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.0.alpha1
|
37
|
+
version: 1.0.alpha1.1
|
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: 1.0.alpha1
|
44
|
+
version: 1.0.alpha1.1
|
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: 1.0.alpha1
|
161
|
+
version: 1.0.alpha1.1
|
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: 1.0.alpha1
|
168
|
+
version: 1.0.alpha1.1
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: jquery-rails
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|