From e9d29959a34d26ef19f3b869b2bb334e660a171c Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:17:09 -0700 Subject: [PATCH 1/8] bundle update --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 80b88e0a3..490bf80ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,7 @@ GEM diff-lcs (1.5.1) docile (1.4.1) drb (2.2.1) - erb_lint (0.7.0) + erb_lint (0.8.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) From 0d7d662b5a1366877c58f499ac3dc1d5d66bb4b3 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:30:21 -0700 Subject: [PATCH 2/8] update local dev to use latest rails and ruby --- .tool-versions | 2 +- Gemfile | 4 +- Gemfile.lock | 176 +++++++++++++++++++++++------------------ view_component.gemspec | 1 + 4 files changed, 104 insertions(+), 79 deletions(-) diff --git a/.tool-versions b/.tool-versions index 3294aeda6..041df9aa6 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.3.0 +ruby 3.4.1 diff --git a/Gemfile b/Gemfile index 0a20ee868..e0848eaa7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec -rails_version = (ENV["RAILS_VERSION"] || "~> 7.0.0").to_s +rails_version = (ENV["RAILS_VERSION"] || "~> 8.0.1").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 +ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4.1").to_s ruby ruby_version diff --git a/Gemfile.lock b/Gemfile.lock index 490bf80ac..583ef968a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,71 +9,77 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.7) - actionpack (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.7) - actionview (= 7.0.8.7) - activesupport (= 7.0.8.7) - rack (~> 2.0, >= 2.2.4) + zeitwerk (~> 2.6) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + 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.7) - actionpack (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.7) - activesupport (= 7.0.8.7) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.7) - activesupport (= 7.0.8.7) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (7.0.8.7) - activesupport (= 7.0.8.7) - activerecord (7.0.8.7) - activemodel (= 7.0.8.7) - activesupport (= 7.0.8.7) - activestorage (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activesupport (= 7.0.8.7) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.7) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) allocation_stats (0.1.5) @@ -84,6 +90,7 @@ GEM thor (>= 0.14.0) ast (2.4.2) base64 (0.2.0) + benchmark (0.4.0) benchmark-ips (2.13.0) better_html (2.1.1) actionview (>= 6.0) @@ -105,6 +112,7 @@ GEM xpath (~> 3.2) coderay (1.1.3) concurrent-ruby (1.3.4) + connection_pool (2.5.0) crass (1.0.6) cuprite (0.15.1) capybara (~> 3.0) @@ -147,6 +155,7 @@ GEM json (2.9.1) language_server-protocol (3.17.0.3) lint_roller (1.1.0) + logger (1.6.4) loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -182,6 +191,11 @@ GEM parser (3.3.6.0) ast (~> 2.4.1) racc + propshaft (1.1.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) @@ -193,22 +207,27 @@ GEM nio4r (~> 2.0) racc (1.8.1) rack (2.2.10) + rack-session (1.0.2) + rack (< 3) rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8.7) - actioncable (= 7.0.8.7) - actionmailbox (= 7.0.8.7) - actionmailer (= 7.0.8.7) - actionpack (= 7.0.8.7) - actiontext (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activemodel (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rackup (1.0.1) + rack (< 3) + webrick + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 7.0.8.7) + railties (= 8.0.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -216,13 +235,14 @@ GEM rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) - method_source + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + 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.10.0) @@ -267,6 +287,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) rubyzip (2.4.1) + securerandom (0.4.1) selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -318,6 +339,8 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) + uri (1.0.2) + useragent (0.16.11) warning (1.5.0) webrick (1.9.1) websocket (1.2.11) @@ -356,9 +379,10 @@ DEPENDENCIES net-imap net-pop net-smtp + propshaft (~> 1.1.0) pry (~> 0.13) puma (~> 6) - rails (~> 7.0.0) + rails (~> 8.0.1) rake (~> 13.0) rspec-rails (~> 5) rubocop-md (~> 1) @@ -375,7 +399,7 @@ DEPENDENCIES yard-activesupport-concern (~> 0.0.1) RUBY VERSION - ruby 3.3.0p0 + ruby 3.4.1p0 BUNDLED WITH 2.5.3 diff --git a/view_component.gemspec b/view_component.gemspec index b443e86e6..da7591785 100644 --- a/view_component.gemspec +++ b/view_component.gemspec @@ -45,6 +45,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jbuilder", "~> 2" spec.add_development_dependency "m", "~> 1" spec.add_development_dependency "minitest", "~> 5.18" + spec.add_development_dependency "propshaft", "~> 1.1.0" spec.add_development_dependency "pry", "~> 0.13" spec.add_development_dependency "puma", "~> 6" spec.add_development_dependency "rake", "~> 13.0" From 4c9cf7ed24abc0dcb8eeb885d9f74c5b5fb98137 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:35:36 -0700 Subject: [PATCH 3/8] resolve warnings in tests --- test/sandbox/test/rendering_test.rb | 44 ++++++++++--------- test/sandbox/test/slotable_test.rb | 6 ++- .../test/view_component_system_test.rb | 16 ++++--- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/test/sandbox/test/rendering_test.rb b/test/sandbox/test/rendering_test.rb index 79eb5628d..3e9fcdb60 100644 --- a/test/sandbox/test/rendering_test.rb +++ b/test/sandbox/test/rendering_test.rb @@ -964,11 +964,13 @@ def test_multithread_render end def test_concurrency_deadlock_cache - with_compiler_development_mode(true) do - with_new_cache do - render_inline(ContentEvalComponent.new) do - ViewComponent::CompileCache.invalidate! - render_inline(ContentEvalComponent.new) + assert_nothing_raised do + with_compiler_development_mode(true) do + with_new_cache do + render_inline(ContentEvalComponent.new) do + ViewComponent::CompileCache.invalidate! + render_inline(ContentEvalComponent.new) + end end end end @@ -1089,27 +1091,29 @@ def test_renders_nested_collection end def test_concurrency_deadlock - with_compiler_development_mode(true) do - with_new_cache do - mutex = Mutex.new + assert_nothing_raised do + with_compiler_development_mode(true) do + with_new_cache do + mutex = Mutex.new - t1 = Thread.new do - mutex.synchronize do - sleep 0.02 - render_inline(ContentEvalComponent.new) + t1 = Thread.new do + mutex.synchronize do + sleep 0.02 + render_inline(ContentEvalComponent.new) + end end - end - t = Thread.new do - render_inline(ContentEvalComponent.new) do - mutex.synchronize do - sleep 0.01 + t = Thread.new do + render_inline(ContentEvalComponent.new) do + mutex.synchronize do + sleep 0.01 + end end end - end - t1.join - t.join + t1.join + t.join + end end end end diff --git a/test/sandbox/test/slotable_test.rb b/test/sandbox/test/slotable_test.rb index 83f44a8ce..8ea493fac 100644 --- a/test/sandbox/test/slotable_test.rb +++ b/test/sandbox/test/slotable_test.rb @@ -298,8 +298,10 @@ def test_slot_with_block_content end def test_lambda_slot_with_missing_block - render_inline(SlotsComponent.new(classes: "mt-4")) do |component| - component.with_footer(classes: "text-blue") + assert_nothing_raised do + render_inline(SlotsComponent.new(classes: "mt-4")) do |component| + component.with_footer(classes: "text-blue") + end end end diff --git a/test/sandbox/test/view_component_system_test.rb b/test/sandbox/test/view_component_system_test.rb index 067c345fe..263765b8c 100644 --- a/test/sandbox/test/view_component_system_test.rb +++ b/test/sandbox/test/view_component_system_test.rb @@ -34,14 +34,16 @@ def test_component_with_params end def test_components_with_slots - with_rendered_component_path(render_inline(SlotsComponent.new) do |component| - component.with_title do - "This is my title!" + assert_nothing_raised do + with_rendered_component_path(render_inline(SlotsComponent.new) do |component| + component.with_title do + "This is my title!" + end + end) do |path| + visit path + + find(".title", text: "This is my title!") end - end) do |path| - visit path - - find(".title", text: "This is my title!") end end From 3dff8ea720a2e57018034f804816ed7f13411186 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:40:24 -0700 Subject: [PATCH 4/8] opt into new timezone behavior --- test/sandbox/config/environments/test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sandbox/config/environments/test.rb b/test/sandbox/config/environments/test.rb index 43cd3b2d8..8896f7e96 100644 --- a/test/sandbox/config/environments/test.rb +++ b/test/sandbox/config/environments/test.rb @@ -54,4 +54,6 @@ config.action_view.annotate_rendered_view_with_filenames = true if Rails.version.to_f >= 6.1 config.eager_load = true + + config.active_support.to_time_preserves_timezone = :zone end From d6edae006bea8af71ffdbc22cb503a04881a90f9 Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:42:25 -0700 Subject: [PATCH 5/8] move propshaft --- view_component.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view_component.gemspec b/view_component.gemspec index da7591785..62492b1da 100644 --- a/view_component.gemspec +++ b/view_component.gemspec @@ -45,7 +45,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jbuilder", "~> 2" spec.add_development_dependency "m", "~> 1" spec.add_development_dependency "minitest", "~> 5.18" - spec.add_development_dependency "propshaft", "~> 1.1.0" spec.add_development_dependency "pry", "~> 0.13" spec.add_development_dependency "puma", "~> 6" spec.add_development_dependency "rake", "~> 13.0" @@ -73,5 +72,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bigdecimal" spec.add_development_dependency "drb" spec.add_development_dependency "mutex_m" + spec.add_development_dependency "propshaft", "~> 1.1.0" end end From 41faf4071f50235bee47661cbf96500c9c5efd9e Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:44:21 -0700 Subject: [PATCH 6/8] fix ci --- .github/workflows/lint.yml | 2 +- Gemfile | 4 ++-- Gemfile.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 759d69e7b..36b2b6faa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -70,7 +70,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: 3.4 - uses: actions/cache@v4 with: path: vendor/bundle diff --git a/Gemfile b/Gemfile index e0848eaa7..a16e443d5 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec -rails_version = (ENV["RAILS_VERSION"] || "~> 8.0.1").to_s +rails_version = (ENV["RAILS_VERSION"] || "~> 8").to_s gem "rails", (rails_version == "main") ? {git: "https://github.com/rails/rails", ref: "main"} : rails_version -ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4.1").to_s +ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4").to_s ruby ruby_version diff --git a/Gemfile.lock b/Gemfile.lock index 583ef968a..3bcb83aed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -382,7 +382,7 @@ DEPENDENCIES propshaft (~> 1.1.0) pry (~> 0.13) puma (~> 6) - rails (~> 8.0.1) + rails (~> 8) rake (~> 13.0) rspec-rails (~> 5) rubocop-md (~> 1) From f58b79323b9a49437b9759301aad13efd26d9efe Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:45:22 -0700 Subject: [PATCH 7/8] fix ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe4289f0e..36223c013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: 3.4 bundler-cache: true working-directory: 'view_component' - uses: actions/setup-node@v4 From a58458ba1505bace46eb2b89f811c27d21ba81fa Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Tue, 7 Jan 2025 15:48:06 -0700 Subject: [PATCH 8/8] one more --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36223c013..a274393a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: 3.4 bundler-cache: true - name: Run benchmarks run: | @@ -139,7 +139,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3 + ruby-version: 3.4 bundler-cache: true - name: Download coverage results uses: actions/download-artifact@v4.1.8