-
Notifications
You must be signed in to change notification settings - Fork 639
chore: cleanup sx prop #7032
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
chore: cleanup sx prop #7032
Conversation
🦋 Changeset detectedLatest commit: 2af81e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
👋 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! |
…chore/cleanup-sx-prop
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/4983 |
🟢 ci completed with status |
There was a problem hiding this 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 implements a cleanup of the sx
prop functionality by reorganizing its location and removing certain exports from the main @primer/react
package. The changes are part of a deprecation strategy where sx
prop functionality is being consolidated in the @primer/styled-react
package while being removed from the primary React package.
Key changes:
- Moves
sx
prop implementation from@primer/react
to@primer/styled-react
package - Removes
sx
,SxProp
,merge
, and related type exports from@primer/react
- Adds
ThemeColorPaths
andThemeShadowPaths
type exports to@primer/react
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/styled-react/src/sx.ts |
Replaces simple re-export with full sx prop implementation including types and utilities |
packages/styled-react/src/styled-props.ts |
Removes BetterSystemStyleObject export that's now available from sx.ts |
packages/styled-react/src/index.tsx |
Updates exports to include merge and BetterSystemStyleObject from local sx module |
packages/styled-react/src/components/*.tsx |
Updates import statements to use local sx and SxProp instead of importing from @primer/react |
packages/react/src/sx.ts |
Removes merge import and export since it's no longer needed |
packages/react/src/index.ts |
Removes sx related exports and adds theme type exports |
packages/react/src/__tests__/__snapshots__/exports.test.ts.snap |
Updates snapshot to reflect removed and added exports |
.changeset/mean-kangaroos-count.md |
Documents the breaking changes for versioning |
import {CircleBadge as PrimerCircleBadge, type CircleBadgeProps as PrimerCircleBadgeProps} from '@primer/react' | ||
import styled from 'styled-components' | ||
import {type ForwardRefComponent} from '../polymorphic' | ||
import sx, {type SxProp} from '../sx' |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import should use named import for consistency. Change import sx, {type SxProp}
to import {sx, type SxProp}
to match the pattern used in other component files.
import sx, {type SxProp} from '../sx' | |
import {sx, type SxProp} from '../sx' |
Copilot uses AI. Check for mistakes.
Changelog
New
Removed
Rollout strategy
Testing & Reviewing
Merge checklist