svelte-on-rails 22.5.3 → 22.5.5

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: 956d441cb147f816e089c8d524941dbce2fea72cdb90917054d3e01af43fdd04
4
- data.tar.gz: bca954afa4a9a82b211ee76636abbef038dd2a7ae2bd951df82644a460515bd6
3
+ metadata.gz: b68077cf4a1661381ad07003c4b4bb08f837c5c7c25715e766c417aed5ef00e1
4
+ data.tar.gz: 93f86527e6be4a76d1bcbb0ecc45c9116bcb38442ad19318aca269b446c4ed68
5
5
  SHA512:
6
- metadata.gz: 9caf26fece953877f1fe2dcf82592553d391732acdeb0775e9d0f520a739758c561b5b454bb51c109a75a8abfb87aab1cc1711aed8e72a4917a98d2544bf0ec1
7
- data.tar.gz: f8a37fd78306cb4755813c7ce783e97c77be4833894b2b226783077c36fa694136459cca27e4755243fe03c372dd919bf7d3a2cf9805fd7e43392f3439a395c6
6
+ metadata.gz: 7120ba8595db223b52a9ca2be209ea927fced27d2dfc8844cbe2dfdf962d8e4e030432dfc3d9535eb801685c35ef08dce5b357c56e8f74105ffbebd1ba1cc667
7
+ data.tar.gz: c60db572d6ab9c5407577fc6369393602a22a2f8c60905c2650385dd2b38c9f3c97cee0ca1300c98409e67af68d0af863b7797e4e1dfb76ddf3672c44e85ee01
@@ -43,7 +43,7 @@ module SvelteOnRails
43
43
  # DEFAULTS
44
44
 
45
45
  rd = @configs[:redis_cache_store] && @configs[:redis_cache_store][:namespace]
46
- @redis_namespace ||= "#{rd || app_name}:svelte-on-rails:#{Rails.env rescue 'no-env'}"
46
+ @redis_namespace ||= "#{rd || app_name}:svelte-on-rails:#{Rails.env rescue 'no-env'}:"
47
47
  @configs[:skip_ssr_header] ||= 'X-Turbo-Request-ID'
48
48
  if defined? Redis
49
49
  @redis_instance = Redis.new(url: redis_cache_store[:url])
@@ -344,10 +344,11 @@ module SvelteOnRails
344
344
  fingerprint = (@conf.watch_changes? ? @conf.fingerprint(component_paths[:path], debug?, component_paths[:name]) : '')
345
345
 
346
346
  cache_key_raw = @options.to_s +
347
- @cached_props.to_s + fingerprint + @options[:cache_key].to_s +
348
- (@cached_props.key?(:_uncached) ? "" : @html_options.to_s)
347
+ @cached_props.to_s +
348
+ fingerprint +
349
+ @html_options.to_s
349
350
 
350
- "#{@conf.redis_namespace}:#{@component_name.gsub('/','-')}:#{Digest::XXH64.hexdigest(cache_key_raw)}"
351
+ "#{@conf.redis_namespace}#{@component_name.gsub('/','-')}:#{Digest::XXH64.hexdigest(cache_key_raw)}"
351
352
  end
352
353
  end
353
354
 
@@ -33,7 +33,7 @@ module SvelteOnRails
33
33
  @socket_namespace = [
34
34
  "svelte",
35
35
  Rails.application.class.module_parent_name[0..15],
36
- SsrClientControlChannel.short_env
36
+ Rails.env
37
37
  ].join("-")
38
38
  @socket_path = socket_path_fresh
39
39
 
@@ -453,13 +453,13 @@ module SvelteOnRails
453
453
  # Sits next to the SSR socket in tmp/sockets, or in the /tmp/svelte
454
454
  # fallback directory when Rails.root pushes total length over 103 chars.
455
455
  def self.socket_path
456
- primary = Rails.root.join("tmp", "sockets", "svelte-ctl-#{short_env}.sock")
456
+ primary = Rails.root.join("tmp", "sockets", "svelte-ctl-#{Rails.env}.sock")
457
457
  if primary.to_s.length <= 103
458
458
  FileUtils.mkdir_p(File.dirname(primary))
459
459
  return primary
460
460
  end
461
461
 
462
- Pathname.new("/tmp/svelte-#{short_env}-ctl-#{Digest::XXH64.hexdigest(Rails.root.to_s)}.sock")
462
+ Pathname.new("/tmp/svelte-#{Rails.env}-ctl-#{Digest::XXH64.hexdigest(Rails.root.to_s)}.sock")
463
463
  end
464
464
 
465
465
  # enable communication by rake task for admin purposes
@@ -527,20 +527,6 @@ module SvelteOnRails
527
527
 
528
528
  end
529
529
 
530
- def self.short_env
531
-
532
- name = Rails.env.to_s
533
-
534
- short = {
535
- "development" => "dev",
536
- "production" => "prod",
537
- "staging" => "stage",
538
- }[name]
539
-
540
- return name unless short
541
- return name if Rails.root.join("config", "environments", "#{short}.rb").exist?
542
- short
543
- end
544
530
  end
545
531
 
546
532
  class SsrError < StandardError; end
@@ -13,7 +13,7 @@ namespace :svelte_on_rails do
13
13
  end
14
14
 
15
15
  if Rails.env.production? && ENV["FORCE"] != "1"
16
- print "You are about to delete all keys matching «#{namespace}:*» in PRODUCTION. Continue? (y/N) "
16
+ print "You are about to delete all keys matching «#{namespace} in PRODUCTION. Continue? (y/N) "
17
17
  answer = STDIN.gets.to_s.strip.downcase
18
18
  unless %w[y yes].include?(answer)
19
19
  puts "Aborted."
@@ -21,7 +21,7 @@ namespace :svelte_on_rails do
21
21
  end
22
22
  end
23
23
 
24
- pattern = "#{namespace}:*"
24
+ pattern = "#{namespace}*"
25
25
  cursor = "0"
26
26
  total_deleted = 0
27
27
  batches = 0
@@ -60,7 +60,7 @@ namespace :svelte_on_rails do
60
60
  next
61
61
  end
62
62
 
63
- pattern = "#{namespace}:*"
63
+ pattern = "#{namespace}*"
64
64
 
65
65
  puts "Scanning Redis for keys matching «#{pattern}» ..."
66
66
 
@@ -70,7 +70,7 @@ namespace :svelte_on_rails do
70
70
 
71
71
  namespace :ssr_client do
72
72
 
73
- desc 'For development: to simulate when a client did not start on deploy (Then, on the first request of a svelte component - if not cached! - it must start)'
73
+ desc 'For development(and only ONE WORKER! for multiple puma workers it doesnt work!): to simulate when a client did not start on deploy (Then, on the first request of a svelte component - if not cached! - it must start)'
74
74
  task :stop do
75
75
  r = get_from_ssr_client(:stop)
76
76
  if r['success']
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: 22.5.3
4
+ version: 22.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair