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

ViewComponent v4 #1855

Open
2 of 7 tasks
camertron opened this issue Sep 20, 2023 · 6 comments
Open
2 of 7 tasks

ViewComponent v4 #1855

camertron opened this issue Sep 20, 2023 · 6 comments
Labels

Comments

@camertron
Copy link
Contributor

camertron commented Sep 20, 2023

Potential ideas for v4 of the framework

@reeganviljoen
Copy link
Collaborator

@camertron can we please consider adding #1898 to this list

@collimarco
Copy link

Can we please also consider to add helpers to provide a short, compact syntax that is easier to write / read (syntactic sugar)?

https://answers.abstractbrain.com/using-rails-helpers-x-component-for-rendering-viewcomponents

The helpers would be an addition, they don't remove the traditional way, if you want to keep using it. I think that they are aligned with the Rails philosophy and are similar to the Rails view helpers and Rails routing helpers.

@BlakeWilliams
Copy link
Contributor

@collimarco That's not something we're targeting for a potential v4 release at the moment given the past discussion and identified trade-offs. If you or others feel passionate about it, I'd recommend creating a gem to help prove out the value and demand of that functionality to make a case for upstreaming.

@collimarco
Copy link

@BlakeWilliams Ok, thanks for the reply. Would you mind pointing me to the discussion with the "identified trade-offs"? This is the only issue that I found, but it seems that the downsides listed there have been resolved.

@reeganviljoen
Copy link
Collaborator

@camertron @joelhawksley @boardfish @BlakeWilliams (sorry If I left anyone out) I have been thinking about #1848 and I thought maybe adding a config that disables the use of helpers through helpers.<helper_name> and forces you to use use_helpers <helper_name> when you need helpers

Maybe config.view_component.use_strict_helpers = true

This can help in developers that wish to make it easier to reason when using global state as is the intention with #1848

If you have any thoughts please let me know, so I know if i should pursue this in a separate issue

@reeganviljoen
Copy link
Collaborator

@camertron @joelhawksley @boardfish @BlakeWilliams (sorry If I left anyone out) I have been thinking about #1848 and I thought maybe adding a config that disables the use of helpers through helpers.<helper_name> and forces you to use use_helpers <helper_name> when you need helpers

Maybe config.view_component.use_strict_helpers = true

This can help in developers that wish to make it easier to reason when using global state as is the intention with #1848

If you have any thoughts please let me know, so I know if i should pursue this in a separate issue

I have made this its own issue in #1976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants