svelte-on-rails 14.1.2 → 14.1.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 362d90c83be458eb5b0de1f3e0af8e167bd04d9c3996cc304f4ac6e6482a13f8
|
|
4
|
+
data.tar.gz: a712ca7b9a3a155fdafb5212953885ffa5f1c94584ab4fa8ade8e4b7286a56d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a0904df9baaee0ca239748b2966e3305d545655cee9e701d3f16711a44d5f34521a809fbab913fc246efcb88b2d1397413bdfaae8b3b984b7f65f8ceca2969f
|
|
7
|
+
data.tar.gz: 49f01bce709786b50c829846eb346bf2d4a539640c635d8edbf124f6537f090ee2596288c6a88d9de8c5ee2329e66cf29f1c5cc12f7bca6ca16a628b09c1d3cf
|
|
@@ -10,7 +10,7 @@ module SvelteOnRails
|
|
|
10
10
|
@instance ||= new
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
attr_accessor :configs, :redis_namespace, :request_metrics
|
|
13
|
+
attr_accessor :configs, :redis_namespace, :request_metrics, :component_paths_cache
|
|
14
14
|
|
|
15
15
|
def labels_cache(model, attributes, associations, value = nil)
|
|
16
16
|
attr_str = attributes.to_s + associations.to_s
|
|
@@ -31,6 +31,8 @@ module SvelteOnRails
|
|
|
31
31
|
@boot_key = SecureRandom.hex(3) # currently not used, more for debugging purposes
|
|
32
32
|
@configs = redis_cache_store_configs
|
|
33
33
|
|
|
34
|
+
@component_paths_cache = {}
|
|
35
|
+
|
|
34
36
|
return unless defined?(Rails.root)
|
|
35
37
|
|
|
36
38
|
config_path = Rails.root.join("config", "svelte_on_rails.yml")
|
|
@@ -56,7 +56,9 @@ module SvelteOnRails
|
|
|
56
56
|
elsif cnf[:default_components_root].to_s.match(/^app\/views/)
|
|
57
57
|
attempts = [
|
|
58
58
|
File.join('app', 'views', dir, "_#{file_basename}" + '.svelte'),
|
|
59
|
+
File.join('app', 'views', dir, file_basename + '.svelte'),
|
|
59
60
|
File.join('app', 'views', current_controller_path, dir, "_#{file_basename}" + '.svelte'),
|
|
61
|
+
File.join('app', 'views', current_controller_path, dir, file_basename + '.svelte'),
|
|
60
62
|
]
|
|
61
63
|
|
|
62
64
|
attempts.find { |f| File.exist? Rails.root.join(f) }
|
|
@@ -43,7 +43,12 @@ module SvelteOnRails
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def component_paths
|
|
46
|
-
|
|
46
|
+
if @conf.watch_changes?
|
|
47
|
+
@component_paths ||= @utils.component_paths(@component_name, @controller_path)
|
|
48
|
+
else
|
|
49
|
+
@conf.component_paths_cache[@component_name] ||= @utils.component_paths(@component_name, @controller_path)
|
|
50
|
+
end
|
|
51
|
+
|
|
47
52
|
end
|
|
48
53
|
|
|
49
54
|
def tag_attributes(html_options, svelte_props)
|