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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 761d9451b4af2b617182339d3a356985d119be9ff490018815d9affd6ede89dc
4
- data.tar.gz: 508b8e0699e11bbed4f649cebc9df0015e08e45b1cf92c1c528f13d566422c79
3
+ metadata.gz: cc884d47517a4f27d0159acd6e744d31a51b29217e3c5e38d9db9594bc25bc79
4
+ data.tar.gz: 0ca9efab88b736c678177eab1edd7165365519724c9efe4b7071391f605707b8
5
5
  SHA512:
6
- metadata.gz: 4820e68ab750d1c89901c2244527e8896d42a270afb20d8add4c0437fab80d7f4623e9da3817baafda390d94c77c0d5e79959f95772fedc571b132565fcd8bca
7
- data.tar.gz: 1a3118de2ce98910b40ba370b13618083c396565a7b2db128eea39de7263c2d17240865caf2f94c7e83ee9113537cd5d18f6b6c3c80e137d5f5e15f1f823ba17
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
 
@@ -131,6 +131,7 @@ module ViewComponent
131
131
  end
132
132
 
133
133
  @__vc_content_evaluated = false
134
+ remove_instance_variable(:@__vc_content) if defined?(@__vc_content)
134
135
  @__vc_render_in_block = block
135
136
  @view_context.instance_variable_set(:@virtual_path, virtual_path)
136
137
 
@@ -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).
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 4
6
- MINOR = 6
6
+ MINOR = 7
7
7
  PATCH = 0
8
8
  PRE = nil
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ViewComponent Team