diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe4289f0e..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: | @@ -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 @@ -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 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/.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..a16e443d5 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").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").to_s ruby ruby_version diff --git a/Gemfile.lock b/Gemfile.lock index 80b88e0a3..3bcb83aed 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) @@ -116,7 +124,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) @@ -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) 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/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 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 diff --git a/view_component.gemspec b/view_component.gemspec index b443e86e6..62492b1da 100644 --- a/view_component.gemspec +++ b/view_component.gemspec @@ -72,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