Skip to content

Conversation

joelhawksley
Copy link
Contributor

@joelhawksley joelhawksley commented Jun 19, 2025

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.

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 18:54
@joelhawksley joelhawksley requested a review from a team as a code owner June 19, 2025 18:54
@joelhawksley joelhawksley requested a review from TylerJDev June 19, 2025 18:54
Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: fd105ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

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

Copy link

@Copilot Copilot AI left a 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 the experimental_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; if define_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(

@joelhawksley joelhawksley changed the title use ViewComponent 4.0.0.alpha7 use ViewComponent 4.0.0.rc1 Jun 23, 2025
@joelhawksley joelhawksley added this pull request to the merge queue Jun 23, 2025
Merged via the queue into main with commit 8686a5d Jun 23, 2025
30 checks passed
@joelhawksley joelhawksley deleted the vc-4.0.0.alpha7-compat branch June 23, 2025 13:45
@primer primer bot mentioned this pull request Jun 19, 2025
@@ -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(

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

Copy link
Contributor Author

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!

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

Successfully merging this pull request may close these issues.

3 participants