Skip to content

Deprecate AvatarPair component - move to @primer/react/deprecated while maintaining backward compatibility #6468

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

Merged
merged 10 commits into from
Aug 12, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 6, 2025

This PR deprecates the AvatarPair component by moving it to the deprecated exports location, adding appropriate deprecation warnings, and removing all internal usage of the component within the repository. The component remains available from both the main package and deprecated package to avoid breaking changes.

Changes Made

Component Migration

  • Moved src/AvatarPair/src/deprecated/AvatarPair/
  • Updated internal import paths to work from the new location (../../Avatar, ../../SkeletonAvatar)
  • Added @deprecated JSDoc comments to both the component and prop types

Export Updates

  • Added AvatarPair exports to src/deprecated/index.ts with deprecation comments
  • Added AvatarPair exports to main src/index.ts with deprecation comment to maintain backward compatibility
  • Component available from both import paths for existing users

Internal Usage Removal

  • Removed AvatarPair from e2e test generation script
  • Removed InAnAvatarPair story from SkeletonAvatar features
  • Removed AvatarPair test reference from Skeletons e2e tests
  • Deleted AvatarPair e2e test file
  • Deleted results.json file (build artifact)
  • Updated test snapshots and documentation references

Deprecation Notices

Both the component and its prop types include deprecation warnings:

/**
 * @deprecated AvatarPair is deprecated. Please see https://github.com/github/primer/issues/5533 for migration guidance.
 */

Migration Path for Users

Current (no breaking change):

import { AvatarPair } from '@primer/react'

Alternative (explicit deprecated import):

import { AvatarPair } from '@primer/react/deprecated'

Users can continue using their existing import paths without any breaking changes, but will receive TypeScript/IDE deprecation warnings guiding them to the migration issue for alternatives.

Validation

  • ✅ Build passes successfully
  • ✅ TypeScript definitions include deprecation warnings
  • ✅ Component available from both main and deprecated export paths
  • ✅ No breaking changes for existing users
  • ✅ No internal usage of AvatarPair remains in the codebase
  • ✅ All files properly linted and formatted
  • ✅ Latest main branch changes merged

Closes https://github.com/github/primer/issues/5533


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI assigned Copilot and pksjce Aug 6, 2025
Copy link

changeset-bot bot commented Aug 6, 2025

🦋 Changeset detected

Latest commit: ab977f5

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@Copilot Copilot AI changed the title [WIP] Deprecate AvatarPair component and move to deprecated folder Deprecate AvatarPair component - move to @primer/react/deprecated Aug 6, 2025
@Copilot Copilot AI requested a review from pksjce August 6, 2025 03:31
Copilot finished work on behalf of pksjce August 6, 2025 03:31
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 6, 2025
Copy link
Contributor

github-actions bot commented Aug 6, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@pksjce
Copy link
Contributor

pksjce commented Aug 6, 2025

@copilot - Remove usage of AvatarPair in this repo

Copy link
Contributor

github-actions bot commented Aug 6, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.28 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 90.44 KB (+0.06% 🔺)

@github-actions github-actions bot requested a deployment to storybook-preview-6468 August 6, 2025 05:28 Abandoned
@pksjce
Copy link
Contributor

pksjce commented Aug 6, 2025

@copilot - Update imports in all the files in AvatarPair

Copy link
Contributor Author

Copilot AI commented Aug 6, 2025

@copilot - Remove usage of AvatarPair in this repo

Completed! I've removed all usage of AvatarPair from the repository codebase:

  • Removed from e2e test generation script
  • Removed usage from SkeletonAvatar feature stories (the InAnAvatarPair story)
  • Deleted the AvatarPair e2e test file
  • Updated test snapshots and documentation references
  • All builds and tests now pass

The AvatarPair component itself remains available in the deprecated exports for users who need it. Commit: 0857415

@Copilot Copilot AI changed the title Deprecate AvatarPair component - move to @primer/react/deprecated Deprecate AvatarPair component - move to @primer/react/deprecated and remove internal usage Aug 6, 2025
Copilot finished work on behalf of pksjce August 6, 2025 05:38
},
],
},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this now or when we remove the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the AvatarPair entry from the e2e test generation script as part of deprecation since we're removing all internal usage. This helps maintain consistency - the component is deprecated and should not have new e2e tests generated. Commit: 3b760cb

results.json Outdated
@@ -0,0 +1 @@
[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the results.json file as requested. Commit: 3b760cb

pksjce and others added 2 commits August 6, 2025 15:48
Deprecate AvatarPair component and move to @primer/react/deprecated
@pksjce pksjce marked this pull request as ready for review August 6, 2025 05:48
@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 05:48
@pksjce pksjce requested a review from a team as a code owner August 6, 2025 05:48
@pksjce pksjce requested a review from joshblack August 6, 2025 05:48
Copy link
Contributor Author

Copilot AI commented Aug 6, 2025

@copilot - Update imports in all the files in AvatarPair

Fixed! I've updated all the incorrect import paths in the AvatarPair files:

  • Fixed Avatar imports in story files: ../Avatar../../Avatar
  • Fixed AvatarPair import in figma file: ../../src./AvatarPair

All files now have correct import paths after the component was moved to the deprecated folder. Build and TypeScript checks pass successfully. Commit: dc6ee83

@github-actions github-actions bot temporarily deployed to storybook-preview-6468 August 6, 2025 09:31 Inactive
@@ -0,0 +1,5 @@
---
"@primer/react": minor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a major if we're no longer exporting through the main entrypoint

Copy link
Contributor

@pksjce pksjce Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm major would be removing it from the codebase no? But I get it. How does this go into v38 then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot - Export AvatarPair from both deprecated and main package so that we don't make a breaking change. Merge latest into the PR before you do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added AvatarPair exports to both the main package and deprecated package to avoid breaking changes. The component is now available from both import paths:

  • import { AvatarPair } from '@primer/react' (with deprecation warning)
  • import { AvatarPair } from '@primer/react/deprecated' (with deprecation warning)

This allows existing users to continue using their current import path without breaking changes while still providing deprecation warnings. Commit: f527ee9

Copilot AI and others added 2 commits August 7, 2025 12:55
…f8e6-4b27-89f4-f89e53bd5015

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@Copilot Copilot AI changed the title Deprecate AvatarPair component - move to @primer/react/deprecated and remove internal usage Deprecate AvatarPair component - move to @primer/react/deprecated while maintaining backward compatibility Aug 7, 2025
@Copilot Copilot AI requested a review from pksjce August 7, 2025 13:01
Copilot finished work on behalf of pksjce August 7, 2025 13:01
@github-actions github-actions bot temporarily deployed to storybook-preview-6468 August 7, 2025 22:24 Inactive
@pksjce
Copy link
Contributor

pksjce commented Aug 8, 2025

@copilot - Update snapshots

Copy link
Contributor Author

Copilot AI commented Aug 8, 2025

@copilot - Update snapshots

Updated the test snapshots to include the new AvatarPair and AvatarPairProps exports. The exports test now passes successfully. Commit: ea6c23d

@pksjce pksjce requested a review from francinelucca August 11, 2025 22:48
@pksjce pksjce enabled auto-merge August 12, 2025 02:48
@pksjce pksjce added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit 1f531cb Aug 12, 2025
39 checks passed
@pksjce pksjce deleted the copilot/fix-725496f0-f8e6-4b27-89f4-f89e53bd5015 branch August 12, 2025 16:46
@primer primer bot mentioned this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants