view_component 4.6.0 → 4.7.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/docs/CHANGELOG.md +15 -1
- data/lib/view_component/base.rb +1 -0
- data/lib/view_component/template.rb +7 -0
- data/lib/view_component/version.rb +1 -1
- 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: cc884d47517a4f27d0159acd6e744d31a51b29217e3c5e38d9db9594bc25bc79
|
|
4
|
+
data.tar.gz: 0ca9efab88b736c678177eab1edd7165365519724c9efe4b7071391f605707b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23fee96c0259c1a245132a138edf4233fdc228aafb4807ce62f746796295a870548420cb73f99e5ff6705d536e4cfeb6128fe87135c122741a54e8235cba9a31
|
|
7
|
+
data.tar.gz: ca9c6a5d1af51e689d8ec17d91aa06f8cfb25781eb6b77702ecb74639778d0b7d0842f14aaed51243bc4a373329f17bf66beb2efa9d0bb7fb7ced7880d4d8878
|
data/docs/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,20 @@ nav_order: 6
|
|
|
10
10
|
|
|
11
11
|
## main
|
|
12
12
|
|
|
13
|
+
## 4.7.0
|
|
14
|
+
|
|
15
|
+
* Fix stale content cache when slots are accessed before `render_in`.
|
|
16
|
+
|
|
17
|
+
*Jared Armstrong*
|
|
18
|
+
|
|
19
|
+
* Add rubocop-view_component to resources.
|
|
20
|
+
|
|
21
|
+
*Andy Waite*
|
|
22
|
+
|
|
23
|
+
* Fix bug where inheritance of components with formatless templates improperly raised a NoMethodError.
|
|
24
|
+
|
|
25
|
+
*GitHub Copilot*, *Joel Hawksley*, *Cameron Dutro*
|
|
26
|
+
|
|
13
27
|
## 4.6.0
|
|
14
28
|
|
|
15
29
|
* Add `view_identifier` to the `render.view_component` instrumentation event payload, containing the path to the component's template file (e.g. `app/components/my_component.html.erb`). For components using inline render methods, `view_identifier` will be `nil`.
|
|
@@ -22,7 +36,7 @@ nav_order: 6
|
|
|
22
36
|
|
|
23
37
|
* Return `html_safe` empty string from `render_in` when `render?` is false.
|
|
24
38
|
|
|
25
|
-
*Copilot*
|
|
39
|
+
*GitHub Copilot*
|
|
26
40
|
|
|
27
41
|
## 4.5.0
|
|
28
42
|
|
data/lib/view_component/base.rb
CHANGED
|
@@ -21,6 +21,13 @@ module ViewComponent
|
|
|
21
21
|
|
|
22
22
|
class File < Template
|
|
23
23
|
def initialize(component:, details:, path:)
|
|
24
|
+
# If the template file has no format (e.g. .erb instead of .html.erb),
|
|
25
|
+
# assume the default format (html).
|
|
26
|
+
if details.format.nil?
|
|
27
|
+
Kernel.warn("WARNING: Template format for #{path} is missing, defaulting to :html.")
|
|
28
|
+
details = ActionView::TemplateDetails.new(details.locale, details.handler, DEFAULT_FORMAT, details.variant)
|
|
29
|
+
end
|
|
30
|
+
|
|
24
31
|
@strip_annotation_line = false
|
|
25
32
|
|
|
26
33
|
# Rails 8.1 added a newline to compiled ERB output (rails/rails#53731).
|