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

Upgrade phlex to 2.0.2 version #223

Merged
merged 2 commits into from
Feb 17, 2025
Merged

Conversation

karinevieira
Copy link
Contributor

I upgraded the Phlex gem to version 2.0.2, but during the process, the tests started failing with the following error:

ArgumentError: unknown keyword: :view_context
/Users/karinevieira/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/phlex-2.0.2/lib/phlex/sgml.rb:46:in call' test/test_helper.rb:22:in render'
test/test_helper.rb:26:in `phlex'

After investigating the codebase, I found that support for nil values seems to have been removed.

Additionally, according to the docs, view_context is only required in the context of Rails applications, which is not our case. Given that, I removed it.

After making this change, the tests started passing again, but I’m not entirely sure if this is the best approach. Any thoughts?

With the upgrade, view_context is only required in Rails applications. Since our use case doesn’t require Rails-specific view helpers, we no longer need to pass view_context.
Copy link
Collaborator

@cirdes cirdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karinevieira , It looks good. The ComponentTest is just a class to help us test our code. If it is passing, it should be fine.

@cirdes cirdes merged commit 8152bef into ruby-ui:main Feb 17, 2025
2 checks passed
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.

2 participants