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

Support for ViewComponent v3 #277

Closed
Spone opened this issue Feb 28, 2023 · 6 comments · Fixed by #296
Closed

Support for ViewComponent v3 #277

Spone opened this issue Feb 28, 2023 · 6 comments · Fixed by #296
Labels
enhancement New feature or request

Comments

@Spone
Copy link

Spone commented Feb 28, 2023

Hello! I'd like to know if you're planning on supporting ViewComponent v3. There are currently two release candidates (v3.0.0.rc1 and v3.0.0.rc2) that you can try out.

I think the deprecation slots setter methods will generate the most work (you have to use with_SLOT_NAME instead).
I'm currently exploring the idea of providing a linter/codemod to help with this: ViewComponent/view_component#1669

Would you be interested in trying it out and providing feedback?

@kirillplatonov
Copy link
Collaborator

Hey @Spone,

Yeah, we plan to upgrade. The codemod for slots looks very useful. I will try it out when I'll be working on upgrade 👍

@kirillplatonov kirillplatonov added the enhancement New feature or request label Apr 25, 2023
@kirillplatonov
Copy link
Collaborator

@Spone I just used it during the upgrade to ViewCompoent v3 and it was extremely useful. We had only 3 false positive warnings on our codebase:

File: /Users/kirill/Code/polaris_view_components/app/components/polaris/base_radio_button.rb
=> line 32: maybe replace `.radio_button` with `.with_radio_button`

File: /Users/kirill/Code/polaris_view_components/app/components/polaris/page_component.html.erb
=> line 70: maybe replace `.action` with `.with_action`

File: /Users/kirill/Code/polaris_view_components/app/components/polaris/resource_item/shortcut_actions_component.html.erb
=> line 16: maybe replace `.action` with `.with_action`

All of them are custom methods that start from the same name as a slot. It would be very helpful to see this as a part of ViewComponent. Thanks for your work on this ❤️

@kirillplatonov
Copy link
Collaborator

@Spone until https://github.com/ViewComponent/view_component/pull/1669/files is not merged would you mind if I include this codemod to our gem as a rake task? This will help to upgrade apps that are relying on our library

@Spone
Copy link
Author

Spone commented Apr 29, 2023

@kirillplatonov I have a counteroffer 😀 work with me to get the PR past the finish line and get it merged in VC!

@kirillplatonov
Copy link
Collaborator

@Spone I'm in 🙌

@Spone
Copy link
Author

Spone commented Apr 29, 2023

I'll get in touch with you next week!

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

Successfully merging a pull request may close this issue.

2 participants