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 +4 -4
- data/docs/CHANGELOG.md +6 -0
- data/lib/view_component/base.rb +12 -1
- 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: cfdffe5b162240d97c986ddbdee4f537e04bddebde4f622a573c691599a73bed
|
4
|
+
data.tar.gz: d98395c2fe7910511a22da7a42864fa9a3c7c47c3a865be52defd3e54ad0b7c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/view_component/base.rb
CHANGED
@@ -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 =
|
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]
|