Skip to content

Remove support for sx from CounterLabel component - #6679

Merged
llastflowers merged 8 commits into
mainfrom
llastflowers/5783/no-sx-CounterLabel
Sep 22, 2025
Merged

Remove support for sx from CounterLabel component#6679
llastflowers merged 8 commits into
mainfrom
llastflowers/5783/no-sx-CounterLabel

Conversation

@llastflowers

@llastflowersllastflowers commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

Closeshttps://github.com/github/primer/issues/5783

Current sx usage: 5

❌ Still need to separately update github-ui components to use @primer/styled-react
github/github-ui PR: https://github.com/github/github-ui/pull/1870

Changelog

Removed

Remove support for sx from the CounterLabel component, and associated stories, docs, and tests

Rollout strategy

  • Major release; if selected, include a written rollout or migration plan

We are using the @primer/styled-react component to mitigate removing sx usage. We will make sure usage is updated upstream before merging.

Merge checklist

@llastflowersllastflowers self-assigned this Aug 27, 2025
@changeset-bot

changeset-botBot commented Aug 27, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 984fbd5

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

This PR includes changesets to release 2 packages
NameType
@primer/reactMajor
@primer/styled-reactMajor

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

Copy link
Copy Markdown
Contributor

👋 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!

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 27, 2025
@github-actions

github-actionsBot commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.55 KB (+0.04% 🔺)
packages/react/dist/browser.umd.js89.61 KB (-0.01% 🔽)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6679 August 27, 2025 18:48 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6679 August 27, 2025 18:57 Inactive
@llastflowers
llastflowers marked this pull request as ready for review September 5, 2025 16:57
CopilotAI review requested due to automatic review settings September 5, 2025 16:57
@llastflowers
llastflowers requested a review from a team as a code ownerSeptember 5, 2025 16:57

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 removes the deprecated sx prop support from the CounterLabel component as part of the migration away from styled-components to a more modern CSS-in-JS approach. The changes align with the broader effort to eliminate sx prop usage across Primer React components.

  • Removes sx prop from CounterLabel component interface and implementation
  • Replaces BoxWithFallback wrapper with native span element
  • Updates component documentation to reflect API changes

Reviewed Changes

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

FileDescription
packages/react/src/CounterLabel/CounterLabel.tsxRemoves SxProp type, BoxWithFallback wrapper, and simplifies to native span element
packages/react/src/CounterLabel/CounterLabel.docs.jsonRemoves deprecated sx prop from component documentation
.changeset/sharp-papayas-destroy.mdAdds changeset entry documenting the breaking change for major release

@siddharthkpsiddharthkp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

Approving, merge whenever the supporting PR is ready!

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/2766

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@github-actionsgithub-actionsBot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 17, 2025
@llastflowers
llastflowers added this pull request to the merge queueSep 22, 2025
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to a conflict with the base branch Sep 22, 2025
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 22, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 22, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@llastflowers
llastflowers added this pull request to the merge queueSep 22, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6679 September 22, 2025 17:55 Inactive
Merged via the queue into main with commit 6158135Sep 22, 2025
42 checks passed
@llastflowers
llastflowers deleted the llastflowers/5783/no-sx-CounterLabel branch September 22, 2025 17:59
@primerprimerBot mentioned this pull request Sep 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghintegration-tests: recommendedThis 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.

3 participants

@llastflowers@siddharthkp