Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Remove respond_to? check #2202

Draft
wants to merge 15 commits into
base: v4
Choose a base branch
from
Draft

[WIP] Remove respond_to? check #2202

wants to merge 15 commits into from

Conversation

tiagomenegaz
Copy link
Collaborator

@tiagomenegaz tiagomenegaz commented Feb 4, 2025

What are you trying to accomplish?

This PR removes respond_to? from the following files:

  • app/controllers/concerns/view_component/preview_actions.rb
  • lib/view_component/base.rb
  • lib/view_component/collection.rb
  • lib/view_component/slotable.rb
  • lib/view_component/slotable_default.rb
  • lib/view_component/translatable.rb
  • test/sandbox/test/rendering_test.rb
  • test/sandbox/test/slotable_test.rb
  • view_component.gemspec

What approach did you choose and why?

Some checks aren't necessary because we don't support discontinued Ruby versions and the code can be written without respond_to?.

Anything you want to highlight for special attention from reviewers?

I noticed that some respond_to? are being used to support ruby2_keywords. I'm assuming it exists because we want to support old ruby versions. However, based on the gemfile - ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4").to_s - we don't support Ruby 2 anymore. I'll address these keywords in a different PR.

@tiagomenegaz tiagomenegaz self-assigned this Feb 4, 2025
@tiagomenegaz tiagomenegaz changed the base branch from main to v4 February 4, 2025 22:27
@tiagomenegaz tiagomenegaz changed the title [WIP] Remove respond to [WIP] Remove respond_to? check Feb 4, 2025
@tiagomenegaz tiagomenegaz removed the request for review from joelhawksley February 8, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant