-
Couldn't load subscription status.
- Fork 639
refactor(styled-react): update how we re-export components #6726
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
Conversation
🦋 Changeset detectedLatest commit: e84b0e5 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! |
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 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
ToggleSwitchPropstype export to@primer/reactpackage - Implementing a new component override strategy in
styled-reactusing.tsxfiles instead of.ts - Updating the build process to properly handle React components in the
styled-reactpackage
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 |
size-limit report 📦
|
…primer/react into refactor/update-styled-react-entrypoint
…primer/react into refactor/update-styled-react-entrypoint
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/1972 |
|
🟢 ci completed with status |
Update how we re-export components so that TypeScript mirrors what end consumers see
Changelog
New
ToggleSwitchPropstype to package exportsChanged
styled-reactto be.tsxfiles@primer/reactstyled-reactto appropriately build React componentsRemoved
Rollout strategy