{{ message }}
chore: remove PropTypes and defaultProps for React 19 compatibility#26107
Open
unrevised6419 wants to merge 4 commits intostrapi:developfrom
Open
chore: remove PropTypes and defaultProps for React 19 compatibility#26107unrevised6419 wants to merge 4 commits intostrapi:developfrom
unrevised6419 wants to merge 4 commits intostrapi:developfrom
Conversation
Align plugin folder structure with all other packages/plugins/* which
use an admin/src + server/src split. The users-permissions server
tree previously lived at the package root under server/ — an outlier.
Precursor to adding TypeScript support, which is in turn required to
drop React propTypes/defaultProps usage in the admin side (both
removed from function components in React 19).
- Move packages/plugins/users-permissions/server/* → server/src/*
- Update package.json exports["./strapi-server"].source
- Update rollup.config.mjs input + rootDir
- Adjust one relative path in server/src/services/__tests__/jwt.test.js
that reached tests/helpers at repo root (now one level deeper)
No runtime or behavior changes. Jest coverage glob already uses
server/**/*.{js,ts} which continues to match recursively.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Follow-up to the server → server/src rename: update stale path references in the sessions-and-jwt auth doc and the documentation plugin README. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add tsconfig, ESLint configs, and rename entry files (index.js -> index.ts) for both admin and server. Update package.json exports and build pipeline to emit types. Switch rollup to basePluginConfig helper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
React 19 silently ignores `propTypes` and removes `defaultProps` from
function components. This commit finishes the removal across the
monorepo:
- Convert the 10 remaining PropTypes-using `.jsx` files in
`plugins/users-permissions/admin/src` to `.tsx` with TS interfaces
and ES6 default parameters.
- Replace `defaultProps` on styled-component `LinkWrapperButton` in
`core/upload` with `.attrs({ type: 'button' })`.
- Drop the now-unused `prop-types` dependency from
`core/upload` and `plugins/users-permissions` package.json files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6b3011c to
f7c3217
Compare
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
React 19 silently ignores
propTypesand removesdefaultPropsfrom function components. This PR finishes the removal across the monorepo so the codebase is free of both deprecations.PropTypes-using.jsxfiles inplugins/users-permissions/admin/srcto.tsxwith TS interfaces and ES6 default parameters.defaultPropson the styled-componentLinkWrapperButtonincore/uploadwith.attrs({ type: 'button' }).prop-typesdependency fromcore/uploadandplugins/users-permissionspackage.jsonfiles.After this PR:
rg "from 'prop-types'" packages/→ 0 matchesrg "\.defaultProps\s*=" packages/→ 0 matchesrg '"prop-types":' packages/*/package.json→ 0 matchesTest plan
yarn workspace @strapi/plugin-users-permissions run lint— 0 errorsyarn workspace @strapi/plugin-users-permissions run build:types:admin— cleanyarn workspace @strapi/plugin-users-permissions run test:front— 45/45 passyarn workspace @strapi/upload run lint— 0 errorsyarn workspace @strapi/upload run test:ts:front— cleanyarn workspace @strapi/upload run test:front— 468/468 passplugins/users-permissions🤖 Generated with Claude Code