svelte-on-rails 19.1.1 → 19.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d011f929a4ffd6de0381a91faf504e01e23fc453e94da2a5fff8f2ab25d87fa
|
|
4
|
+
data.tar.gz: 78c81f24932af0b529cd7f7fcd6891d989f70f3895898be837e6399e99ff1bda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4250d8c038ddf7d3a872bedfd9f359d93a2fb0c05bf6b1d1ae31ca84d83854748a3d7655975e69cd1f58568eabbdf7139e0db5f1976823d0c03d2ebd3c1822c0
|
|
7
|
+
data.tar.gz: 3d1a995dc1f093f0e19fb420a710e998294563cd5252166149c9eafea3ca1778c13d00b707b04e450ad19e27cacbc9882908aa22d96b28af8cfa082c5449e043
|
|
@@ -21,7 +21,11 @@ module SvelteOnRails
|
|
|
21
21
|
@component_name = component
|
|
22
22
|
@view_dir = view_dir
|
|
23
23
|
@request = request
|
|
24
|
-
@props = props
|
|
24
|
+
@props = if props.key?(:_uncached)
|
|
25
|
+
props.merge(_uncached: "Uncached props are available for hydration but not for server-side rendering.")
|
|
26
|
+
else
|
|
27
|
+
props
|
|
28
|
+
end
|
|
25
29
|
@html_options = html_options
|
|
26
30
|
|
|
27
31
|
@ssr = resolve_ssr?(request)
|
|
@@ -203,6 +207,10 @@ module SvelteOnRails
|
|
|
203
207
|
|
|
204
208
|
end
|
|
205
209
|
|
|
210
|
+
def props
|
|
211
|
+
@props ||= {}
|
|
212
|
+
end
|
|
213
|
+
|
|
206
214
|
private
|
|
207
215
|
|
|
208
216
|
def run_vite_build
|
|
@@ -61,19 +61,17 @@ module SvelteOnRails
|
|
|
61
61
|
ssr_result = if SvelteOnRails::SsrServer.instance.alive?
|
|
62
62
|
SvelteOnRails::SsrServer.instance.render(
|
|
63
63
|
support.component_paths,
|
|
64
|
-
|
|
64
|
+
support.props,
|
|
65
65
|
support.debug?,
|
|
66
66
|
caller_loc
|
|
67
67
|
)
|
|
68
68
|
else
|
|
69
|
-
SvelteOnRails::Lib::FallbackRenderer.render(support.component_paths,
|
|
69
|
+
SvelteOnRails::Lib::FallbackRenderer.render(support.component_paths, support.props, support.debug?)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
if ssr_result[:success]
|
|
73
73
|
support.set_request_metrics(:rendered)
|
|
74
74
|
attr = support.tag_attributes(html_options, component_props)
|
|
75
|
-
# attr = {tick: :tock}
|
|
76
|
-
a = 1
|
|
77
75
|
content_tag(:div, attr) do
|
|
78
76
|
concat(ssr_result[:head].html_safe)
|
|
79
77
|
concat(ssr_result[:html].html_safe)
|