Skip to content

Conversation

@jonrohan
Copy link
Member

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

Changelog

New

Changed

Removed

Remove the CSS modules feature flag from the TextInput 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

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2025

🦋 Changeset detected

Latest commit: d48e4d9

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 24, 2025
@github-actions
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!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 101.63 KB (-1.03% 🔽)
packages/react/dist/browser.umd.js 102.05 KB (-0.74% 🔽)

@primer-integration
Copy link

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

@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 25, 2025
@jonrohan jonrohan marked this pull request as ready for review April 25, 2025 00:47
Copilot AI review requested due to automatic review settings April 25, 2025 00:47
@jonrohan jonrohan requested a review from a team as a code owner April 25, 2025 00:47
@jonrohan jonrohan requested a review from TylerJDev April 25, 2025 00:47
@jonrohan jonrohan enabled auto-merge April 25, 2025 00:47
Copy link
Contributor

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 TextInput component and related subcomponents in order to simplify the implementation and remove conditional styling logic. Key changes include replacing toggled styled components with direct usage of BoxWithFallback or native elements, removing feature flag usage in inner visual and action components, and updating tests to reflect these changes.

Reviewed Changes

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

Show a summary per file
File Description
packages/react/src/internal/components/UnstyledTextInput.tsx Removed feature flag logic and now always uses BoxWithFallback with CSS Modules.
packages/react/src/internal/components/TextInputWrapper.tsx Simplified styling by removing conditional styled components and merging inline style props.
packages/react/src/internal/components/TextInputInnerVisualSlot.tsx Removed feature flag usage and streamlined the spinner/visual slot structure.
packages/react/src/internal/components/TextInputInnerAction.tsx Eliminated conditional style props based on feature flag, now using a consistent style for invisible controls.
packages/react/src/tests/* Updated/removes tests that relied on feature flag behavior (with some tests skipped).
packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx Removed feature flag usage and replaced Box usage with native elements and CSS modules accordingly.
.changeset/empty-cooks-love.md Documented the removal of the CSS modules feature flag.
Files not reviewed (3)
  • packages/react/src/TextInputWithTokens/TextInputWithTokens.module.css: Language not supported
  • packages/react/src/internal/components/TextInputInnerAction.module.css: Language not supported
  • packages/react/src/internal/components/TextInputInnerVisualSlot.module.css: Language not supported
Comments suppressed due to low confidence (3)

packages/react/src/internal/components/TextInputWrapper.tsx:75

  • Verify that merging inline style props in this conditional statement preserves the intended precedence of user-supplied styles, especially for width-related properties.
style={ typeof width === 'string' || typeof minWidth === 'string' || typeof maxWidth === 'string' ? {width, maxWidth, minWidth, ...style} : style }

packages/react/src/tests/Textarea.test.tsx:66

  • The test for the optional block prop is now skipped; confirm that this prop is either deprecated or covered elsewhere to ensure adequate test coverage.
it.skip('renders an optional block prop correctly', () => {

packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx:282

  • Switching from the Box component to a native div changes the element semantics; please verify that all associated layout and style behaviors continue to work as expected.
<div className={styles.Container} data-prevent-token-wrapping={preventTokenWrapping}>

@jonrohan jonrohan added this pull request to the merge queue Apr 25, 2025
Merged via the queue into main with commit 02ed196 Apr 25, 2025
45 checks passed
@jonrohan jonrohan deleted the css_modules_flag_remove/TextInput branch April 25, 2025 01:03
@primer primer bot mentioned this pull request Apr 24, 2025
hectahertz pushed a commit that referenced this pull request May 20, 2025
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 staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants