-
Notifications
You must be signed in to change notification settings - Fork 616
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
Conversation
… and enhance storybook tests
🦋 Changeset detectedLatest commit: 70af75c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
👋 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! |
size-limit report 📦
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/375222 |
🟢 golden-jobs completed with status |
There was a problem hiding this 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', () => { |
There was a problem hiding this comment.
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.
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.
There was a problem hiding this comment.
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
👋 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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some questionsss
@@ -20,7 +20,7 @@ describe('BaseStyles', () => { | ||
expect(container).toMatchSnapshot() | ||
}) | ||
|
||
it('respects styling props', () => { | ||
it.skip('respects styling props', () => { |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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.
if (includesSystemProps(props)) { | ||
const systemProps = getTypographyAndCommonProps(props) |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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)) { |
…ressBar component (#5983)
👋 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', () => { |
There was a problem hiding this comment.
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
…tyles component (#5981) Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com> Co-authored-by: Josh Black <joshblack@github.com>
Closes https://github.com/github/primer/issues/4358
Changelog
New
Changed
Removed
Remove the CSS modules feature flag from the BaseStyles component
Rollout strategy
Merge checklist