view_component 2.74.1 → 2.75.0

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.

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: 64dcea99274ed75352d28004634307fa7db193aa5bf8bf57dd0c9d5c5c241308
4
- data.tar.gz: c097b1034bc3df6216117fc0b32df26a8b02c0922c7e7399b254a6606aa46c31
3
+ metadata.gz: '0856bb7b57478e7604bb8f129a36448c937907308536649c59dc62a324fb8645'
4
+ data.tar.gz: 2211a54534c91373217a438c504d737054e538bb0f019d574eadd705b02b47ae
5
5
  SHA512:
6
- metadata.gz: efe5f3a05e157482eec4426ae05eef96345da9aa3ae0865c2ce7bc1755e08ae07405ee648923fe84165eca989a87b53f015012f13002202e809c12819c552a5b
7
- data.tar.gz: 7b8bb21b81a1da222b47dd8c8c12cf2c0f7f5e2bd1e74d80ebfc8bf7e1cbe5c54eeab46c80395d3c8bb28809caac8be07ce833e1530af3b982d153d44398fba2
6
+ metadata.gz: 21585851a66d7a087e33a43a24c53284d5dd633703f636d202bf583f19d6c25b31830ebf47e7757ef38fa36ff981144ee16d4fe9d5dbc87eb7c2baddbddd039c
7
+ data.tar.gz: f16688c10f6c3fe6928573b199b2313436a8462e7fbb8d94b12aff9a36cde5cbbb090f8f9a2f3561c6dfa2b264192df746bc329bcb899905ca27046e60349d6e
data/docs/CHANGELOG.md CHANGED
@@ -10,6 +10,20 @@ nav_order: 5
10
10
 
11
11
  ## main
12
12
 
13
+ ## 2.75.0
14
+
15
+ * Avoid loading ActionView::Base during Rails initialization.
16
+
17
+ *Jonathan del Strother*
18
+
19
+ * Mention lambda slots rendering returned values lazily in the guide.
20
+
21
+ *Graham Rogers*
22
+
23
+ * Add "ViewComponent In The Wild" articles to resources.
24
+
25
+ *Alexander Baygeldin*
26
+
13
27
  ## 2.74.1
14
28
 
15
29
  * Add more users of ViewComponent to docs.
@@ -20,8 +20,9 @@ module ViewComponent
20
20
  delegate(*ViewComponent::Config.defaults.keys, to: :config)
21
21
 
22
22
  def config
23
- @config ||= ViewComponent::Config.defaults
23
+ @config ||= ActiveSupport::OrderedOptions.new
24
24
  end
25
+ attr_writer :config
25
26
  end
26
27
 
27
28
  include ViewComponent::ContentAreas
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails"
4
- require "view_component/base"
4
+ require "view_component/config"
5
5
 
6
6
  module ViewComponent
7
7
  class Engine < Rails::Engine # :nodoc:
8
- config.view_component = ViewComponent::Base.config
8
+ config.view_component = ViewComponent::Config.defaults
9
9
 
10
10
  rake_tasks do
11
11
  load "view_component/rails/tasks/view_component.rake"
@@ -14,9 +14,6 @@ module ViewComponent
14
14
  initializer "view_component.set_configs" do |app|
15
15
  options = app.config.view_component
16
16
 
17
- %i[generate preview_controller preview_route show_previews_source].each do |config_option|
18
- options[config_option] ||= ViewComponent::Base.public_send(config_option)
19
- end
20
17
  options.instrumentation_enabled = false if options.instrumentation_enabled.nil?
21
18
  options.render_monkey_patch_enabled = true if options.render_monkey_patch_enabled.nil?
22
19
  options.show_previews = (Rails.env.development? || Rails.env.test?) if options.show_previews.nil?
@@ -39,6 +36,8 @@ module ViewComponent
39
36
 
40
37
  initializer "view_component.enable_instrumentation" do |app|
41
38
  ActiveSupport.on_load(:view_component) do
39
+ Base.config = app.config.view_component
40
+
42
41
  if app.config.view_component.instrumentation_enabled.present?
43
42
  # :nocov:
44
43
  ViewComponent::Base.prepend(ViewComponent::Instrumentation)
@@ -3,8 +3,8 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 74
7
- PATCH = 1
6
+ MINOR = 75
7
+ PATCH = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
10
10
  end
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.74.1
4
+ version: 2.75.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-10-10 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport