Upgrade styled-components from 5 to 6#380
Merged
Merged
Conversation
styled-components 6 removed the babel macro and no longer filters
non-HTML props from styled DOM elements, so beyond the version bump:
- Replace styled-components/macro imports with plain styled-components
imports, and wire babel-plugin-styled-components into the jest babel
transform and webpack babel-loader: the macro previously provided the
css-prop transform that ~50 files rely on (css="..." on JSX elements),
and the plugin is its direct replacement. Dead side-effect macro
imports are removed.
- Convert custom props on styled DOM elements to transient ($-prefixed)
props so they are not forwarded to the DOM (v5 filtered them
automatically; v6 forwards everything): ActionsGrid, ChipHolder,
SelectableItem/Indicator, JobEventLine, OutputWrapper, LinkG, StartG,
NodeG, FormColumnLayout, Th in HeaderRow.
- Convert the css={`...`} template usages in ActionsTd, ActionItem,
Search and AdvancedSearch to explicit styled components.
- Drop props that were never consumed and only existed to be swallowed
by v5's filtering: isFirst on JobEventLine, isInline on
FormCheckboxLayout, ouiaId on the WorkflowOutputToolbar styled div.
Verified: lint clean, jest 544 suites / 2855 tests passing (baseline),
production build succeeds.
This was referenced Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the AWX UI React codebase from styled-components@5.3.11 to styled-components@6.4.2 as a prerequisite for modernizing the React stack, updating build/test tooling and component code to account for v6’s macro removal and changed prop-forwarding behavior.
Changes:
- Upgrade
styled-componentsto v6.4.2 and addbabel-plugin-styled-componentsto restore thecss-prop transform. - Remove
styled-components/macrousage and replace macro-drivencss={...}patterns with explicit styled-components where needed. - Convert styled DOM-element custom props to transient (
$-prefixed) props / drop unused swallowed props to prevent React unknown-prop warnings.
Reviewed changes
Copilot reviewed 76 out of 77 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| awx/ui/src/screens/User/UserList/UserListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerToolbar.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerStartScreen.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerNode.js | Convert styling/props for styled SVG elements for v6 prop-forwarding. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerLink.js | Convert custom prop to transient prop for styled SVG element. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/VisualizerGraph.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeTypeStep/NodeTypeStep.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeDeleteModal.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/Survey/SurveyListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Template/shared/WorkflowJobTemplateForm.js | Drop unused prop previously swallowed by v5 filtering. |
| awx/ui/src/screens/Team/TeamList/TeamListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Project/shared/ProjectSubForms/SvnSubForm.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Project/shared/ProjectSubForms/ManualSubForm.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Project/shared/ProjectSubForms/GitSubForm.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Project/shared/ProjectSubForms/ArchiveSubForm.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Project/ProjectList/ProjectListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/NotificationTemplate/shared/CustomMessagesSubForm.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.js | Drop unused/swallowed DOM prop on styled wrapper. |
| awx/ui/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Job/JobOutput/shared/JobEventLine.js | Convert custom prop to transient prop for styled DOM element. |
| awx/ui/src/screens/Job/JobOutput/PageControls.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Job/JobOutput/JobOutput.js | Convert custom prop to transient prop for styled DOM element. |
| awx/ui/src/screens/Job/JobOutput/JobEvent.js | Drop unused swallowed prop + convert clickable prop to transient. |
| awx/ui/src/screens/Job/JobOutput/EmptyOutput.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Job/JobDetail/JobDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Inventory/shared/InventoryGroupsDeleteModal.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Inventory/InventoryHostDetail/InventoryHostDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Inventory/AdvancedInventoryHosts/AdvancedInventoryHostListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Instances/InstancePeers/InstancePeerListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Instances/InstanceListenerAddressList/InstanceListenerAddressListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Instances/InstanceList/InstanceListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Instances/InstanceList/InstanceList.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/InstanceGroup/Instances/InstanceListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/InstanceGroup/InstanceGroupList/InstanceGroupListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/HostMetrics/HostMetricsListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Host/HostList/HostListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/screens/Host/HostDetail/HostDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Workflow/WorkflowTools.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Workflow/WorkflowStartNode.js | Convert custom prop to transient prop for styled SVG element. |
| awx/ui/src/components/Workflow/WorkflowNodeHelp.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/TemplateList/TemplateListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/StatusLabel/StatusLabel.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/SelectableCard/SelectableCard.js | Convert custom selection props to transient props. |
| awx/ui/src/components/Search/Search.js | Replace css prop usage with styled wrapper + remove macro import. |
| awx/ui/src/components/Search/AdvancedSearch.js | Replace css prop usage with styled wrapper + remove macro import. |
| awx/ui/src/components/Schedule/shared/ScheduleFormFields.js | Convert layout prop to transient prop + remove macro import. |
| awx/ui/src/components/Schedule/shared/FrequencyDetailSubform.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Schedule/ScheduleToggle/ScheduleToggle.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Schedule/ScheduleOccurrences/ScheduleOccurrences.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Schedule/ScheduleList/ScheduleListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Schedule/ScheduleDetail/ScheduleDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/ResourceAccessList/ResourceAccessListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/PromptDetail/PromptDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/PaginatedTable/PaginatedTable.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/PaginatedTable/HeaderRow.js | Replace css prop usage with transient prop-driven styled component. |
| awx/ui/src/components/PaginatedTable/ActionsTd.js | Replace css prop block with explicit styled cell + transient props. |
| awx/ui/src/components/PaginatedTable/ActionItem.js | Replace css prop usage with explicit styled wrapper + transient prop. |
| awx/ui/src/components/Lookup/MultiCredentialsLookup.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/Lookup/Lookup.js | Convert custom prop to transient prop for styled DOM element. |
| awx/ui/src/components/LaunchPrompt/steps/CredentialsStep.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/HostToggle/HostToggle.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/FormLayout/FormLayout.js | Convert layout prop to transient prop for styled DOM element. |
| awx/ui/src/components/ErrorDetail/ErrorDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/DetailList/CodeDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/DetailList/ArrayDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/CodeEditor/VariablesDetail.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/CheckboxListItem/CheckboxListItem.js | Remove styled-components/macro side-effect import. |
| awx/ui/src/components/AlertModal/AlertModal.js | Remove styled-components/macro side-effect import. |
| awx/ui/package.json | Upgrade styled-components and add babel-plugin-styled-components. |
| awx/ui/package-lock.json | Lockfile updates for styled-components v6 + new babel plugin and deps. |
| awx/ui/config/webpack.config.js | Add babel-plugin-styled-components to Babel loader pipeline. |
| awx/ui/config/jest/babelTransform.js | Add babel-plugin-styled-components to Jest Babel transform. |
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
Comment on lines
28
to
31
| const NodeG = styled.g` | ||
| pointer-events: ${(props) => (props.noPointerEvents ? 'none' : 'initial')}; | ||
| pointer-events: ${(props) => (props.$noPointerEvents ? 'none' : 'initial')}; | ||
| cursor: ${(props) => (props.job ? 'pointer' : 'default')}; | ||
| `; |
Comment on lines
286
to
290
| <NodeG | ||
| id={`node-${node.id}`} | ||
| job={node.job} | ||
| noPointerEvents={isAddLinkSourceNode} | ||
| $noPointerEvents={isAddLinkSourceNode} | ||
| onMouseEnter={handleNodeMouseEnter} |
cigamit
approved these changes
Jun 11, 2026
cigamit
left a comment
Contributor
There was a problem hiding this comment.
Tested and working just fine.
Contributor
Author
|
Both review comments addressed in the latest commit: |
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Upgrades styled-components 5.3.11 → 6.4.2. This is the first stage of modernizing the React stack (styled-components 5 does not even compile against React 18/19, so it has to move first). v6 has two breaking changes that affect this codebase, both handled here:
1. The babel macro was removed. ~50 files relied on
styled-components/macrofor the css-prop transform (css="..."on plain JSX elements). The macro's direct replacement,babel-plugin-styled-components, is now wired into the jest babel transform and the webpack babel-loader, so those usages keep working unchanged. Macro imports become plain imports; dead side-effect macro imports are removed. Thecss={\...`}` template-literal usages (ActionsTd, ActionItem, Search, AdvancedSearch) are converted to explicit styled components.2. v6 no longer filters non-HTML props from styled DOM elements — everything is forwarded to the DOM, producing React unknown-prop warnings (which this test suite treats as failures). Custom props on styled DOM elements are converted to transient (
$-prefixed) props per the v6 migration guide:ActionsGrid($numActions/$gridColumns),ChipHolder($isDisabled),SelectableItem/Indicator($isSelected),JobEventLine($isClickable),OutputWrapper($cssMap),LinkG/StartG($ignorePointerEvents),NodeG($noPointerEvents),FormColumnLayout($stacked), HeaderRow'sTh($alignRight). Three props that were never consumed and only existed to be swallowed by v5's filtering are dropped (isFirston JobEventLine,isInlineon FormCheckboxLayout,ouiaIdon a styled div — none ever reached the DOM in v5).Rendering output is unchanged: every conversion preserves the exact CSS the component produced under v5.
Independent of every other open PR — verified conflict-free via pairwise
git merge-tree.ISSUE TYPE
COMPONENT NAME
ASCENDER VERSION
ADDITIONAL INFORMATION
All UI gates run against exactly this branch state (unmodified main + only this change):
The unknown-prop warnings the suite surfaces are an exhaustive detector here:
setupTests.jsfails any test that logs a console error, so the passing suite demonstrates no styled component leaks props to the DOM anywhere the tests render.Pre-existing oddity left untouched:
Project.helptext.jsusescss={{...}}objects on<ul>elements without ever having imported the macro — those styles never applied in v5 either and remain inert.