Skip to content

Conversation

@BlakeWilliams
Copy link
Contributor

Summary

This extracts the template compiling logic from the base class to help reduce
ViewComponent::Bases public API. This should hopefully make it easier to
modify the template compilation logic by separating it from the base class
logic.

Other Information

There may be a breaking change or two hidden in this PR, such as
ViewComponent::Base no longer having variants defined on it. I don't think
that many components would have relied on that method being callable, but worth
discussing if it should be supported.

@BlakeWilliams BlakeWilliams marked this pull request as ready for review October 16, 2020 01:35

attr_reader :component_class

def define_render_template_for
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might be the only introduction of new code here, but this gives us a small performance boost by letting us avoid having to call send to render the correct template in the component.

@joelhawksley joelhawksley merged commit eda4782 into master Oct 16, 2020
@joelhawksley joelhawksley deleted the bmw/compiler branch October 16, 2020 20:47
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