view_component 2.56.0 → 2.57.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb12aeca73f2c8cbd2e34b616060492b7a511a3578df16ec57736e4e0c99c25a
4
- data.tar.gz: 13de0099bbf28122b3a722cd105ad77f15f025a420434a156ffa1dc9899bc216
3
+ metadata.gz: a22d7248560f80072ed000776afa4f92b164cd80931570feb4a3416bb6ba3627
4
+ data.tar.gz: 9bc617ae2ff51bad6f61b41412b4b3827c4bbe3f2366e0a3829ee00216d9518d
5
5
  SHA512:
6
- metadata.gz: 3845987cc4992cca1e52eefe1f28df12d38edf53a8c7e82fd8bad8af2d47c9630522485d9a51a2111b2ec4dc5b74109f76ab2fb5509b34318e3d4f5b5f5c894e
7
- data.tar.gz: 9942a4e3ca9a1d84ad25cb10b50cc416acf823611dc1a77811a529974ae78c0fb25882694e6d216624eac466993df1c8a0888cdcaecc59b89020e1011bf42557
6
+ metadata.gz: 648585993d06389775c8d14edee060fc551394edadaa7337a4b10709183941f9143cad71dc045ec4dca50db5bd568b8b57066518c0222e32e569f89e787043af
7
+ data.tar.gz: 4c8fbee2640a2fba303ce93010bdf789cbe094f233e7253dc4491207cadd3101914d86ae22c4b85e7c3db78b18e048b14955b41ce86ceb510fd4495e6ef216dc
data/docs/CHANGELOG.md CHANGED
@@ -9,6 +9,32 @@ title: Changelog
9
9
 
10
10
  ## main
11
11
 
12
+ ## 2.57.0
13
+
14
+ * Add missing `require` for `Translatable` module in `Base`.
15
+
16
+ *Hans Lemuet*
17
+
18
+ * Allow anything that responds to `#render_in` to be rendered in the parent component's view context.
19
+
20
+ *Cameron Dutro*
21
+
22
+ * Fix script/release so it honors semver.
23
+
24
+ *Cameron Dutro*
25
+
26
+ ## 2.56.2
27
+
28
+ * Restore removed `rendered_component`, marking it for deprecation in v3.0.0.
29
+
30
+ *Tyson Gach*, *Richard Macklin*, *Joel Hawksley*
31
+
32
+ ## 2.56.1
33
+
34
+ * Rename private accessor `rendered_component` to `rendered_content`.
35
+
36
+ *Yoshiyuki Hirano*, *Simon Dawson*
37
+
12
38
  ## 2.56.0
13
39
 
14
40
  * Introduce experimental `render_preview` test helper. Note: `@rendered_component` in `TestHelpers` has been renamed to `@rendered_content`.
@@ -9,6 +9,7 @@ require "view_component/polymorphic_slots"
9
9
  require "view_component/previewable"
10
10
  require "view_component/slotable"
11
11
  require "view_component/slotable_v2"
12
+ require "view_component/translatable"
12
13
  require "view_component/with_content_helper"
13
14
 
14
15
  module ViewComponent
@@ -182,8 +183,11 @@ module ViewComponent
182
183
  #
183
184
  # @private
184
185
  def render(options = {}, args = {}, &block)
185
- if options.is_a? ViewComponent::Base
186
- options.__vc_original_view_context = __vc_original_view_context
186
+ if options.respond_to?(:render_in)
187
+ if options.is_a?(ViewComponent::Base)
188
+ options.__vc_original_view_context = __vc_original_view_context
189
+ end
190
+
187
191
  super
188
192
  else
189
193
  __vc_original_view_context.render(options, args, &block)
@@ -30,7 +30,16 @@ module ViewComponent
30
30
  end
31
31
 
32
32
  # @private
33
- attr_reader :rendered_component
33
+ attr_reader :rendered_content
34
+
35
+ def rendered_component
36
+ ViewComponent::Deprecation.warn(
37
+ "`rendered_component` is deprecated and will be removed in v3.0.0. " \
38
+ "Use `page` instead."
39
+ )
40
+
41
+ rendered_content
42
+ end
34
43
 
35
44
  # Render a component inline. Internally sets `page` to be a `Capybara::Node::Simple`,
36
45
  # allowing for Capybara assertions to be used:
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 56
6
+ MINOR = 57
7
7
  PATCH = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
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.56.0
4
+ version: 2.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport