Skip to content

feat: remove sx prop from Announce, AriaAlert, AriaStatus - #6806

Merged
joshblack merged 4 commits into
mainfrom
refactor/remove-sx-from-aria-announce-utils
Sep 12, 2025
Merged

feat: remove sx prop from Announce, AriaAlert, AriaStatus#6806
joshblack merged 4 commits into
mainfrom
refactor/remove-sx-from-aria-announce-utils

Conversation

@joshblack

@joshblackjoshblack commented Sep 8, 2025

Copy link
Copy Markdown
Member

Closes#6783
Closes#6782
Closes#6781

Remove the sx prop from our live region helper components. Also refactors our polymorphic types to (hopefully) make this transition from styled component wrappers (or Box components) easier 🤞

Changelog

New

  • Add new polymorphic props helper to make transition from Box/styled easier

Changed

Removed

  • Remove sx prop from Announce, AriaAlert, AriaStatus

Rollout strategy

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

There is no sx usage downstream so we can safely rollout this breaking change 🚀

CopilotAI review requested due to automatic review settings September 8, 2025 20:42
@joshblack
joshblack requested a review from a team as a code ownerSeptember 8, 2025 20:42
@changeset-bot

changeset-botBot commented Sep 8, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ac61422

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-actionsgithub-actionsBot added the staff Author is a staff member label Sep 8, 2025

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 sx prop from live region helper components (Announce, AriaAlert, AriaStatus) as part of transitioning away from styled components. The changes introduce a new polymorphic props helper to ease the migration from Box/styled components while maintaining type safety and component functionality.

Key changes:

  • Removes sx prop support from live region components
  • Introduces new PolymorphicProps type helper for better polymorphic component handling
  • Refactors component type definitions to use the new polymorphic pattern

Reviewed Changes

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

Show a summary per file
FileDescription
packages/react/src/live-region/Announce.tsxReplaces Box component with polymorphic implementation, removes sx prop support
packages/react/src/live-region/AriaAlert.tsxUpdates type definitions to use new PolymorphicProps helper, removes sx prop
packages/react/src/live-region/AriaStatus.tsxUpdates type definitions to use new PolymorphicProps helper, removes sx prop
packages/react/src/live-region/__tests__/Announce.test.tsxRemoves test case for sx prop functionality
.changeset/spotty-colts-hear.mdDocuments breaking change for major version release

@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 8, 2025
@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-actions

github-actionsBot commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.49 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js89.59 KB (+0.11% 🔺)

@primer-integration

Copy link
Copy Markdown

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

@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 12, 2025
@joshblack
joshblack added this pull request to the merge queueSep 12, 2025
Merged via the queue into main with commit 9d13904Sep 12, 2025
44 checks passed
@joshblack
joshblack deleted the refactor/remove-sx-from-aria-announce-utils branch September 12, 2025 15:52
@primerprimerBot mentioned this pull request Sep 12, 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/ghstaffAuthor is a staff member

Projects

None yet

3 participants

@joshblack@TylerJDev