view_component 2.71.0 → 2.73.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: 0fbced9eb4c36f970d2b46f99dfd3aca2043b619b807b89b27ae772596c3fe1d
4
- data.tar.gz: 82ccdda90514c215f72b6e4d654db71b3ed42e55a52c8eebbd99742f047d0b4f
3
+ metadata.gz: e93199b5338cffab62abb54fd5f76275c2b3ddd3c1b12ef60e14ea599732f247
4
+ data.tar.gz: 432ae80f950b2248d10e3ee9743ddb786f8bfc037c84e802b5fdcab019d615ff
5
5
  SHA512:
6
- metadata.gz: e874d63dd57bd39186244c95f351e975d8bb8e54f21c8619659b171084426c5c038ad52e710760fb0ef7301ed956c9eac99a3be5bc6f48fea0aa35f8c4459186
7
- data.tar.gz: db9fef63203b0cde5f7a867c553ef776b8b485ac21b4e7911ec78d0a5e3e8d484545b715dfd41f71c31bdab0f155d605b11554be8b33c21373e94f76aa132907
6
+ metadata.gz: eeec5590ac13fdc2153669d34590d132e81e98083940f41fcc371379efdccb50cca11c103cf274e61f00fd1dbf98501bda36e0d9ecda08ac6462256e644cc18b
7
+ data.tar.gz: 7c222a29ebbff9e85adb164302f0083499de254a09b0af507ee37d201324bcc5bd46d5a9054eb73809a5b81b8d2edb1ab198399f78c749f5bee59257a19a1e6a
data/docs/CHANGELOG.md CHANGED
@@ -10,6 +10,62 @@ nav_order: 5
10
10
 
11
11
  ## main
12
12
 
13
+ ## 2.73.0
14
+
15
+ * Remove experimental `_after_compile` lifecycle method.
16
+
17
+ *Joel Hawksley*
18
+
19
+ * Fix capitalization of JavaScript in docs.
20
+
21
+ *Erinna Chen*
22
+
23
+ * Add PrintReleaf to list of companies using ViewComponent.
24
+
25
+ *Ry Kulp*
26
+
27
+ * Simplify CI configuration to a single build per Ruby/Rails version.
28
+
29
+ *Joel Hawksley*
30
+
31
+ * Correctly document `generate.sidecar` config option.
32
+
33
+ *Ruben Smit*
34
+
35
+ * Add Yobbers to list of companies using ViewComponent.
36
+
37
+ *Anton Prins*
38
+
39
+ ## 2.72.0
40
+
41
+ * Deprecate support for Ruby < 2.7 for removal in v3.0.0.
42
+
43
+ *Joel Hawksley*
44
+
45
+ * Add `changelog_uri` to gemspec.
46
+
47
+ *Joel Hawksley*
48
+
49
+ * Link to `CHANGELOG.md` instead of symlink.
50
+
51
+ *Joel Hawksley.
52
+
53
+ * Add Aluuno to list of companies using ViewComponent.
54
+
55
+ *Daniel Naves de Carvalho*
56
+
57
+ * Add `source_code_uri` to gemspec.
58
+
59
+ *Yoshiyuki Hirano*
60
+
61
+ * Update link to benchmark script in docs.
62
+
63
+ *Daniel Diekmeier*
64
+
65
+ * Add special exception message for `renders_one :content` explaining that content passed as a block will be assigned to the `content` accessor without having to create an explicit slot.
66
+
67
+ *Daniel Diekmeier*
68
+
13
69
  ## 2.71.0
14
70
 
15
71
  **ViewComponent has moved to a new organization: [https://github.com/viewcomponent/view_component](https://github.com/viewcomponent/view_component). See [https://github.com/viewcomponent/view_component/issues/1424](https://github.com/viewcomponent/view_component/issues/1424) for more details.**
@@ -59,15 +59,6 @@ module ViewComponent
59
59
  self.__vc_original_view_context = view_context
60
60
  end
61
61
 
62
- # EXPERIMENTAL: This API is experimental and may be removed at any time.
63
- # Hook for allowing components to do work as part of the compilation process.
64
- #
65
- # For example, one might compile component-specific assets at this point.
66
- # @private TODO: add documentation
67
- def self._after_compile
68
- # noop
69
- end
70
-
71
62
  # @!macro [attach] deprecated_generate_mattr_accessor
72
63
  # @method generate_$1
73
64
  # @deprecated Use `#generate.$1` instead. Will be removed in v3.0.0.
@@ -33,6 +33,10 @@ module ViewComponent
33
33
  return if compiled? && !force
34
34
  return if component_class == ViewComponent::Base
35
35
 
36
+ if RUBY_VERSION < "2.7.0"
37
+ ViewComponent::Deprecation.warn("Support for Ruby versions < 2.7.0 will be removed in v3.0.0.")
38
+ end
39
+
36
40
  component_class.superclass.compile(raise_errors: raise_errors) if should_compile_superclass?
37
41
 
38
42
  with_write_lock do
@@ -86,7 +90,6 @@ module ViewComponent
86
90
  define_render_template_for
87
91
 
88
92
  component_class.build_i18n_backend
89
- component_class._after_compile
90
93
 
91
94
  CompileCache.register(component_class)
92
95
  end
@@ -19,8 +19,7 @@ module ViewComponent
19
19
  end
20
20
  options.instrumentation_enabled = false if options.instrumentation_enabled.nil?
21
21
  options.render_monkey_patch_enabled = true if options.render_monkey_patch_enabled.nil?
22
- options.show_previews = Rails.env.development? || Rails.env.test? if options.show_previews.nil?
23
- options.instrumentation_enabled = false if options.instrumentation_enabled.nil?
22
+ options.show_previews = Rails.env.development? || Rails.env.test?
24
23
 
25
24
  if options.show_previews
26
25
  # This is still necessary because when `config.view_component` is declared, `Rails.root` is unspecified.
@@ -272,6 +272,14 @@ module ViewComponent
272
272
  end
273
273
 
274
274
  def validate_singular_slot_name(slot_name)
275
+ if slot_name.to_sym == :content
276
+ raise ArgumentError.new(
277
+ "#{self} declares a slot named content, which is a reserved word in ViewComponent.\n\n" \
278
+ "Content passed to a ViewComponent as a block is captured and assigned to the `content` accessor without having to create an explicit slot.\n\n" \
279
+ "To fix this issue, either use the `content` accessor directly or choose a different slot name."
280
+ )
281
+ end
282
+
275
283
  if RESERVED_NAMES[:singular].include?(slot_name.to_sym)
276
284
  raise ArgumentError.new(
277
285
  "#{self} declares a slot named #{slot_name}, which is a reserved word in the ViewComponent framework.\n\n" \
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 71
6
+ MINOR = 73
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.71.0
4
+ version: 2.73.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-31 00:00:00.000000000 Z
11
+ date: 2022-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -389,6 +389,8 @@ licenses:
389
389
  - MIT
390
390
  metadata:
391
391
  allowed_push_host: https://rubygems.org
392
+ source_code_uri: https://github.com/viewcomponent/view_component
393
+ changelog_uri: https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md
392
394
  post_install_message:
393
395
  rdoc_options: []
394
396
  require_paths: