view_component 4.0.0.rc1 → 4.0.0.rc2

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: 7a112fdf735637f91b77151d96244fac83f0d78141df7a2a0ff8f2d72d0df2d0
4
- data.tar.gz: 39c33408d7f256dc0da92edb17ca18460d776e6f1be89ba63d28e3ea102f8ba9
3
+ metadata.gz: cfdffe5b162240d97c986ddbdee4f537e04bddebde4f622a573c691599a73bed
4
+ data.tar.gz: d98395c2fe7910511a22da7a42864fa9a3c7c47c3a865be52defd3e54ad0b7c7
5
5
  SHA512:
6
- metadata.gz: b4c4f99335d6c2be623f1bd167e3d27567a7093acb388be1c245a6652423e4cc0ee8a16946da2d5ca9d35dd0283fecb1647888def129ec6fb75b82f427379558
7
- data.tar.gz: 0ccb738fb45917ee49886ad2b1359a9bd3d98bf86d7e25f81422cffa5390514fe45d254a1e2d5900b6aa5649f428fa512d6a26c6d486d67546da8729dcc0d26f
6
+ metadata.gz: b8a6d36f48196994b26af63743dd1f9cbf9cf3bd71cd656e2de9b6f34a8fb69c5620e348dd9b791c1d59864627f6d0dc1fb7d56e50ad5e1a1376c611bd555864
7
+ data.tar.gz: ec1366449379c2817bc18e8c8fd565e0aee7a564c99a5c6c564d8da5ee2f60ae5582c1d46fbef25af532fc2e96a5c9b1de5d5e0907850c3af78b394ca49b772d
data/docs/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ nav_order: 6
10
10
 
11
11
  ## main
12
12
 
13
+ ## 4.0.0.rc2
14
+
15
+ * Add `around_render` lifecyle method for wrapping component rendering in custom instrumentation, etc.
16
+
17
+ *Joel Hawksley*, *Blake Williams*
18
+
13
19
  ## 4.0.0.rc1
14
20
 
15
21
  Almost six years after releasing [v1.0.0](https://github.com/ViewComponent/view_component/releases/tag/v1.0.0), we're proud to ship the first release candidate of ViewComponent 4. This release marks a shift towards a Long Term Support model for the project, having reached significant feature maturity. While contributions are always welcome, we're unlikely to accept further breaking changes or major feature additions.
@@ -143,7 +143,10 @@ module ViewComponent
143
143
  @output_buffer.with_buffer do
144
144
  @view_context.instance_variable_set(:@virtual_path, virtual_path)
145
145
 
146
- rendered_template = render_template_for(@__vc_requested_details).to_s
146
+ rendered_template =
147
+ around_render do
148
+ render_template_for(@__vc_requested_details).to_s
149
+ end
147
150
 
148
151
  # Avoid allocating new string when output_preamble and output_postamble are blank
149
152
  value = if output_preamble.blank? && output_postamble.blank?
@@ -228,6 +231,14 @@ module ViewComponent
228
231
  # noop
229
232
  end
230
233
 
234
+ # Called around rendering the component. Override to wrap the rendering of a
235
+ # component in custom instrumentation, etc.
236
+ #
237
+ # @return [void]
238
+ def around_render
239
+ yield
240
+ end
241
+
231
242
  # Override to determine whether the ViewComponent should render.
232
243
  #
233
244
  # @return [Boolean]
@@ -5,7 +5,7 @@ module ViewComponent
5
5
  MAJOR = 4
6
6
  MINOR = 0
7
7
  PATCH = 0
8
- PRE = "rc1"
8
+ PRE = "rc2"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  end
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.0.0.rc1
4
+ version: 4.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ViewComponent Team