Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore(BaseStyles): Remove the CSS modules feature flag from the BaseStyles component #5981

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

Merged
merged 8 commits into from
Apr 30, 2025

Conversation

jonrohan
Copy link
Member

Closes https://github.com/github/primer/issues/4358

Changelog

New

Changed

Removed

Remove the CSS modules feature flag from the BaseStyles component

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

Merge checklist

Copy link

changeset-bot bot commented Apr 28, 2025

🦋 Changeset detected

Latest commit: 70af75c

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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 github-actions bot 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 Apr 28, 2025
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!

Copy link
Contributor

github-actions bot commented Apr 28, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.95 KB (-0.14% 🔽)
packages/react/dist/browser.umd.js 99.21 KB (-0.18% 🔽)

@github-actions github-actions bot requested a deployment to storybook-preview-5981 April 28, 2025 20:40 Abandoned
@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT 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 Apr 28, 2025
@jonrohan jonrohan marked this pull request as ready for review April 28, 2025 21:02
@Copilot Copilot AI review requested due to automatic review settings April 28, 2025 21:02
@jonrohan jonrohan requested a review from a team as a code owner April 28, 2025 21:02
Copy link
Contributor

@Copilot 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 removes the CSS modules feature flag from the BaseStyles component and simplifies the component rendering logic. Key changes include skipping certain tests related to styling and system props, removing the feature flag logic and associated styled‐components code from BaseStyles.tsx, and updating stories and e2e tests accordingly.

Reviewed Changes

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

Show a summary per file
File Description
packages/react/src/tests/BaseStyles.test.tsx Temporarily skipping tests related to styling and system props
packages/react/src/BaseStyles.tsx Removing CSS modules feature flag and associated styled‐components logic; introducing BoxWithFallback
packages/react/src/BaseStyles.dev.stories.tsx Adding stories to showcase new BaseStyles behavior using sx, system, and style props
e2e/components/BaseStyles.test.ts Expanding e2e test coverage to include the new story variants
.changeset/cuddly-facts-speak.md Documenting the removal of the feature flag in the changeset
Files not reviewed (2)
  • packages/react/src/tests/snapshots/AnchoredOverlay.test.tsx.snap: Language not supported
  • packages/react/src/tests/snapshots/BaseStyles.test.tsx.snap: Language not supported
Comments suppressed due to low confidence (2)

packages/react/src/BaseStyles.tsx:7

  • The CSS modules import and associated CSS classes are no longer used; please consider removing this import to avoid unused code.
import classes from './BaseStyles.module.css'

packages/react/src/BaseStyles.tsx:1

  • Since the styled-components logic has been removed along with the feature flag, this import can also be removed to clean up the file.
import styled, {createGlobalStyle} from 'styled-components'

@@ -20,7 +20,7 @@ describe('BaseStyles', () => {
expect(container).toMatchSnapshot()
})

it('respects styling props', () => {
it.skip('respects styling props', () => {
Copy link
Preview

Copilot AI Apr 28, 2025

Choose a reason for hiding this comment

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

Please add an inline comment to explain why these tests are being skipped, so future maintainers understand the temporary nature of this change.

Suggested change
it.skip('respects styling props', () => {
it.skip('respects styling props', () => {
// Skipping this test temporarily due to incomplete implementation of styling props handling.

Copilot uses AI. Check for mistakes.

Positive FeedbackNegative Feedback
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a good idea to add this

@primer primer bot requested a review from a team as a code owner April 28, 2025 21:12
@primer primer bot requested a review from emilybrick April 28, 2025 21:12
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed update snapshots labels Apr 28, 2025
Copy link
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 removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Apr 28, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-5981 April 28, 2025 21:27 Inactive
@jonrohan jonrohan enabled auto-merge April 28, 2025 22:09
Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

some questionsss

results.json Outdated Show resolved Hide resolved
@@ -20,7 +20,7 @@ describe('BaseStyles', () => {
expect(container).toMatchSnapshot()
})

it('respects styling props', () => {
it.skip('respects styling props', () => {
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to skip these now? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

The .toHaveStyle check doesn't work anymore because of the CSS modules not being included in the test suite. I think eventually we'll figure out something and un-skip all these, but I'm not sure what we can do here in the meantime so I've been skipping them.

Comment on lines -69 to -70
if (includesSystemProps(props)) {
const systemProps = getTypographyAndCommonProps(props)
Copy link
Member

Choose a reason for hiding this comment

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

Can you clarify why this was needed before but not anymore? I'm confused since this seems to be the old-enabled version 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

This was added to check if system props were coming in, but we've abstracted that same functionality to the BoxWithFallback component so no need to double check now

if (sx !== defaultSxProp || includesSystemProps(rest)) {

Copy link
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!

@@ -20,7 +20,7 @@ describe('BaseStyles', () => {
expect(container).toMatchSnapshot()
})

it('respects styling props', () => {
it.skip('respects styling props', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a good idea to add this

@jonrohan jonrohan added this pull request to the merge queue Apr 30, 2025
Merged via the queue into main with commit b03f78f Apr 30, 2025
45 checks passed
@jonrohan jonrohan deleted the css_modules_remove_flag/basestyles branch April 30, 2025 14:03
@primer primer bot mentioned this pull request Apr 29, 2025
hectahertz pushed a commit that referenced this pull request May 20, 2025
…tyles component (#5981)

Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.