Skip to content

Update Primer React to v38 - #72

Merged
danielguillan merged 6 commits into
mainfrom
danielguillan/upgrade-primer-react-v38
Nov 27, 2025
Merged

Update Primer React to v38#72
danielguillan merged 6 commits into
mainfrom
danielguillan/upgrade-primer-react-v38

Conversation

@danielguillan

@danielguillan danielguillan commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Towards https://github.com/github/primer/issues/6134

List of notable changes:

  • Upgraded @primer/react to version 38 in all relevant package.json files.
  • Remove usage of Box from @primer/react.
  • Remove usage of the sx prop in favor of CSS modules and inline styles.

No visual changes expected.

Copilot AI review requested due to automatic review settings November 24, 2025 21:29
@danielguillan
danielguillan requested a review from a team as a code owner November 24, 2025 21:29

Copilot AI 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 upgrades @primer/react from v37 to v38 across all packages in the monorepo, migrating away from Primer React's deprecated Box component and sx prop pattern in favor of CSS Modules and inline styles with CSS custom properties.

Key Changes:

  • Upgraded @primer/react to v38.0.0 in package.json files (theme, site, root)
  • Refactored components to remove Box usage and replace with native HTML elements (div, span)
  • Migrated from sx prop to CSS Modules and inline styles using CSS custom properties
  • Updated tests to remove dependency on Primer theme providers where no longer needed

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/theme/package.json Upgrades @primer/react dependency to v38.0.0
packages/theme/components/layout/sidebar/Sidebar.tsx Replaces sx prop with inline styles using CSS custom properties for margin spacing
packages/theme/components/layout/root-layout/Theme.tsx Removes Box component usage, replaces with native div elements and inline styles; removes explanatory comments for breadcrumb filtering logic
packages/theme/components/layout/root-layout/Theme.module.css Adds new CSS module with classes that are not currently imported or used in the component
packages/theme/components/layout/nav-drawer/Drawer.tsx Migrates from Box with sx prop to motion.div with CSS module classes
packages/theme/components/layout/nav-drawer/Drawer.module.css Adds CSS module for drawer overlay and panel styling
packages/theme/components/content/dos-and-donts/DosAndDonts.tsx Removes Box component, replaces with native div and inline styles
packages/theme/components/content/caption/Caption.tsx Refactors from Primer's Text component to native span with CSS module
packages/theme/components/content/caption/Caption.test.tsx Updates tests to use standard render instead of renderWithPrimerThemeProviders
packages/theme/components/content/caption/Caption.module.css Adds CSS module for caption styling
packages/site/package.json Upgrades @primer/react dev dependency to v38.0.0
package.json Upgrades @primer/react dev dependency to v38.0.0 in root
package-lock.json Updates lockfile with new v38 dependencies and peer dependency changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/theme/components/layout/root-layout/Theme.module.css
Comment thread packages/theme/components/layout/root-layout/Theme.tsx
Comment thread packages/theme/components/content/dos-and-donts/DosAndDonts.tsx Outdated
Comment thread packages/theme/components/layout/sidebar/Sidebar.tsx Outdated

@rezrah rezrah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Only some minor feedback about removal of inline styles, otherwise LGTM 🚢

@danielguillan
danielguillan merged commit 8b0b36f into main Nov 27, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants