view_component 2.69.0 → 2.70.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of view_component might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +39 -4
- data/lib/view_component/test_helpers.rb +10 -2
- data/lib/view_component/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfe904fc47e30f865915a9b517c3251338fecdac7c64ed171eb1cf01ffb93c19
|
4
|
+
data.tar.gz: 68589f54949361d592dad65bd7e225c8e4268e9538f3e48202bf3685053411bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f833b5f3024650abce4085c8558d9bbf8b023270f1d7225624a4bfe279f92b6ba7dcc946299d89307e73ff1273817c2f0a5675c5f591402e40fd4694ec51b23
|
7
|
+
data.tar.gz: 8287a658c19c7aeb49cd1e0f57ffd9569f4727adde01ddc02a8d7f2322ad09ec3a3e2afe521c236ab086c5f48f399b11bea1145165c5a752286eaf93f5590b4e
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,24 +1,59 @@
|
|
1
1
|
---
|
2
2
|
layout: default
|
3
3
|
title: Changelog
|
4
|
+
nav_order: 5
|
4
5
|
---
|
5
6
|
|
6
7
|
<!-- Add unreleased changes under the "main" heading. -->
|
7
8
|
|
8
9
|
# Changelog
|
9
10
|
|
10
|
-
|
11
|
+
## main
|
12
|
+
|
13
|
+
## 2.70.0
|
14
|
+
|
15
|
+
* `render_preview` can pass parameters to preview.
|
11
16
|
|
12
17
|
*Joel Hawksley*
|
13
18
|
|
14
|
-
*
|
19
|
+
* Fix docs typos.
|
15
20
|
|
16
|
-
*
|
21
|
+
*Joel Hawksley*
|
17
22
|
|
18
|
-
|
23
|
+
* Add architectural decisions to documentation and rename sidebar sections.
|
24
|
+
|
25
|
+
*Joel Hawksley*
|
26
|
+
|
27
|
+
* Clarify documentation on testability of Rails views.
|
28
|
+
|
29
|
+
*Joel Hawksley*
|
30
|
+
|
31
|
+
* Add Arrows to list of companies using ViewComponent.
|
32
|
+
|
33
|
+
*Matt Swanson*
|
34
|
+
|
35
|
+
* Add WIP to list of companies using ViewComponent.
|
36
|
+
|
37
|
+
*Marc Köhlbrugge*
|
38
|
+
|
39
|
+
* Update slots documentation to include how to reference slots.
|
40
|
+
|
41
|
+
*Brittany Ellich*
|
42
|
+
|
43
|
+
* Add Clio to list of companies using ViewComponent.
|
44
|
+
|
45
|
+
*Mike Buckley*
|
19
46
|
|
20
47
|
## 2.69.0
|
21
48
|
|
49
|
+
* Add missing `require` to fix `pvc` build.
|
50
|
+
|
51
|
+
*Joel Hawksley*
|
52
|
+
|
53
|
+
* Add `config.view_component.use_consistent_rendering_lifecycle` to ensure side-effects in `content` are consistently evaluated before components are rendered. This change effectively means that `content` is evaluated for every component render where `render?` returns true. As a result, code that's passed to a component via a block/content will now always be evaluated, before `#call`, which can reveal bugs in existing components. This configuration option defaults to `false` but will be enabled in 3.0 and the old behavior will be removed.
|
54
|
+
|
55
|
+
*Blake Williams*
|
56
|
+
|
22
57
|
* Update Prism to version 1.28.0.
|
23
58
|
|
24
59
|
*Thomas Hutterer*
|
@@ -80,9 +80,10 @@ module ViewComponent
|
|
80
80
|
#
|
81
81
|
# In RSpec, `Preview` is appended to `described_class`.
|
82
82
|
#
|
83
|
-
# @param
|
83
|
+
# @param name [String] The name of the preview to be rendered.
|
84
|
+
# @param params [Hash] Parameters to be passed to the preview.
|
84
85
|
# @return [Nokogiri::HTML]
|
85
|
-
def render_preview(name)
|
86
|
+
def render_preview(name, params: {})
|
86
87
|
begin
|
87
88
|
preview_klass = if respond_to?(:described_class)
|
88
89
|
raise "`render_preview` expected a described_class, but it is nil." if described_class.nil?
|
@@ -97,6 +98,13 @@ module ViewComponent
|
|
97
98
|
end
|
98
99
|
|
99
100
|
previews_controller = build_controller(Rails.application.config.view_component.preview_controller.constantize)
|
101
|
+
|
102
|
+
# From what I can tell, it's not possible to overwrite all request parameters
|
103
|
+
# at once, so we set them individually here.
|
104
|
+
params.each do |k, v|
|
105
|
+
previews_controller.request.params[k] = v
|
106
|
+
end
|
107
|
+
|
100
108
|
previews_controller.request.params[:path] = "#{preview_klass.preview_name}/#{name}"
|
101
109
|
previews_controller.response = ActionDispatch::Response.new
|
102
110
|
result = previews_controller.previews
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.70.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ViewComponent Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|