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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1f88eabc25731d42365b5a8e6b43cddb76992b5d6d126d78dee47990f67d307
4
- data.tar.gz: e78b9765b3fbcaececd9488d5903e8b800eaa07162ce1afb8c3c8035d0bc3526
3
+ metadata.gz: bbfef55187ded48122ababd40f3f87e911882077daaace78583ce7e308d0b232
4
+ data.tar.gz: b36efc7ebd3b2c141f9d2c47aced3c3d1aab549f35529e4796844bd801f7426f
5
5
  SHA512:
6
- metadata.gz: 3c661de9d38304e296adfb290c26e665e7de5ec8058438dd4752b3c174e7cbf3125afa81b2c01e631ec95284d7dbf9e8f602f845b763e0c99f87c1334bdd03a6
7
- data.tar.gz: f555b5a6262cb6f013c9494c51d32688d7ba74a0f6ebfaaa3addea7ea44282f26f05e32903bce0f11f4d5f2326603a886f7771fb20935d290044b759dee3d92a
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 :filename, :options, :html_options, :request, :conf
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: «#{filename}», cache_key: «#{custom_cache_key}»")
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 #{filename}.svelte from cache"
136
+ log_message = "Returned #{@component_paths[:vite_path]} from cache"
137
137
  cached_content.html_safe
138
138
  else
139
- log_message = "Rendered #{filename}.svelte and stored to cache"
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 #{filename}.svelte #{'as empty element that will be mounted on the client side' unless ssr?}")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svelte-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.1
4
+ version: 10.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair