Skip to content

Commit 0446137

Browse files
authored
Merge pull request #2467 from ViewComponent/support-rails-head
Support Rails 8.1
2 parents 2baa84e + 177029d commit 0446137

19 files changed

+1044
-44
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
rails_version: "7.2"
4040
- ruby_version: "3.4"
4141
rails_version: "8.0"
42+
- ruby_version: "3.4"
43+
rails_version: "8.1"
4244
- ruby_version: "head"
4345
rails_version: "main"
4446
env:

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby 3.4.3
1+
ruby 3.4.7

Appraisals

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ appraise "rails-8.0" do
3333
end
3434
end
3535

36+
appraise "rails-8.1" do
37+
ruby "~> 3.4.0"
38+
39+
gem "rails", "~> 8.1.0"
40+
41+
group :development, :test do
42+
gem "turbo-rails", "~> 2"
43+
gem "rspec-rails", "~> 8"
44+
end
45+
end
46+
3647
appraise "rails-main" do
3748
gem "rack", git: "https://github.com/rack/rack", ref: "8a4475a9f416a72e5b02bd7817e4a8ed684f29b0"
3849
gem "rails", github: "rails/rails", branch: "main"

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ruby ruby_version
1313
group :development, :test do
1414
gem "allocation_stats"
1515
gem "appraisal", "~> 2"
16+
gem "appraisal-run", "~> 1.0"
1617
gem "benchmark-ips", "~> 2"
1718
gem "better_html"
1819
gem "bundler", "~> 2"

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
view_component (4.0.2)
5-
activesupport (>= 7.1.0, < 8.1)
5+
activesupport (>= 7.1.0, < 8.2)
66
concurrent-ruby (~> 1)
77

88
GEM
@@ -87,6 +87,7 @@ GEM
8787
bundler
8888
rake
8989
thor (>= 0.14.0)
90+
appraisal-run (1.0.0)
9091
ast (2.4.3)
9192
base64 (0.3.0)
9293
benchmark (0.4.1)
@@ -404,6 +405,7 @@ PLATFORMS
404405
DEPENDENCIES
405406
allocation_stats
406407
appraisal (~> 2)
408+
appraisal-run (~> 1.0)
407409
benchmark-ips (~> 2)
408410
better_html
409411
bundler (~> 2)

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 6
1010

1111
## main
1212

13+
* Add Rails 8.1 support.
14+
15+
*Hans Lemuet*
16+
1317
* Add Carwow to list of companies using ViewComponent.
1418

1519
*Tom Lord*

docs/CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,26 @@ The codespace environment includes a minimal Rails app with ViewComponent instal
4545
2. Expose the port when prompted by the Visual Studio Code Web Editor.
4646
3. Add the external URL to the config block in `config/application.rb` as prompted by the error.
4747

