solid_objects 0.4.3 → 0.5.0
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/CHANGELOG.md +9 -0
- data/README.md +54 -7
- data/app/assets/javascripts/solid_objects/component_refresh.js +124 -0
- data/app/controllers/solid_objects/components_controller.rb +2 -7
- data/app/helpers/solid_objects/actor_helper.rb +8 -1
- data/docs/adr/0009-realtime-updates.md +18 -1
- data/docs/architecture.md +34 -18
- data/docs/authorization.md +24 -0
- data/docs/correctness.md +12 -4
- data/docs/realtime.md +78 -13
- data/docs/roadmap.md +6 -5
- data/examples/application/app/views/chat_rooms/show.html.erb +3 -1
- data/lib/solid_objects/actor_view.rb +40 -13
- data/lib/solid_objects/component_registration.rb +61 -16
- data/lib/solid_objects/component_renderer.rb +14 -17
- data/lib/solid_objects/component_subscriptions.rb +7 -7
- data/lib/solid_objects/component_token.rb +70 -2
- data/lib/solid_objects/dom_identity.rb +12 -3
- data/lib/solid_objects/engine.rb +7 -0
- data/lib/solid_objects/turbo_stream_renderer.rb +14 -5
- data/lib/solid_objects/version.rb +1 -1
- data/sig/generated/lib/solid_objects/actor_view.rbs +10 -4
- data/sig/generated/lib/solid_objects/component_registration.rbs +34 -10
- data/sig/generated/lib/solid_objects/component_renderer.rbs +4 -8
- data/sig/generated/lib/solid_objects/component_token.rbs +24 -2
- data/sig/generated/lib/solid_objects/dom_identity.rbs +5 -2
- data/sig/generated/lib/solid_objects/turbo_stream_renderer.rbs +3 -0
- metadata +2 -1
|
@@ -2,26 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
module SolidObjects
|
|
4
4
|
class ComponentRegistration
|
|
5
|
-
@
|
|
5
|
+
@token: String
|
|
6
6
|
|
|
7
|
-
@
|
|
7
|
+
@refresh_path: String
|
|
8
8
|
|
|
9
|
-
@
|
|
9
|
+
@revision: Integer
|
|
10
10
|
|
|
11
11
|
@instance_id: Integer
|
|
12
12
|
|
|
13
|
-
@
|
|
13
|
+
@refresh_method: String
|
|
14
14
|
|
|
15
|
-
@
|
|
15
|
+
@locals: Hash[String, untyped]
|
|
16
16
|
|
|
17
|
-
@
|
|
17
|
+
@dependencies: Array[String]
|
|
18
|
+
|
|
19
|
+
@component_key: String | Integer?
|
|
20
|
+
|
|
21
|
+
@component_name: String
|
|
22
|
+
|
|
23
|
+
@reference: Reference
|
|
18
24
|
|
|
19
25
|
attr_reader reference: untyped
|
|
20
26
|
|
|
21
27
|
attr_reader component_name: untyped
|
|
22
28
|
|
|
29
|
+
attr_reader component_key: untyped
|
|
30
|
+
|
|
23
31
|
attr_reader dependencies: untyped
|
|
24
32
|
|
|
33
|
+
attr_reader locals: untyped
|
|
34
|
+
|
|
35
|
+
attr_reader refresh_method: untyped
|
|
36
|
+
|
|
25
37
|
attr_reader instance_id: untyped
|
|
26
38
|
|
|
27
39
|
attr_reader revision: untyped
|
|
@@ -30,21 +42,33 @@ module SolidObjects
|
|
|
30
42
|
|
|
31
43
|
attr_reader token: untyped
|
|
32
44
|
|
|
33
|
-
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
34
|
-
def initialize: (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
45
|
+
# @rbs (reference: Reference, component_name: String, component_key: String | Integer?, dependencies: Array[String], locals: Hash[String, untyped], refresh_method: String, instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
46
|
+
def initialize: (reference: Reference, component_name: String, component_key: String | Integer?, dependencies: Array[String], locals: Hash[String, untyped], refresh_method: String, instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
35
47
|
|
|
36
|
-
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
37
|
-
def self.issue: (reference: Reference, component_name: String, dependencies: Array[String], snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
48
|
+
# @rbs (reference: Reference, component_name: String, component_key: untyped, dependencies: Array[String], locals: Hash[untyped, untyped], refresh_method: String | Symbol, snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
49
|
+
def self.issue: (reference: Reference, component_name: String, component_key: untyped, dependencies: Array[String], locals: Hash[untyped, untyped], refresh_method: String | Symbol, snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
38
50
|
|
|
39
51
|
# @rbs (String) -> ComponentRegistration
|
|
40
52
|
def self.from_token: (String) -> ComponentRegistration
|
|
41
53
|
|
|
54
|
+
# @rbs (Hash[String, untyped], token: String) -> ComponentRegistration
|
|
55
|
+
private def self.build: (Hash[String, untyped], token: String) -> ComponentRegistration
|
|
56
|
+
|
|
42
57
|
# @rbs (Reference, Array[String]) -> void
|
|
43
58
|
private def self.validate_dependencies!: (Reference, Array[String]) -> void
|
|
44
59
|
|
|
45
60
|
# @rbs () -> Array[Integer]
|
|
46
61
|
def revision_key: () -> Array[Integer]
|
|
47
62
|
|
|
63
|
+
# @rbs () -> String
|
|
64
|
+
def dom_id: () -> String
|
|
65
|
+
|
|
66
|
+
# @rbs () -> bool
|
|
67
|
+
def morph?: () -> bool
|
|
68
|
+
|
|
69
|
+
# @rbs () -> Hash[String, untyped]
|
|
70
|
+
def authorization_arguments: () -> Hash[String, untyped]
|
|
71
|
+
|
|
48
72
|
# @rbs (Integer, Integer) -> String
|
|
49
73
|
def refresh_url: (Integer, Integer) -> String
|
|
50
74
|
end
|
|
@@ -4,16 +4,14 @@ module SolidObjects
|
|
|
4
4
|
class ComponentRenderer
|
|
5
5
|
@snapshot: ActorSnapshot
|
|
6
6
|
|
|
7
|
-
@
|
|
8
|
-
|
|
9
|
-
@dependencies: Array[String]
|
|
7
|
+
@registration: ComponentRegistration
|
|
10
8
|
|
|
11
9
|
@view_context: untyped
|
|
12
10
|
|
|
13
11
|
@authorization_context: untyped
|
|
14
12
|
|
|
15
|
-
# @rbs (snapshot: ActorSnapshot,
|
|
16
|
-
def initialize: (snapshot: ActorSnapshot,
|
|
13
|
+
# @rbs (snapshot: ActorSnapshot, registration: ComponentRegistration, view_context: untyped, authorization_context: untyped) -> void
|
|
14
|
+
def initialize: (snapshot: ActorSnapshot, registration: ComponentRegistration, view_context: untyped, authorization_context: untyped) -> void
|
|
17
15
|
|
|
18
16
|
# @rbs () -> untyped
|
|
19
17
|
def call: () -> untyped
|
|
@@ -22,9 +20,7 @@ module SolidObjects
|
|
|
22
20
|
|
|
23
21
|
attr_reader snapshot: untyped
|
|
24
22
|
|
|
25
|
-
attr_reader
|
|
26
|
-
|
|
27
|
-
attr_reader dependencies: untyped
|
|
23
|
+
attr_reader registration: untyped
|
|
28
24
|
|
|
29
25
|
attr_reader view_context: untyped
|
|
30
26
|
|
|
@@ -8,8 +8,18 @@ module SolidObjects
|
|
|
8
8
|
|
|
9
9
|
MAXIMUM_DEPENDENCIES: ::Integer
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
MAXIMUM_LOCALS: ::Integer
|
|
12
|
+
|
|
13
|
+
MAXIMUM_COMPONENT_KEY_BYTES: ::Integer
|
|
14
|
+
|
|
15
|
+
REFRESH_METHODS: untyped
|
|
16
|
+
|
|
17
|
+
RESERVED_LOCALS: untyped
|
|
18
|
+
|
|
19
|
+
RUBY_KEYWORDS: untyped
|
|
20
|
+
|
|
21
|
+
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, ?component_key: untyped, ?locals: Hash[untyped, untyped], ?refresh_method: String | Symbol) -> String
|
|
22
|
+
def self?.generate: (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, ?component_key: untyped, ?locals: Hash[untyped, untyped], ?refresh_method: String | Symbol) -> String
|
|
13
23
|
|
|
14
24
|
# @rbs (String) -> Hash[String, untyped]
|
|
15
25
|
def self?.verify: (String) -> Hash[String, untyped]
|
|
@@ -17,12 +27,24 @@ module SolidObjects
|
|
|
17
27
|
# @rbs (Hash[String, untyped]) -> Hash[String, untyped]
|
|
18
28
|
def self?.validate_payload!: (Hash[String, untyped]) -> Hash[String, untyped]
|
|
19
29
|
|
|
30
|
+
# @rbs (Hash[String, untyped]?) -> void
|
|
31
|
+
def self?.apply_defaults!: (Hash[String, untyped]?) -> void
|
|
32
|
+
|
|
20
33
|
# @rbs (String) -> void
|
|
21
34
|
def self?.validate_component_name!: (String) -> void
|
|
22
35
|
|
|
36
|
+
# @rbs (untyped) -> void
|
|
37
|
+
def self?.validate_component_key!: (untyped) -> void
|
|
38
|
+
|
|
23
39
|
# @rbs (Array[untyped]) -> void
|
|
24
40
|
def self?.validate_dependencies!: (Array[untyped]) -> void
|
|
25
41
|
|
|
42
|
+
# @rbs (Hash[untyped, untyped]) -> void
|
|
43
|
+
def self?.validate_locals!: (Hash[untyped, untyped]) -> void
|
|
44
|
+
|
|
45
|
+
# @rbs (String) -> void
|
|
46
|
+
def self?.validate_refresh_method!: (String) -> void
|
|
47
|
+
|
|
26
48
|
# @rbs (Integer, Integer) -> void
|
|
27
49
|
def self?.validate_revision!: (Integer, Integer) -> void
|
|
28
50
|
|
|
@@ -8,13 +8,16 @@ module SolidObjects
|
|
|
8
8
|
# @rbs (Reference, Symbol | String) -> String
|
|
9
9
|
def self?.observable: (Reference, Symbol | String) -> String
|
|
10
10
|
|
|
11
|
-
# @rbs (Reference, Symbol | String) -> String
|
|
12
|
-
def self?.component: (Reference, Symbol | String) -> String
|
|
11
|
+
# @rbs (Reference, Symbol | String, ?key: String | Integer?) -> String
|
|
12
|
+
def self?.component: (Reference, Symbol | String, ?key: String | Integer?) -> String
|
|
13
13
|
|
|
14
14
|
# @rbs (Reference) -> String
|
|
15
15
|
def self?.identity_digest: (Reference) -> String
|
|
16
16
|
|
|
17
17
|
# @rbs (Symbol | String) -> String
|
|
18
18
|
def self?.normalized_name: (Symbol | String) -> String
|
|
19
|
+
|
|
20
|
+
# @rbs (String | Integer) -> String
|
|
21
|
+
def self?.component_key_digest: (String | Integer) -> String
|
|
19
22
|
end
|
|
20
23
|
end
|
|
@@ -20,5 +20,8 @@ module SolidObjects
|
|
|
20
20
|
|
|
21
21
|
# @rbs (untyped) -> String
|
|
22
22
|
def self?.display_value: (untyped) -> String
|
|
23
|
+
|
|
24
|
+
# @rbs (ComponentRegistration, Integer, Integer) -> String
|
|
25
|
+
def self?.morph_component_refresh: (ComponentRegistration, Integer, Integer) -> String
|
|
23
26
|
end
|
|
24
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solid_objects
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lucas Carlson
|
|
@@ -262,6 +262,7 @@ files:
|
|
|
262
262
|
- MIT-LICENSE
|
|
263
263
|
- README.md
|
|
264
264
|
- Rakefile
|
|
265
|
+
- app/assets/javascripts/solid_objects/component_refresh.js
|
|
265
266
|
- app/controllers/solid_objects/application_controller.rb
|
|
266
267
|
- app/controllers/solid_objects/components_controller.rb
|
|
267
268
|
- app/controllers/solid_objects/dead_letters_controller.rb
|