Skip to content

Remove sx props and BoxWithFallback from TooltipV2 and Tooltip - #6667

Merged
liuliu-dev merged 18 commits into
mainfrom
liuliu/migrate-tooltip
Oct 1, 2025
Merged

Remove sx props and BoxWithFallback from TooltipV2 and Tooltip#6667
liuliu-dev merged 18 commits into
mainfrom
liuliu/migrate-tooltip

Conversation

@liuliu-dev

@liuliu-devliuliu-dev commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

Wait until this PR is merged in github-ui: https://github.com/github/github-ui/pull/3366

Closes#5769
0 repo are still using sx props with Tooltip .

Changelog

Removed

Removed sx props from deprecated Tooltip and TooltipV2

Rollout strategy

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

@changeset-bot

changeset-botBot commented Aug 25, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e7d506a

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

This PR includes changesets to release 2 packages
NameType
@primer/reactMajor
@primer/styled-reactMajor

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

github-actionsBot commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.86 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js89.95 KB (-0.06% 🔽)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6667 August 26, 2025 22:01 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review August 26, 2025 22:47
CopilotAI review requested due to automatic review settings August 26, 2025 22:47
@liuliu-dev
liuliu-dev requested a review from a team as a code ownerAugust 26, 2025 22:47

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 PR removes the deprecated sx prop support from both Tooltip and TooltipV2 components as part of a major release. The changes align with the design system's move away from styled-system props in favor of more maintainable styling approaches.

Key Changes

  • Removed sx prop from both Tooltip and TooltipV2 component type definitions
  • Replaced BoxWithFallback with native span element in TooltipV2
  • Cleaned up styled-components integration in legacy Tooltip

Reviewed Changes

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

Show a summary per file
FileDescription
packages/react/src/TooltipV2/Tooltip.tsxRemoved SxProp import and type, replaced BoxWithFallback with span
packages/react/src/TooltipV2/Tooltip.docs.jsonRemoved sx prop from component documentation
packages/react/src/Tooltip/Tooltip.tsxRemoved SxProp type and sx function from styled-component
packages/react/src/Tooltip/Tooltip.docs.jsonRemoved sx prop from component documentation
.changeset/pink-rockets-win.mdAdded changeset entry for major version bump

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

🚀

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6667 September 16, 2025 21:36 Inactive
@github-actions
github-actionsBot requested a deployment to storybook-preview-6667 September 16, 2025 21:40 Abandoned
@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 Sep 25, 2025
@liuliu-dev
liuliu-dev requested review from a team and hectahertzSeptember 25, 2025 23:02

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

Comment on lines +11 to +24
const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<HTMLDivElement>> = forwardRef<
HTMLDivElement,
TooltipProps
>(function Tooltip(props, ref) {
return <Box as={PrimerTooltip} ref={ref} {...props} />
})

export {Tooltip, type TooltipProps}

type DeprecatedTooltipProps = PrimerDeprecatedTooltipProps & SxProp

function DeprecatedTooltip(props: DeprecatedTooltipProps) {
return <Box as={PrimerDeprecatedTooltip} {...props} />
}

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.

should we do the new as hack just in case? I think in theory it affects every component

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only affects polymorphic components that take an as prop, Tooltip isn’t one of them, so it should be fine.
I tested it in primer-react.browser.test.tsx and confirmed that the props and children are passed correctly for Tooltip.

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.

ah got it, thanks! ❤️

@liuliu-devliuliu-dev changed the title Remove sx props and BoxWithFallback from TooltipV2 and TooltipDO NOT MERGE:Remove sx props and BoxWithFallback from TooltipV2 and TooltipSep 26, 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!

@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 Sep 30, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6667 September 30, 2025 23:08 Inactive
@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 30, 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!

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6667 September 30, 2025 23:18 Inactive
@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 30, 2025
@primer-integration

Copy link
Copy Markdown

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

@github-actionsgithub-actionsBot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Sep 30, 2025
@primer-integration

Copy link
Copy Markdown

🟢 ci 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 Oct 1, 2025
@liuliu-dev
liuliu-dev added this pull request to the merge queueOct 1, 2025
@francineluccafrancinelucca changed the title DO NOT MERGE:Remove sx props and BoxWithFallback from TooltipV2 and TooltipRemove sx props and BoxWithFallback from TooltipV2 and TooltipOct 1, 2025
Merged via the queue into main with commit d122122Oct 1, 2025
44 checks passed
@liuliu-dev
liuliu-dev deleted the liuliu/migrate-tooltip branch October 1, 2025 01:09
@primerprimerBot mentioned this pull request Oct 1, 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/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@liuliu-dev@hectahertz@francinelucca