48+
## Running tests with Appraisal
49+
50+
This project uses [appraisal](https://github.com/thoughtbot/appraisal) to run tests for various versions of Ruby and Rails, and [appraisal-run](https://github.com/camertron/appraisal-run) to run them in Docker containers.
51+
52+
1. Install the dependencies: `bundle`
53+
2. Make sure the tests pass: `appraisal-run gemfiles/*.gemfile -- bundle exec rake`
54+
55+
When a new version of Rails is released:
56+
57+
1. Add a new `appraise` block in `Appraisals`.
58+
2. Run `bundle exec appraisal generate`
59+
3. Update the gemfiles locks `appraisal-run gemfiles/*.gemfile -- bundle lock`
60+
4. Make sure the tests pass: `appraisal-run gemfiles/*.gemfile -- bundle exec rake`
61+
5. Commit and push the changes.
62+
6. Release a new version.
63+
4864
## Submitting a pull request
4965

5066
1. [Fork](https://github.com/viewcomponent/view_component/fork) and clone the repository.
51-
1. Configure and install the dependencies: `bundle exec appraisal install`.
52-
2. Make sure the tests pass: `bundle exec appraisal rake` (see below for specific cases).
67+
2. Make sure the tests pass: `appraisal-run gemfiles/*.gemfile -- bundle exec rake`.
5368
3. Create a new branch: `git checkout -b my-branch-name`.
5469
4. Add tests, make the change, and make sure the tests still pass.
5570
5. Add an entry to the top of `docs/CHANGELOG.md` for the changes, no matter how small.

gemfiles/rails_7.1.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gem "rails", "~> 7.1.0"
99
group :development, :test do
1010
gem "allocation_stats"
1111
gem "appraisal", "~> 2"
12+
gem "appraisal-run", "~> 1.0"
1213
gem "benchmark-ips", "~> 2"
1314
gem "better_html"
1415
gem "bundler", "~> 2"
@@ -34,7 +35,7 @@ group :development, :test do
3435
gem "slim", "~> 5"
3536
gem "sprockets-rails", "~> 3"
3637
gem "standard", "~> 1"
37-
gem "tailwindcss-rails", "~> 2"
38+
gem "tailwindcss-rails", "~> 4"
3839
gem "turbo-rails", "~> 1"
3940
gem "warning"
4041
gem "yard-activesupport-concern", "< 1"

gemfiles/rails_7.1.gemfile.lock

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: ..
33
specs:
44
view_component (4.0.2)
5-
activesupport (>= 7.1.0, < 8.1)
5+
activesupport (>= 7.1.0, < 8.2)
66
concurrent-ruby (~> 1)
77

88
GEM
@@ -93,6 +93,7 @@ GEM
9393
bundler
9494
rake
9595
thor (>= 0.14.0)
96+
appraisal-run (1.0.0)
9697
ast (2.4.3)
9798
base64 (0.3.0)
9899
benchmark (0.4.1)
@@ -355,16 +356,16 @@ GEM
355356
lint_roller (~> 1.1)
356357
rubocop-performance (~> 1.25.0)
357358
stringio (3.1.7)
358-
tailwindcss-rails (2.7.9-aarch64-linux)
359-
railties (>= 7.0.0)
360-
tailwindcss-rails (2.7.9-arm-linux)
361-
railties (>= 7.0.0)
362-
tailwindcss-rails (2.7.9-arm64-darwin)
363-
railties (>= 7.0.0)
364-
tailwindcss-rails (2.7.9-x86_64-darwin)
365-
railties (>= 7.0.0)
366-
tailwindcss-rails (2.7.9-x86_64-linux)
359+
tailwindcss-rails (4.3.0)
367360
railties (>= 7.0.0)
361+
tailwindcss-ruby (~> 4.0)
362+
tailwindcss-ruby (4.1.13)
363+
tailwindcss-ruby (4.1.13-aarch64-linux-gnu)
364+
tailwindcss-ruby (4.1.13-aarch64-linux-musl)
365+
tailwindcss-ruby (4.1.13-arm64-darwin)
366+
tailwindcss-ruby (4.1.13-x86_64-darwin)
367+
tailwindcss-ruby (4.1.13-x86_64-linux-gnu)
368+
tailwindcss-ruby (4.1.13-x86_64-linux-musl)
368369
temple (0.10.4)
369370
terminal-table (4.0.0)
370371
unicode-display_width (>= 1.1.1, < 4)
@@ -410,6 +411,7 @@ PLATFORMS
410411
DEPENDENCIES
411412
allocation_stats
412413
appraisal (~> 2)
414+
appraisal-run (~> 1.0)
413415
benchmark-ips (~> 2)
414416
better_html
415417
bundler (~> 2)
@@ -436,7 +438,7 @@ DEPENDENCIES
436438
slim (~> 5)
437439
sprockets-rails (~> 3)
438440
standard (~> 1)
439-
tailwindcss-rails (~> 2)
441+
tailwindcss-rails (~> 4)
440442
turbo-rails (~> 1)
441443
view_component!
442444
warning

gemfiles/rails_7.2.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gem "rails", "~> 7.2.0"
99
group :development, :test do
1010
gem "allocation_stats"
1111
gem "appraisal", "~> 2"
12+
gem "appraisal-run", "~> 1.0"
1213
gem "benchmark-ips", "~> 2"
1314
gem "better_html"
1415
gem "bundler", "~> 2"
@@ -34,7 +35,7 @@ group :development, :test do
3435
gem "slim", "~> 5"
3536
gem "sprockets-rails", "~> 3"
3637
gem "standard", "~> 1"
37-
gem "tailwindcss-rails", "~> 2"
38+
gem "tailwindcss-rails", "~> 4"
3839
gem "turbo-rails", "~> 2"
3940
gem "warning"
4041
gem "yard-activesupport-concern", "< 1"

0 commit comments

Comments
 (0)