Skip to content

Commit

Permalink
[v4] Only support current Rails and Ruby (#2101)
Browse files Browse the repository at this point in the history
* Minimum Ruby version is non-EOL per https://www.ruby-lang.org/en/downloads/branches/ (#2086)

* Only support current Rails and Ruby

In further review of the end-of-life dates for Ruby and Rails,
I propose that we target Ruby >= 3.2 and Rails >= 7.1 which will
be the lowest actively supported versions on April 1, 2025. We can
ship v4 on that date.

* remove backwards compat carve-out

* docs update

* merge cleanup

* update CI config

* remove rails version warning

* grammar
  • Loading branch information
joelhawksley authored Sep 26, 2024
1 parent aa7f44a commit bc4a193
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 85 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ jobs:
fail-fast: false
matrix:
include:
- ruby_version: "3.1"
rails_version: "7.0"
mode: "capture_patch_enabled"
- ruby_version: "3.1"
rails_version: "7.0"
mode: "capture_patch_disabled"
- ruby_version: "3.2"
rails_version: "7.1"
mode: "capture_patch_enabled"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"
gemspec

rails_version = (ENV["RAILS_VERSION"] || "~> 7.0.0").to_s
rails_version = (ENV["RAILS_VERSION"] || "~> 7.1.0").to_s
gem "rails", (rails_version == "main") ? {git: "https://github.com/rails/rails", ref: "main"} : rails_version

ruby_version = (ENV["RUBY_VERSION"] || "~> 3.3").to_s
Expand Down
152 changes: 86 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,86 @@ PATH
remote: .
specs:
view_component (3.14.0)
activesupport (>= 7.0.0, < 8.0)
activesupport (>= 7.1.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
zeitwerk (~> 2.6)
actionmailbox (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailer (7.1.4)
actionpack (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activesupport (= 7.1.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
rack (~> 2.0, >= 2.2.4)
rails-dom-testing (~> 2.2)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.4)
actionpack (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
actionview (7.1.4)
activesupport (= 7.1.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.3.6)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
timeout (>= 0.4.0)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.4)
activesupport (7.1.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
Expand All @@ -83,6 +92,7 @@ GEM
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
benchmark-ips (2.13.0)
better_html (2.1.1)
actionview (>= 6.0)
Expand All @@ -91,6 +101,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
builder (3.3.0)
capybara (3.40.0)
addressable
Expand All @@ -103,6 +114,7 @@ GEM
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
Expand All @@ -113,6 +125,7 @@ GEM
reline (>= 0.3.8)
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
erb_lint (0.6.0)
activesupport
better_html (>= 2.0.1)
Expand Down Expand Up @@ -161,6 +174,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
mutex_m (0.2.0)
net-imap (0.4.16)
date
net-protocol
Expand Down Expand Up @@ -188,36 +202,42 @@ GEM
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.4)
actioncable (= 7.1.4)
actionmailbox (= 7.1.4)
actionmailer (= 7.1.4)
actionpack (= 7.1.4)
actiontext (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activemodel (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
bundler (>= 1.15.0)
railties (= 7.0.8.4)
railties (= 7.1.4)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
method_source
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.7.0)
Expand Down Expand Up @@ -349,7 +369,7 @@ DEPENDENCIES
net-smtp
pry (~> 0.13)
puma (~> 6)
rails (~> 7.0.0)
rails (~> 7.1.0)
rake (~> 13.0)
rspec-rails (~> 5)
rubocop-md (~> 1)
Expand Down
6 changes: 3 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ nav_order: 5

## 4.0.0

* BREAKING: Require [non-EOL](https://endoflife.date/rails) Rails (`>= 7.0.0`).
* BREAKING: Require [non-EOL](https://endoflife.date/rails) Rails (`>= 7.1.0`).

*Joel Hawksley*

* BREAKING: Require [non-EOL](https://www.ruby-lang.org/en/downloads/branches/) Ruby (`>= 3.1.0`).
* BREAKING: Require [non-EOL](https://www.ruby-lang.org/en/downloads/branches/) Ruby (`>= 3.2.0`).

* Joel Hawksley*
*Joel Hawksley*

* Add basic internal testing for memory allocations.

Expand Down
4 changes: 1 addition & 3 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ nav_order: 6

## Ruby & Rails

ViewComponent supports all actively supported versions of Ruby (3.0+) and Ruby on Rails (6.1+) and is tested against a combination of these versions of Ruby on Rails.

While EOL (end-of-life) versions of Ruby and Ruby on Rails may still work with ViewComponent, they're not actively supported and no longer tested. We will still accept patches on a case-by-case basis to support older Ruby & Rails versions based on the complexity and maintenance burden. Please open an issue before submitting such a Pull Request.
ViewComponent supports all actively supported versions of [Ruby](https://endoflife.date/ruby) (>= 3.2) and [Ruby on Rails](https://endoflife.date/rails) (>= 7.1). Changes to the minimum Ruby and Rails versions supported will only be made in major releases.

## Template languages

Expand Down
4 changes: 0 additions & 4 deletions lib/view_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ module ViewComponent
autoload :TestCase
autoload :SystemTestCase
autoload :Translatable

if defined?(Rails) && Rails.version < "7.0"
Kernel.warn("ViewComponent v4 will drop support for Rails < 7.0 in 2025.")
end
end

require "view_component/engine" if defined?(Rails::Engine)
4 changes: 2 additions & 2 deletions view_component.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
spec.files = Dir["LICENSE.txt", "README.md", "app/**/*", "docs/CHANGELOG.md", "lib/**/*"]
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 3.1.0"
spec.required_ruby_version = ">= 3.2.0"

spec.add_runtime_dependency "activesupport", [">= 7.0.0", "< 8.0"]
spec.add_runtime_dependency "activesupport", [">= 7.1.0", "< 8.0"]
spec.add_runtime_dependency "method_source", "~> 1.0"
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
spec.add_development_dependency "allocation_stats", "~> 0.1.5"
Expand Down

0 comments on commit bc4a193

Please sign in to comment.