view_component 2.74.1 → 2.75.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 +14 -0
- data/lib/view_component/base.rb +2 -1
- data/lib/view_component/engine.rb +4 -5
- data/lib/view_component/version.rb +2 -2
- 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: '0856bb7b57478e7604bb8f129a36448c937907308536649c59dc62a324fb8645'
|
4
|
+
data.tar.gz: 2211a54534c91373217a438c504d737054e538bb0f019d574eadd705b02b47ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/view_component/base.rb
CHANGED
@@ -20,8 +20,9 @@ module ViewComponent
|
|
20
20
|
delegate(*ViewComponent::Config.defaults.keys, to: :config)
|
21
21
|
|
22
22
|
def config
|
23
|
-
@config ||=
|
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/
|
4
|
+
require "view_component/config"
|
5
5
|
|
6
6
|
module ViewComponent
|
7
7
|
class Engine < Rails::Engine # :nodoc:
|
8
|
-
config.view_component = ViewComponent::
|
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)
|
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.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-
|
11
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|