-
Notifications
You must be signed in to change notification settings - Fork 129
use ViewComponent 4.0.0.rc1 #3562
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
Conversation
🦋 Changeset detectedLatest commit: fd105ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Pull Request Overview
This PR updates Primer View Components to use ViewComponent 4.0.0.alpha7 and adapts a slot helper method to the new API.
- Bump
view_component
dependency from alpha6 to alpha7 in both root and demo Gemfiles. - Replace
define_slot
call with the new__vc_define_slot
in theexperimental_slot_helpers
file.
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
demo/Gemfile | Updated view_component gem version to alpha7 |
Gemfile | Updated view_component gem version to alpha7 |
app/lib/primer/experimental_slot_helpers.rb | Swapped define_slot for __vc_define_slot call |
Comments suppressed due to low confidence (2)
app/lib/primer/experimental_slot_helpers.rb:16
- Add or update tests covering the new
__vc_define_slot
behavior to verify that polymorphic slots are registered correctly under the updated ViewComponent API.
poly_def = __vc_define_slot(
app/lib/primer/experimental_slot_helpers.rb:16
- Ensure that
__vc_define_slot
is defined or imported correctly; ifdefine_slot
was renamed in the new ViewComponent API, add the appropriate alias or require statement to prevent undefined method errors.
poly_def = __vc_define_slot(
@@ -13,7 +13,7 @@ def add_polymorphic_slot_type(slot_name:, type:, callable:) | |||
slot_def = registered_slots[slot_name] | |||
raise "Unknown slot '#{slot_name}'" unless slot_def | |||
|
|||
poly_def = define_slot( | |||
poly_def = __vc_define_slot( |
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.
@joelhawksley is there any plan on eventually turning __vc_define_slot
and __vc_set_slot
into public APIs so consumers of ViewComponents can do things like this? Just curious
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.
@marcelolx I'm pretty hesitant to do so, but if there were other use cases I'd consider them. Feel free to file something on the ViewComponent repo!
What are you trying to accomplish?
This PR integrates PVC with ViewComponent 4.0.0.rc1. This should be released in GitHub.com in concert with the ViewComponent release.