Skip to content

Allow React 19 in the peer range#102

Open
arifulhoque7 wants to merge 1 commit into
getdokan:mainfrom
arifulhoque7:fix/react-19-peer-range
Open

Allow React 19 in the peer range#102
arifulhoque7 wants to merge 1 commit into
getdokan:mainfrom
arifulhoque7:fix/react-19-peer-range

Conversation

@arifulhoque7

@arifulhoque7 arifulhoque7 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

peerDependencies pins react/react-dom to ^18.0.0. Any consumer on React 19 cannot install this package under npm:

Found: react@19.2.7
Could not resolve dependency:
peer react@"^18.0.0" from @wedevs/plugin-ui@2.0.0

pnpm installs regardless (peer mismatches are warnings), but then builds this package's nested tree against a React it wasn't resolved for. Because there's no published dist, every clean install runs preparewp-scripts build, and on CI that fails with:

ERROR in ./src/index.ts 10:27
Module parse failed: Unexpected token

which points at a loader problem and gives no hint that the cause is peer resolution. Dokan and appbridge don't see it because both are on React 18.

Change

Widens the range to ^18.0.0 || ^19.0.0. Nothing in the library depends on React 18 specifics — FlyHR already ships it against React 19 — so the ceiling was stale rather than real.

Verification

  • npm ci && npm run build clean; dist/ builds (11 entries)
  • A React 19 consumer installs without ERESOLVE; before this change it failed outright
  • Consumer still needs @wordpress/scripts@^33 (the first release peering ^18 || ^19) for a fully clean tree

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility
    • Added support for React 19 and React DOM 19 while retaining compatibility with React 18.

The package declared peer react/react-dom ^18.0.0. Consumers on React 19
cannot install it at all under npm, which fails the resolution outright:

  Found: react@19.2.7
  Could not resolve dependency:
  peer react@"^18.0.0" from @wedevs/plugin-ui@2.0.0

pnpm installs anyway but then builds this package's nested tree against a
React it was not resolved for, and the prepare step fails on CI with a
webpack parse error that gives no hint of the real cause.

Nothing here depends on React 18 specifics — FlyHR already runs this
library against React 19 in production — so the ceiling is stale rather
than real. Verified: builds clean and a React 19 consumer installs
without ERESOLVE.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0c478cd-7ac9-4c2b-b6a7-e15edaefdc1d

📥 Commits

Reviewing files that changed from the base of the PR and between 4e3835d and f5bf08e.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

React and react-dom peer dependency constraints now allow both React 18 and React 19.

Changes

React peer dependency support

Layer / File(s) Summary
Broaden React peer ranges
package.json
The react and react-dom peer dependency ranges accept `^18.0.0

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: kzamanbd

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: expanding React and react-dom peer dependency support to include React 19.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant