Skip to content

Add support for rendering ViewComponents with_content #89

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

Merged
merged 3 commits into from
Jun 24, 2021

Conversation

joelhawksley
Copy link
Contributor

This PR adds support for rendering ViewComponents with_content, which previously broke existing linters.

@joelhawksley joelhawksley requested a review from jhawthorn June 18, 2021 22:56
@@ -32,6 +28,10 @@ module RenderLiteralHelpers
(send nil? {:render :render_to_string} (send _ :new ...) ...)
PATTERN

def_node_matcher :render_view_component_instance_with_content?, <<-PATTERN
(send nil? {:render :render_to_string} (send (send _ :new ...) `:with_content ...))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could make this even more generic (if simpler). If anything has a new or a constant I'd be happy to consider it a view component and ignore it.

@joelhawksley joelhawksley merged commit 320115a into master Jun 24, 2021
@joelhawksley joelhawksley deleted the component-with-content branch June 24, 2021 22:41
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.

3 participants