Skip to content

refactor(styled-react): update structure to reduce merge conflicts - #6861

Merged
TylerJDev merged 11 commits into
mainfrom
refactor/add-structure-to-reduce-merge-conflicts
Sep 24, 2025
Merged

refactor(styled-react): update structure to reduce merge conflicts#6861
TylerJDev merged 11 commits into
mainfrom
refactor/add-structure-to-reduce-merge-conflicts

Conversation

@joshblack

Copy link
Copy Markdown
Member

Update the structure of packages/styled-react to reduce merge conflicts (potentially) by:

  • Splitting out components into their own files instead of in the main index.tsx files
  • Moving common dependencies (Box, SxProp, sx, SystemProps, etc) into files in packages/styled-react that will be where these will end up to reduce churn later on

It also exports the types from these components to make migration easier

@joshblack
joshblack requested a review from a team as a code ownerSeptember 16, 2025 17:46
@changeset-bot

changeset-botBot commented Sep 16, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 51b57ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblackjoshblack added the skip changeset This change does not need a changelog label Sep 16, 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 refactor restructures the packages/styled-react package by splitting component definitions from the main index file into separate component files, improving modularity and reducing potential merge conflicts.

  • Components (SegmentedControl, StateLabel, SubNav, ToggleSwitch) moved to individual files in components/ directory
  • Common dependencies (Box, SxProp, sx, SystemProps) extracted into dedicated utility files
  • Component types now exported from their respective modules for easier migration

Reviewed Changes

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

Show a summary per file
FileDescription
packages/styled-react/src/index.tsxUpdated to use re-exports from component modules instead of inline definitions
packages/styled-react/src/sx.tsNew file exporting sx utilities from @primer/react
packages/styled-react/src/styled-props.tsNew file defining StyledProps type and styled-system imports
packages/styled-react/src/components/Box.tsxNew file re-exporting Box component from @primer/react
packages/styled-react/src/components/SegmentedControl.tsxExtracted SegmentedControl component and types
packages/styled-react/src/components/StateLabel.tsxExtracted StateLabel component and types
packages/styled-react/src/components/SubNav.tsxExtracted SubNav component and types
packages/styled-react/src/components/ToggleSwitch.tsxExtracted ToggleSwitch component and types

@francineluccafrancinelucca 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.

👏

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6861 September 16, 2025 22:33 Inactive
@github-actionsgithub-actionsBot added the integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh label Sep 16, 2025
@github-actions
github-actionsBot requested a deployment to storybook-preview-6861 September 22, 2025 21:29 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6861 September 24, 2025 01:01 Inactive
@primer-integration

Copy link
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@TylerJDev
TylerJDev merged commit 9faa7e9 into mainSep 24, 2025
43 checks passed
@TylerJDev
TylerJDev deleted the refactor/add-structure-to-reduce-merge-conflicts branch September 24, 2025 11:53
llastflowers pushed a commit that referenced this pull request Sep 29, 2025
…6861)
Co-authored-by: Marie Lucca <francinelucca@github.com>
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/ghskip changesetThis change does not need a changelogstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@joshblack@jonrohan@francinelucca@TylerJDev