Skip to content

Conversation

@liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Aug 20, 2025

Migrates the Truncate component away from BoxWithFallback components and sx prop support to use CSS modules, Closes #4822

  • Note: Multiple repos are using Truncate with sx props including github/github-ui.

Rollout strategy

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

@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2025

🦋 Changeset detected

Latest commit: a5bd7a9

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

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

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
Copy link
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-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 20, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6632 August 20, 2025 23:07 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Aug 20, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.74 KB (-0.03% 🔽)
packages/react/dist/browser.umd.js 90.12 KB (+0.13% 🔺)

@primer-integration
Copy link

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

@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 Aug 21, 2025
@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot temporarily deployed to storybook-preview-6632 August 25, 2025 18:46 Inactive
@liuliu-dev liuliu-dev marked this pull request as ready for review August 25, 2025 19:51
Copilot AI review requested due to automatic review settings August 25, 2025 19:51
@liuliu-dev liuliu-dev requested a review from a team as a code owner August 25, 2025 19:51
@liuliu-dev liuliu-dev requested a review from joshblack August 25, 2025 19:51
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 migrates the Truncate component from using BoxWithFallback and sx props to CSS modules as part of the design system modernization effort. This is a breaking change that removes styled-system dependencies.

  • Removes sx prop support and MaxWidthProps from Truncate component
  • Replaces BoxWithFallback with direct component rendering using polymorphic as prop
  • Creates a styled wrapper in @primer/styled-react package to maintain backward compatibility

Reviewed Changes

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

Show a summary per file
File Description
packages/react/src/Truncate/Truncate.tsx Main component migration removing sx props and BoxWithFallback
packages/styled-react/src/index.ts Adds styled wrapper for Truncate to maintain backward compatibility
packages/react/src/ActionList/Description.tsx Removes sx prop usage from Truncate component
packages/react/src/Truncate/Truncate.stories.tsx Removes sx prop from Storybook controls
packages/react/src/Truncate/Truncate.docs.json Updates documentation to reflect API changes
packages/styled-react/src/__tests__/__snapshots__/exports.test.ts.snap Updates test snapshot for export changes
.changeset/lucky-facts-obey.md Changeset documenting the breaking change

@liuliu-dev
Copy link
Contributor Author

integration checks manually ran here: https://github.com/github/github-ui/pull/1180

@github-actions github-actions bot temporarily deployed to storybook-preview-6632 August 26, 2025 18:55 Inactive
@liuliu-dev liuliu-dev added this pull request to the merge queue Aug 26, 2025
Merged via the queue into main with commit 3d25154 Aug 26, 2025
42 of 43 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/migrate-truncate branch August 26, 2025 19:18
@primer primer bot mentioned this pull request Aug 26, 2025
joshblack added a commit that referenced this pull request Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failing Changes in this PR cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants