Skip to content

Conversation

@joshblack
Copy link
Member

Update how we re-export components so that TypeScript mirrors what end consumers see

Changelog

New

  • Add ToggleSwitchProps type to package exports

Changed

  • Update entrypoints in styled-react to be .tsx files
  • Add new override strategy for components to mirror their original type in @primer/react
  • Update build process for styled-react to appropriately build React components

Removed

Rollout strategy

  • Minor release

Copilot AI review requested due to automatic review settings September 4, 2025 17:21
@joshblack joshblack requested a review from a team as a code owner September 4, 2025 17:21
@joshblack joshblack requested a review from jonrohan September 4, 2025 17:21
@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2025

🦋 Changeset detected

Latest commit: e84b0e5

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

This PR includes changesets to release 2 packages
Name Type
@primer/styled-react Major
@primer/react Minor

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 Sep 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

👋 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-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 4, 2025
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 refactors the styled-react package to improve TypeScript type exports and component re-export strategy. The main purpose is to update how components are re-exported so that TypeScript mirrors what end consumers see, specifically for the ToggleSwitch component.

Key changes include:

  • Adding ToggleSwitchProps type export to @primer/react package
  • Implementing a new component override strategy in styled-react using .tsx files instead of .ts
  • Updating the build process to properly handle React components in the styled-react package

Reviewed Changes

Copilot reviewed 13 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/styled-react/src/index.tsx Implements new ToggleSwitch component wrapper with proper type overrides
packages/styled-react/rollup.config.js Updates build configuration to handle .tsx files and React presets
packages/styled-react/package.json Adds React preset dependency for build process
packages/react/src/index.ts Exports ToggleSwitchProps type for external consumption
packages/styled-react/src/tests/exports.test.ts Sorts export arrays for consistent snapshot testing
eslint.config.mjs Adds styled-react polymorphic types to ignore list

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 87.97 KB (0%)
packages/react/dist/browser.umd.js 88.08 KB (0%)

@github-actions github-actions bot temporarily deployed to storybook-preview-6726 September 4, 2025 18:22 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR 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 4, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6726 September 5, 2025 18:14 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6726 September 5, 2025 18:27 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-6726 September 5, 2025 18:33 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6726 September 5, 2025 18:43 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-6726 September 8, 2025 15:33 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6726 September 8, 2025 15:40 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6726 September 8, 2025 15:49 Inactive
@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Sep 8, 2025
@joshblack joshblack added this pull request to the merge queue Sep 8, 2025
Merged via the queue into main with commit 50c230f Sep 8, 2025
44 checks passed
@joshblack joshblack deleted the refactor/update-styled-react-entrypoint branch September 8, 2025 16:38
@primer primer bot mentioned this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants