Skip to content

chore: Migrate from toggleSxComponent to BoxWithFallback helper - #6311

Merged
jonrohan merged 4 commits into
mainfrom
migrate_togglesxcomponent_boxwithfallback
Jul 14, 2025
Merged

chore: Migrate from toggleSxComponent to BoxWithFallback helper#6311
jonrohan merged 4 commits into
mainfrom
migrate_togglesxcomponent_boxwithfallback

Conversation

@jonrohan

@jonrohanjonrohan commented Jul 9, 2025

Copy link
Copy Markdown
Member

The BoxWithFallback model is our preferred method for handling components that might still pass sx props, so I'm migrating the remaining toggleSxComponent usages to the BoxWithFallback component.

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

CopilotAI review requested due to automatic review settings July 9, 2025 17:48
@jonrohan
jonrohan requested a review from a team as a code ownerJuly 9, 2025 17:48
@jonrohan
jonrohan requested a review from hectahertzJuly 9, 2025 17:48
@changeset-bot

changeset-botBot commented Jul 9, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4db7f06

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

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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

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 pull request migrates from the deprecated toggleSxComponent utility to the newer BoxWithFallback component throughout the codebase. The migration is part of a broader effort to standardize how components handle conditional sx props.

  • Removes the toggleSxComponent utility function and its tests
  • Updates all components to use BoxWithFallback instead of toggleSxComponent
  • Cleans up migration status tracking to remove toggleSxComponent detection

Reviewed Changes

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

Show a summary per file
FileDescription
script/styled-components-migration-status.mtsRemoves toggleSxComponent detection from migration tracking
packages/react/src/internal/utils/toggleSxComponent.tsxCompletely removes the toggleSxComponent utility function
packages/react/src/internal/utils/tests/toggleSxComponent.test.tsxRemoves all tests for the deleted utility
packages/react/src/TooltipV2/Tooltip.tsxMigrates from toggleSxComponent to BoxWithFallback
packages/react/src/Text/Text.tsxMigrates from toggleSxComponent to BoxWithFallback
packages/react/src/Popover/Popover.tsxMigrates from toggleSxComponent to BoxWithFallback and adds as prop to types
packages/react/src/PageHeader/PageHeader.tsxMigrates multiple components from toggleSxComponent to BoxWithFallback
packages/react/src/Breadcrumbs/Breadcrumbs.tsxMigrates from toggleSxComponent to BoxWithFallback

@github-actionsgithub-actionsBot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 9, 2025
@github-actions

Copy link
Copy Markdown
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-actionsBot commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js91.94 KB (-0.08% 🔽)
packages/react/dist/browser.umd.js92.17 KB (-0.14% 🔽)

@primer-integration

Copy link
Copy Markdown

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

@github-actionsgithub-actionsBot 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 Jul 9, 2025
@primer-integration

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@github-actionsgithub-actionsBot 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 Jul 10, 2025
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 10, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@jonrohan
jonrohan enabled auto-merge July 10, 2025 20:46
@jonrohanjonrohan removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 10, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6311 July 10, 2025 20:46 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6311 July 10, 2025 20:56 Inactive

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

🚀

@jonrohan
jonrohan added this pull request to the merge queueJul 14, 2025
Merged via the queue into main with commit db0b27aJul 14, 2025
@jonrohan
jonrohan deleted the migrate_togglesxcomponent_boxwithfallback branch July 14, 2025 17:05
@primerprimerBot mentioned this pull request Jul 14, 2025
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/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jonrohan@hectahertz