Skip to content

react 19#7463

Merged
martinjagodic merged 20 commits intodecaporg:mainfrom
hip3r:7365-react19
Jun 20, 2025
Merged

react 19#7463
martinjagodic merged 20 commits intodecaporg:mainfrom
hip3r:7365-react19

Conversation

@hip3r
Copy link
Copy Markdown
Contributor

@hip3r hip3r commented Apr 24, 2025

Summary

support for react 19.
closes #7365

React 19 has some breaking changes. Most of them aren't used here, but dropping propTypes does affect decap-cms. https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-deprecated-react-apis
I recreated how prop-types used to work https://www.npmjs.com/package/prop-types#proptypescheckproptypes for all components.

Test plan

decap-cms works and tests are completed successfully

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)

image

@hip3r hip3r requested a review from a team as a code owner April 24, 2025 11:25
@martinjagodic martinjagodic added the dependencies Pull requests that update a dependency file label Jun 10, 2025
@martinjagodic martinjagodic requested a review from Copilot June 10, 2025 13:06
Copy link
Copy Markdown
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 upgrades the application to support React 19 by reintroducing PropTypes runtime validation manually and updating React and related dependency versions. Key changes include:

  • Adding componentDidMount lifecycle methods in multiple components to perform manual PropTypes validation.
  • Updating React, react-dom, and various testing libraries to the React 19 compatible versions.
  • Modifying package.json files in multiple packages to reflect these dependency updates.

Reviewed Changes

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

Show a summary per file
File Description
packages/decap-cms-core/src/components/Collection/Entries/EntryListing.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/Collection/Entries/EntriesSearch.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/Collection/CollectionSearch.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/Collection/Collection.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/App/Header.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/src/components/App/App.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-core/package.json Updated React and react-dom versions and react-scroll-sync minor version bump.
packages/decap-cms-backend-test/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-test/package.json Updated React to version 19.1.0.
packages/decap-cms-backend-proxy/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-gitlab/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-github/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-gitea/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-git-gateway/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount and removed duplicate static propTypes definition.
packages/decap-cms-backend-bitbucket/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-azure/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-backend-aws-cognito-github-proxy/src/AuthenticationPage.js Added PropTypes.checkPropTypes in componentDidMount.
packages/decap-cms-app/package.json Updated React and react-dom peerDependencies to React 19.1.0.
package.json Updated various dependencies including React and testing libraries to versions compatible with React 19.1.0.
Comments suppressed due to low confidence (1)

packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js:75

  • Consider abstracting the manual PropTypes validation into a shared utility or higher-order component to reduce duplicated code across components. Additionally, ensure this validation is executed only in development mode to mitigate any potential performance overhead in production.
componentDidMount() {
    // Manually validate PropTypes - React 19 breaking change
    PropTypes.checkPropTypes(EntriesCollection.propTypes, this.props, 'prop', 'EntriesCollection');

martinjagodic
martinjagodic previously approved these changes Jun 13, 2025
martinjagodic
martinjagodic previously approved these changes Jun 13, 2025
@martinjagodic martinjagodic force-pushed the 7365-react19 branch 2 times, most recently from d1cd526 to 177959a Compare June 13, 2025 15:30
@martinjagodic martinjagodic merged commit e7421b8 into decaporg:main Jun 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React 19 support

3 participants