view_component 4.0.0 → 4.0.1
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.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +17 -6
- data/lib/view_component/base.rb +8 -0
- data/lib/view_component/collection.rb +8 -0
- 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: 6c8e5b159f5df04cb7bb7e4477670ef3953ec682d7167658e1a4d180302d5366
|
4
|
+
data.tar.gz: bfdfb839583d7e7e27f020fcce04baefeaad676e1ca3ae23864e633e343d5b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f262abd83ace33712a19c8fa38d6aff0c1853c59647c8edd916a079e6398537ae3201eb9fd5cf1ad08836d9835868d0fae52aff307609220930bf59040c8976
|
7
|
+
data.tar.gz: 303778089d5c4621a1ac038b0a240552332cef8e8acc7c1b08ede206b03b51a11c7727a6e42714db307844f86ec2c78e519eaf5fad49fcac461e8f90cc0e73ee
|
data/docs/CHANGELOG.md
CHANGED
@@ -10,6 +10,18 @@ nav_order: 6
|
|
10
10
|
|
11
11
|
## main
|
12
12
|
|
13
|
+
## 4.0.1
|
14
|
+
|
15
|
+
* Setup Trusted Publishing to RubyGems to improve software supply chain safety.
|
16
|
+
|
17
|
+
*Hans Lemuet*
|
18
|
+
|
19
|
+
* Conditionally add the `ViewComponent::Base#format` method back for Rails 7.1 only.
|
20
|
+
* Compute and check lockfiles into source control.
|
21
|
+
* Constrain Rails versions in gemfiles to only allow the patch version to vary, eg. `~> 7.1.0` instead of `~> 7.1`.
|
22
|
+
|
23
|
+
*Cameron Dutro*
|
24
|
+
|
13
25
|
## 4.0.0
|
14
26
|
|
15
27
|
Two years after releasing [3.0.0](https://github.com/ViewComponent/view_component/releases/tag/v3.0.0) and almost six years since [1.0.0](https://github.com/ViewComponent/view_component/releases/tag/v1.0.0), we're proud to ship ViewComponent 4. This release marks a shift towards a Long Term Support model for the project, having reached significant feature maturity. While contributions are always welcome, we're unlikely to accept further breaking changes or major feature additions.
|
@@ -37,11 +49,10 @@ Please report any issues at [https://github.com/ViewComponent/view_component/iss
|
|
37
49
|
|
38
50
|
### Breaking changes (dev/test)
|
39
51
|
|
40
|
-
*
|
41
|
-
*
|
42
|
-
* `config.
|
52
|
+
* Remove `config.view_component.test_controller` in favor of `vc_test_controller_class` test helper method.
|
53
|
+
* `config.view_component.component_parent_class` is now `config.view_component.generate.parent_class`, moving the generator-specific option to the generator configuration namespace.
|
54
|
+
* `config.view_component.view_component_path` is now `config.view_component.generate.path`, as components have long since been able to exist in any directory.
|
43
55
|
* Move previews-related configuration (`enabled`, `route`, `paths`, `default_layout`, `controller`) to under `previews` namespace.
|
44
|
-
* `config.view_component_path` is now `config.generate.path`, as components have long since been able to exist in any directory.
|
45
56
|
* `--inline` generator option now generates inline template. Use `--call` to generate `#call` method.
|
46
57
|
* Remove broken integration with `rails stats` that ignored components outside of `app/components`.
|
47
58
|
* Remove `preview_source` functionality. Consider using [Lookbook](https://lookbook.build/) instead.
|
@@ -66,7 +77,7 @@ Please report any issues at [https://github.com/ViewComponent/view_component/iss
|
|
66
77
|
### Bug fixes
|
67
78
|
|
68
79
|
* Fix bug where virtual path wasn't reset, breaking translations outside of components.
|
69
|
-
* Fix bug where `config.previews.enabled` didn't function properly in production environments.
|
80
|
+
* Fix bug where `config.view_component.previews.enabled` didn't function properly in production environments.
|
70
81
|
* Fix bug in `SlotableDefault` where default couldn't be overridden when content was passed as a block.
|
71
82
|
* Fix bug where request-aware helpers didn't work outside of the request context.
|
72
83
|
* `ViewComponentsSystemTestController` shouldn't be useable outside of test environment
|
@@ -81,7 +92,7 @@ Please report any issues at [https://github.com/ViewComponent/view_component/iss
|
|
81
92
|
* Update documentation on performance to reflect more representative benchmark showing 2-3x speed increase over partials.
|
82
93
|
* Add documentation note about instrumentation negatively affecting performance.
|
83
94
|
* Remove unnecessary ENABLE_RELOADING test suite flag.
|
84
|
-
* `config.previews.default_layout` should default to nil.
|
95
|
+
* `config.view_component.previews.default_layout` should default to nil.
|
85
96
|
* Add test coverage for uncovered code.
|
86
97
|
* Test against `turbo-rails` `v2` and `rspec-rails` `v7`.
|
87
98
|
|
data/lib/view_component/base.rb
CHANGED
@@ -316,6 +316,14 @@ module ViewComponent
|
|
316
316
|
[]
|
317
317
|
end
|
318
318
|
|
319
|
+
if Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 1
|
320
|
+
# Rails expects us to define `format` on all renderables,
|
321
|
+
# but we do not know the `format` of a ViewComponent until runtime.
|
322
|
+
def format
|
323
|
+
nil
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
319
327
|
# The current request. Use sparingly as doing so introduces coupling that
|
320
328
|
# inhibits encapsulation & reuse, often making testing difficult.
|
321
329
|
#
|
@@ -19,6 +19,14 @@ module ViewComponent
|
|
19
19
|
components.each(&block)
|
20
20
|
end
|
21
21
|
|
22
|
+
if Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 1
|
23
|
+
# Rails expects us to define `format` on all renderables,
|
24
|
+
# but we do not know the `format` of a ViewComponent until runtime.
|
25
|
+
def format
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
22
30
|
private
|
23
31
|
|
24
32
|
def components
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ViewComponent Team
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
rubygems_version: 3.6.
|
130
|
+
rubygems_version: 3.6.9
|
131
131
|
specification_version: 4
|
132
132
|
summary: A framework for building reusable, testable & encapsulated view components
|
133
133
|
in Ruby on Rails.
|