Skip to content

Conversation

@joshblack
Copy link
Member

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

Changelog

New

  • Add new test file to make sure all exports from @primer/styled-react entrypoints are marked as deprecated and have a comment

Changed

  • Update exports from @primer/styled-react entrypoints to be marked as deprecated

Removed

Rollout strategy

  • Patch release

Copilot AI review requested due to automatic review settings December 2, 2025 18:39
@joshblack joshblack requested a review from a team as a code owner December 2, 2025 18:39
@joshblack joshblack requested a review from jonrohan December 2, 2025 18:39
@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

🦋 Changeset detected

Latest commit: 06911d6

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

This PR includes changesets to release 1 package
Name Type
@primer/styled-react 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

@github-actions github-actions bot added the staff Author is a staff member label Dec 2, 2025
@joshblack joshblack changed the title 6075 deprecate styled react feat(styled-react): add deprecated tags to exports Dec 2, 2025
@joshblack joshblack enabled auto-merge December 2, 2025 18:41
Copy link
Contributor

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 deprecates the @primer/styled-react package by adding @deprecated JSDoc tags to all exports across the main, experimental, and deprecated entrypoints. The deprecation guides users to migrate to CSS Modules and @primer/react components without the sx prop, or to use @primer/primitives for theming.

Key Changes

  • Added comprehensive @deprecated JSDoc comments to all exports in index.tsx, experimental.tsx, and deprecated.tsx
  • Created a new test file to programmatically verify all exports have deprecation tags and comments
  • Added changeset for patch release

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/styled-react/src/index.tsx Added @deprecated JSDoc comments to all 100+ exports with appropriate guidance messages
packages/styled-react/src/experimental.tsx Added @deprecated JSDoc comments to all experimental exports
packages/styled-react/src/deprecated.tsx Added @deprecated JSDoc comments to all deprecated exports
packages/styled-react/src/tests/deprecated-exports.test.ts New test file using TypeScript compiler API to validate all exports have deprecation tags and comments
.changeset/dull-books-fry.md Changeset documenting the deprecation changes for patch release


/**
* @deprecated Styling with the `sx` prop is no longer supported. Use CSS
* Modules instead
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Missing period at the end of the deprecation message. All other deprecation messages in this file end with a period for consistency. Should be "Use CSS Modules instead."

Suggested change
* Modules instead
* Modules instead.

Copilot uses AI. Check for mistakes.

/**
* @deprecated Styling with the `sx` prop is no longer supported. Use CSS
* Modules instead
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Missing period at the end of the deprecation message. All other deprecation messages in this file end with a period for consistency. Should be "Use CSS Modules instead."

Suggested change
* Modules instead
* Modules instead.

Copilot uses AI. Check for mistakes.
export {
/**
* @deprecated Styling with the `sx` prop is no longer supported. Use CSS
* Modules instead
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Missing period at the end of the deprecation message. All other deprecation messages in this file end with a period for consistency. Should be "Use CSS Modules instead."

Suggested change
* Modules instead
* Modules instead.

Copilot uses AI. Check for mistakes.
@joshblack joshblack added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 13effb8 Dec 2, 2025
49 checks passed
@joshblack joshblack deleted the 6075-deprecate-styled-react branch December 2, 2025 20:03
@primer primer bot mentioned this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants