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

Compiler for ViewComponent::Slotable #1864

Closed

Conversation

franklinhu
Copy link

Motivation

Rails projects that use Tapioca often also use ViewComponents to encapsulate view behavior. ViewComponents supports composition through "slots" to render other ViewComponent classes.

Implementation

  • Adds a Tapioca compiler that looks at ViewComponent::Slotable's registered slots that are defined via DSL

Tests

  • Adds some tests for basic usages of ViewComponent with renders_one and renders_many

@franklinhu franklinhu requested a review from a team as a code owner April 10, 2024 23:14
@franklinhu
Copy link
Author

I have signed the CLA!

@KaanOzkan
Copy link
Contributor

Hey @franklinhu, thank you for this PR but unfortunately every new DSL compiler inside tapioca is another feature that we have to maintain moving forward. So we try to keep the compilers to DSL's that are commonly used within Shopify. As a result, I will be declining this PR. I see the value here and I suggest moving it to a separate gem or ideally within view_components repo for visibility for other tapioca users.

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