Skip to content

Commit 45ffb7a

Browse files
authored
Warn if using Ruby < 3.1 or Rails < 7.0, which will not be supported by ViewComponent v4. (#2090)
1 parent 8f30d27 commit 45ffb7a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

docs/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ nav_order: 5
1010

1111
## main
1212

13+
* Warn if using Ruby < 3.1 or Rails < 7.0, which will not be supported by ViewComponent v4.
14+
15+
*Joel Hawksley*
16+
1317
* Add Kicksite to list of companies using ViewComponent.
1418

15-
*Adil Lari*
19+
*Adil Lari*
1620

1721
* Allow overridden slot methods to use `super`.
1822

lib/view_component.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ module ViewComponent
2121
autoload :TestCase
2222
autoload :SystemTestCase
2323
autoload :Translatable
24+
25+
if defined?(Rails) && Rails.version < "7.0"
26+
Kernel.warn("ViewComponent v4 will drop support for Rails < 7.0 in 2025.")
27+
end
2428
end
2529

2630
require "view_component/engine" if defined?(Rails::Engine)

view_component.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ Gem::Specification.new do |spec|
6464
spec.add_development_dependency "net-imap"
6565
spec.add_development_dependency "net-pop"
6666
spec.add_development_dependency "net-smtp"
67+
else
68+
spec.post_install_message = "ViewComponent v4 will drop support for Ruby < 3.1 in 2025."
6769
end
6870
end

0 commit comments

Comments
 (0)