svelte-on-rails 10.1.1 → 10.2.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/lib/svelte_on_rails/lib/view_helper_support.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbfef55187ded48122ababd40f3f87e911882077daaace78583ce7e308d0b232
|
|
4
|
+
data.tar.gz: b36efc7ebd3b2c141f9d2c47aced3c3d1aab549f35529e4796844bd801f7426f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d25dbeb163b46a00ba1f46a3fcdee9e26ebfe65b8b8c3fb15d51f9d98f5496b6847e10319b8de79c13528c0b420224276fa2ea953e790ead924b6a5034b3ccd
|
|
7
|
+
data.tar.gz: 7d14354731df40b416e3936a0df285a81b5924852aa7318b9f1ce3a11b4c5a92ca89465462e2bfabc0cd9dee9fa92201352da76374227389c3557d1c73176642
|
|
@@ -5,7 +5,7 @@ module SvelteOnRails
|
|
|
5
5
|
class ViewHelperSupport
|
|
6
6
|
|
|
7
7
|
RENDER_OPTIONS = %i[ssr hydrate debug cache_key expires_in]
|
|
8
|
-
attr_reader :
|
|
8
|
+
attr_reader :options, :html_options, :request, :conf
|
|
9
9
|
|
|
10
10
|
def initialize(component, props, html_options, options, request, ctrl_path, caching = false)
|
|
11
11
|
|
|
@@ -105,7 +105,7 @@ module SvelteOnRails
|
|
|
105
105
|
|
|
106
106
|
if debug?
|
|
107
107
|
|
|
108
|
-
debug_log("Rendering component: «#{
|
|
108
|
+
debug_log("Rendering component: «#{@component_paths[:vite_path]}», cache_key: «#{custom_cache_key}»")
|
|
109
109
|
debug_log("Redis configuration: #{conf.redis_cache_store}")
|
|
110
110
|
ttl = conf.redis_instance.ttl(cache_key)
|
|
111
111
|
|
|
@@ -133,10 +133,10 @@ module SvelteOnRails
|
|
|
133
133
|
|
|
134
134
|
log_message = '?'
|
|
135
135
|
res = if cached_content
|
|
136
|
-
log_message = "Returned #{
|
|
136
|
+
log_message = "Returned #{@component_paths[:vite_path]} from cache"
|
|
137
137
|
cached_content.html_safe
|
|
138
138
|
else
|
|
139
|
-
log_message = "Rendered #{
|
|
139
|
+
log_message = "Rendered #{@component_paths[:vite_path]} and stored to cache"
|
|
140
140
|
debug_log("cache recalculating for key: #{cache_key}")
|
|
141
141
|
r = view_context.instance_eval(&block)
|
|
142
142
|
debug_log("cache recalculated")
|
|
@@ -156,7 +156,7 @@ module SvelteOnRails
|
|
|
156
156
|
|
|
157
157
|
r = view_context.instance_eval(&block)
|
|
158
158
|
|
|
159
|
-
log_rendering("Rendered #{
|
|
159
|
+
log_rendering("Rendered #{@component_paths[:component]} #{'as empty element that will be mounted on the client side' unless ssr?}")
|
|
160
160
|
|
|
161
161
|
r
|
|
162
162
|
end
|
|
@@ -191,7 +191,7 @@ module SvelteOnRails
|
|
|
191
191
|
].join(':')
|
|
192
192
|
|
|
193
193
|
last_part = [
|
|
194
|
-
(@conf.watch_changes? ? Zlib.crc32(@conf.min_output_mtime_ms.to_s + File.mtime(@component_paths[:path]).to_s).to_s(36) : nil),
|
|
194
|
+
(@conf.watch_changes? ? Zlib.crc32(@conf.min_output_mtime_ms.to_s + File.mtime(conf.rails_root.join(@component_paths[:path])).to_s).to_s(36) : nil),
|
|
195
195
|
@args_checksum
|
|
196
196
|
].compact.join('-')
|
|
197
197
|
|