-
Notifications
You must be signed in to change notification settings - Fork 26
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
Prepare for ViewComponents #1749
base: main
Are you sure you want to change the base?
Conversation
nimmolo
commented
Dec 27, 2023
•
edited
edited
- add the gems for ViewComponents
- add gems for the seemingly-improved EvilMartians defaults
- add base components to the /views/components folder
- rubocop the changes
Update: No urgency. Folder re-org in #1753 |
@@ -165,4 +165,10 @@ def get_next_id(object) | |||
|
|||
query.result_ids[idx + 1] || query.result_ids[idx - 1] | |||
end | |||
|
|||
# make View components easier to call | |||
def component(name, *args, **kwargs, &block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on how you and others feel about all-arguments forwarding,
the following should work here. Your choice:
def component(name, *args, **kwargs, &block) | |
def component(name, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it briefly locally without problems.
It looks like it may take some getting used to the conventions.
@JoeCohen Thanks for checking it out. Other than finding things in Converting re-usable partials and helpers to components does mean getting used to some different conventions for sure. I'm thinking to start with heavily used components where there would be an immediate benefit in performance: images, carousels, and matrix boxes. But those would all be separate PRs, one at a time. |