Module: Isomorfeus
- Defined in:
- lib/isomorfeus/config.rb,
lib/isomorfeus/top_level.rb,
lib/isomorfeus/top_level_ssr.rb,
lib/isomorfeus/vivify_module.rb,
lib/isomorfeus/props/validator.rb,
lib/isomorfeus/react_view_helper.rb,
lib/isomorfeus/thread_local_cache.rb,
lib/isomorfeus/props/validate_hash_proxy.rb
Defined Under Namespace
Modules: Props, ReactViewHelper
Classes: ThreadLocalCache, TopLevel, VivifyModule
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.component_cache_class ⇒ Object
Returns the value of attribute component_cache_class.
111
112
113
|
# File 'lib/isomorfeus/config.rb', line 111
def component_cache_class
@component_cache_class
end
|
Returns the value of attribute env.
8
9
10
|
# File 'lib/isomorfeus/config.rb', line 8
def env
@env
end
|
.initial_state_fetched ⇒ Object
Returns the value of attribute initial_state_fetched.
4
5
6
|
# File 'lib/isomorfeus/config.rb', line 4
def initial_state_fetched
@initial_state_fetched
end
|
.initialized ⇒ Object
Returns the value of attribute initialized.
7
8
9
|
# File 'lib/isomorfeus/config.rb', line 7
def initialized
@initialized
end
|
.server_side_rendering ⇒ Object
Returns the value of attribute server_side_rendering.
112
113
114
|
# File 'lib/isomorfeus/config.rb', line 112
def server_side_rendering
@server_side_rendering
end
|
.ssr_hot_asset_url ⇒ Object
Returns the value of attribute ssr_hot_asset_url.
113
114
115
|
# File 'lib/isomorfeus/config.rb', line 113
def ssr_hot_asset_url
@ssr_hot_asset_url
end
|
.ssr_response_status ⇒ Object
Returns the value of attribute ssr_response_status.
6
7
8
|
# File 'lib/isomorfeus/config.rb', line 6
def ssr_response_status
@ssr_response_status
end
|
.top_component ⇒ Object
Returns the value of attribute top_component.
5
6
7
|
# File 'lib/isomorfeus/config.rb', line 5
def top_component
@top_component
end
|
Returns the value of attribute zeitwerk.
9
10
11
|
# File 'lib/isomorfeus/config.rb', line 9
def zeitwerk
@zeitwerk
end
|
.zeitwerk_lock ⇒ Object
Returns the value of attribute zeitwerk_lock.
116
117
118
|
# File 'lib/isomorfeus/config.rb', line 116
def zeitwerk_lock
@zeitwerk_lock
end
|
Class Method Details
.add_client_init_after_store_class_name(init_class_name) ⇒ Object
31
32
33
|
# File 'lib/isomorfeus/config.rb', line 31
def add_client_init_after_store_class_name(init_class_name)
client_init_after_store_class_names << init_class_name
end
|
.add_client_init_class_name(init_class_name) ⇒ Object
27
28
29
|
# File 'lib/isomorfeus/config.rb', line 27
def add_client_init_class_name(init_class_name)
client_init_class_names << init_class_name
end
|
.add_client_option(key, value = nil) ⇒ Object
35
36
37
38
|
# File 'lib/isomorfeus/config.rb', line 35
def add_client_option(key, value = nil)
self.class.attr_accessor(key)
self.send("#{key}=", value)
end
|
.cached_component_class(class_name) ⇒ Object
46
47
48
49
|
# File 'lib/isomorfeus/config.rb', line 46
def cached_component_class(class_name)
return cached_component_classes[class_name] if cached_component_classes.key?(class_name)
cached_component_classes[class_name] = "::#{class_name}".constantize
end
|
.cached_component_classes ⇒ Object
41
42
43
|
# File 'lib/isomorfeus/config.rb', line 41
def cached_component_classes
@cached_component_classes ||= {}
end
|
.configuration(&block) ⇒ Object
118
119
120
|
# File 'lib/isomorfeus/config.rb', line 118
def configuration(&block)
block.call(self)
end
|
.development? ⇒ Boolean
70
71
72
|
# File 'lib/isomorfeus/config.rb', line 70
def development?
@development
end
|
.execute_init_after_store_classes ⇒ Object
57
58
59
60
61
|
# File 'lib/isomorfeus/config.rb', line 57
def execute_init_after_store_classes
client_init_after_store_class_names.each do |constant|
constant.constantize.send(:init)
end
end
|
.execute_init_classes ⇒ Object
51
52
53
54
55
|
# File 'lib/isomorfeus/config.rb', line 51
def execute_init_classes
client_init_class_names.each do |constant|
constant.constantize.send(:init)
end
end
|
11
12
13
14
15
16
|
# File 'lib/isomorfeus/config.rb', line 11
def init
return if initialized
@initialized = true
Isomorfeus.init_store
execute_init_classes
end
|
.production? ⇒ Boolean
74
75
76
|
# File 'lib/isomorfeus/config.rb', line 74
def production?
@production
end
|
.raise_error(error_class: nil, message: nil, stack: nil) ⇒ Object
152
153
154
155
156
157
158
159
160
161
|
# File 'lib/isomorfeus/config.rb', line 152
def raise_error(error_class: nil, message: nil, stack: nil)
error_class = RuntimeError unless error_class
execution_environment = if on_browser? then 'on Browser'
elsif on_ssr? then 'in Server Side Rendering'
elsif on_server? then 'on Server'
end
error = error_class.new("Isomorfeus in #{env} #{execution_environment}:\n#{message}")
error.set_backtrace(stack) if stack
raise error
end
|
.ssr_contexts ⇒ Object
141
142
143
|
# File 'lib/isomorfeus/config.rb', line 141
def ssr_contexts
@ssr_contexts ||= {}
end
|
.test? ⇒ Boolean
78
79
80
|
# File 'lib/isomorfeus/config.rb', line 78
def test?
@test
end
|
145
146
147
|
# File 'lib/isomorfeus/config.rb', line 145
def version
Isomorfeus::VERSION
end
|