Skip to content

Upgrade React from 18.3.1 to 19.2.7 - #521

Merged
cigamit merged 3 commits into
ctrliq:mainfrom
blaipr:feature/react-19
Jun 28, 2026
Merged

Upgrade React from 18.3.1 to 19.2.7#521
cigamit merged 3 commits into
ctrliq:mainfrom
blaipr:feature/react-19

Conversation

@blaipr

@blaipr blaipr commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Upgrade React and React DOM from 18.3.1 to 19.2.7 (latest).

Changes:

  • react and react-dom bumped from 18.3.1 to 19.2.7
  • react-app-polyfill removed. Dead dependency with no imports in source; Jest setupFiles cleaned up (TextEncoder polyfill retained)
  • forwardRef → direct ref prop in 3 components (JobEvent, JobEventSkeleton, ToolbarAddButton) — forwardRef is no longer needed in React 19
  • NodeModal.test.js mock Form changed from <form> to <div> — React 19 promotes nested <form> DOM nesting warning to console.error, which the test harness catches

All prerequisites were completed in earlier PRs:

Also unblocks: react-router 8 (requires React 19.2.7+, separate PR).

ISSUE TYPE

  • New or Enhanced Feature

COMPONENT NAME

  • UI

ASCENDER VERSION

awx: 25.4.1.dev138+g14786f6928.d20260628

ADDITIONAL INFORMATION

Test results: All 552 test suites pass (2911 tests, 0 failures).

Formik risk: formik 2.4.9 (project in stasis since 2023) declares react >=16.8.0 so it installs cleanly, but runtime regressions are the main risk. Form-heavy screens (Settings, Templates, Credentials, Users) should be exercised during review.

- Bump react and react-dom from 18.3.1 to 19.2.7
- Remove react-app-polyfill (dead dependency, no imports in source)
- Convert forwardRef to direct ref prop in JobEvent, JobEventSkeleton,
  and ToolbarAddButton (forwardRef is no longer needed in React 19)
- Fix nested form DOM nesting error in NodeModal test mock
  (React 19 promotes nested <form> warning to console.error)
- Clean up Jest setupFiles (remove react-app-polyfill/jsdom)

All 552 test suites pass (2911 tests).
PatternFly v6 ships per-component CSS via .mjs modules in
@patternfly/react-styles that import adjacent .css files
(e.g. `import './login.css'`). The package marks only *.css
as sideEffects in its package.json, but not the .mjs files
that import them. Webpack tree-shakes the .mjs → .css imports
away, leaving only the base reset styles (205 rules instead
of ~2800).

Add a webpack rule to force @patternfly/react-styles .mjs
files to be treated as side-effectful so the CSS imports
are preserved.
Comment thread awx/ui/package.json Outdated
@cigamit cigamit added the Needs triage When a Issue needs to be researched or a PR has an issue that needs fixing before merging label Jun 28, 2026

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

Upgrades the AWX UI’s core React runtime to React 19, removing now-unneeded polyfills and aligning a few components/tests with React 19 behavior while ensuring PatternFly v6 CSS continues to load correctly under webpack.

Changes:

  • Bump react / react-dom to 19.2.7 and remove react-app-polyfill from Jest setup.
  • Replace forwardRef usage with direct ref prop handling in several UI components.
  • Adjust PF6/webpack behavior (sideEffects) and update a NodeModal test mock to avoid React 19 nested-form warnings.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
awx/ui/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/NodeModals/NodeModal.test.js Updates PF Form mock to avoid nested <form> warnings promoted to errors in React 19.
awx/ui/src/screens/Job/JobOutput/JobEventSkeleton.js Removes forwardRef and uses ref prop directly.
awx/ui/src/screens/Job/JobOutput/JobEvent.js Removes React.forwardRef wrapper and attaches ref prop to the root element.
awx/ui/src/components/PaginatedTable/ToolbarAddButton.js Removes forwardRef and passes ref prop directly to MenuToggle.
awx/ui/package.json Bumps React deps, removes react-app-polyfill, tweaks Jest setupFiles, and changes dev-server PORT.
awx/ui/package-lock.json Lockfile updates reflecting React 19 and removal of react-app-polyfill transitive deps.
awx/ui/config/webpack.config.js Forces PF6 @patternfly/react-styles .mjs modules to be treated as side-effectful so CSS imports aren’t tree-shaken away.
Files not reviewed (1)
  • awx/ui/package-lock.json: Generated file

Comment thread awx/ui/package.json Outdated
Comment thread awx/ui/package.json Outdated
- Revert dev server port from 3002 back to 3001 (accidental
  change from local testing)
- Pin react and react-dom to exact 19.2.7 (no caret range)
  to avoid unintended minor/patch bumps on a major upgrade
@blaipr

blaipr commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

All review findings have been addressed:

  • Port reverted: dev server port changed back from 3002 to 3001 (was accidentally committed from local testing)
  • Versions pinned: react and react-dom pinned to exact 19.2.7 (no caret range) to prevent uncontrolled upgrades

@cigamit cigamit removed the Needs triage When a Issue needs to be researched or a PR has an issue that needs fixing before merging label Jun 28, 2026
@cigamit
cigamit merged commit ab4b83f into ctrliq:main Jun 28, 2026
sy-base pushed a commit to sy-base/ascender that referenced this pull request Jul 4, 2026
* Upgrade React from 18.3.1 to 19.2.7

- Bump react and react-dom from 18.3.1 to 19.2.7
- Remove react-app-polyfill (dead dependency, no imports in source)
- Convert forwardRef to direct ref prop in JobEvent, JobEventSkeleton,
  and ToolbarAddButton (forwardRef is no longer needed in React 19)
- Fix nested form DOM nesting error in NodeModal test mock
  (React 19 promotes nested <form> warning to console.error)
- Clean up Jest setupFiles (remove react-app-polyfill/jsdom)

All 552 test suites pass (2911 tests).

* Fix PatternFly v6 component CSS not loading

PatternFly v6 ships per-component CSS via .mjs modules in
@patternfly/react-styles that import adjacent .css files
(e.g. `import './login.css'`). The package marks only *.css
as sideEffects in its package.json, but not the .mjs files
that import them. Webpack tree-shakes the .mjs → .css imports
away, leaving only the base reset styles (205 rules instead
of ~2800).

Add a webpack rule to force @patternfly/react-styles .mjs
files to be treated as side-effectful so the CSS imports
are preserved.

* Revert port to 3001 and pin react versions

- Revert dev server port from 3002 back to 3001 (accidental
  change from local testing)
- Pin react and react-dom to exact 19.2.7 (no caret range)
  to avoid unintended minor/patch bumps on a major upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants