Skip to content

drop react v18 support#921

Merged
BilalG1 merged 10 commits intodevfrom
fix-react-version-peer-dep
Oct 6, 2025
Merged

drop react v18 support#921
BilalG1 merged 10 commits intodevfrom
fix-react-version-peer-dep

Conversation

@BilalG1
Copy link
Contributor

@BilalG1 BilalG1 commented Oct 1, 2025

High-level PR Summary

This PR updates the peer dependency requirements across multiple package.json files to remove support for React 18.2 and only specify React 19.0.0-rc.0 or newer as the minimum required version. The change affects React, React DOM, and their corresponding TypeScript type packages.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 packages/react/package.json
2 packages/stack/package.json
3 packages/template/package-template.json
4 packages/template/package.json

Need help? Join our Discord


Important

Update peer dependencies to require React 19.0.0 or newer across multiple packages.

  • Peer Dependencies:
    • Updated minimum peer dependency to React 19.0.0 for react, react-dom, @types/react, and @types/react-dom in packages/react/package.json, packages/stack/package.json, and packages/template/package.json.
    • Removed support for React 18.2 in peer dependencies across all affected package.json files.
  • Dev Dependencies:
    • Updated development dependencies to React 19.0.0 in packages/react/package.json, packages/stack/package.json, and packages/template/package.json.
  • Misc:
    • No runtime behavior changes; only stricter dependency constraints.

This description was created by Ellipsis for fa6ee35. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Chores
    • Raised peer dependency minimums to React 19.0.0 for react, react-dom, @types/react, and @types/react-dom across packages.
    • Bumped development dependencies used for building and testing to React 19.x.
    • Applies to templates, stack packages, UI/shared packages, and development tooling; no runtime behavior changes—only stricter dependency requirements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Peer and dev dependency constraints for React and related typings were updated across multiple package.json files to require React and @types packages at >=19.0.0 and to bump devDependencies of react/react-dom to ^19.0.0. No source or runtime code changed.

Changes

Cohort / File(s) Summary of Changes
React-related packages (peer + dev bumps)
packages/react/package.json, packages/stack/package.json, packages/template/package.json, packages/template/package-template.json, packages/stack-sc/package.json, packages/stack-shared/package.json, packages/stack-ui/package.json
Updated peerDependencies for react, react-dom, @types/react, and @types/react-dom from ranges that allowed 18.x (and RC-era 19) to require >=19.0.0. Updated devDependencies for react and react-dom from ^18.2.x to ^19.0.0. No source changes.
JS package devDependency
packages/js/package.json
Bumped devDependencies.react from ^18.2.0 to ^19.0.0. No other changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble semver leaves beneath the sun,
Hop to nineteen — a tidy, gentle run.
Peers tightened, devs refreshed and new,
A carrot-version leap, hooray—woohoo! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed The description includes the required CONTRIBUTING.md reminder, a clear high-level summary, detailed change breakdowns, affected files, and review guidance, fully satisfying the repository’s template and providing sufficient context for reviewers.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly states that React v18 support is being dropped, which directly reflects the pull request’s main change of updating peer dependencies to require React 19.0.0 and removing v18 ranges across multiple packages.

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 and usage tips.

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stack-backend Ready Ready Preview Comment Oct 4, 2025 11:39am
stack-dashboard Ready Ready Preview Comment Oct 4, 2025 11:39am
stack-demo Ready Ready Preview Comment Oct 4, 2025 11:39am
stack-docs Ready Ready Preview Comment Oct 4, 2025 11:39am

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 27f6a91..a247eb0

✨ No bugs found, your code is sparkling clean

⏭️ Files skipped (4)
  Locations  
packages/react/package.json
packages/stack/package.json
packages/template/package-template.json
packages/template/package.json

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

This PR removes React 18 support across all Stack Auth packages by updating the peer dependencies to require React 19.0.0-rc.0 as the minimum version. The changes are made through the template system (`packages/template/package-template.json`) which auto-generates the `package.json` files for the `@stackframe/template`, `@stackframe/react`, and `@stackframe/stack` packages.

The modification changes peer dependencies from supporting both React 18.2+ and 19.0+ (">=18.2 || >=19.0.0-rc.0") to only supporting React 19 RC versions (">=19.0.0-rc.0"). This affects four React-related dependencies: react, react-dom, @types/react, and @types/react-dom. The template system ensures consistency across all packages in the Stack Auth ecosystem.

This change integrates with Stack Auth's package generation workflow where the template file serves as the source of truth for dependency requirements, automatically propagating changes to all derived packages. The modification represents a strategic decision to modernize the codebase and potentially leverage React 19-specific features, though it comes at the cost of backward compatibility.

PR Description Notes:

  • The PR description is minimal and doesn't explain the breaking change or rationale
  • No mention of migration guide or impact assessment for existing users
Changed Files
Filename Score Overview
packages/template/package-template.json 2/5 Updates peer dependencies to require React 19+ only, removing React 18 support with dev/peer dependency version mismatch
packages/template/package.json 2/5 Auto-generated from template, drops React 18 support while maintaining React 18 in devDependencies
packages/react/package.json 2/5 Auto-generated from template, enforces React 19+ requirement with inconsistent devDependencies
packages/stack/package.json 2/5 Auto-generated from template, requires React 19+ for peer deps but uses React 18 for development

Confidence score: 2/5

  • This PR introduces a breaking change that will prevent React 18 users from installing Stack Auth packages, requiring careful rollout
  • Score reflects the version inconsistency between devDependencies (React 18) and peerDependencies (React 19+) which could cause development issues
  • Pay close attention to packages/template/package-template.json as it's the source template that generates all other package.json files

Additional Comments (4)

  1. packages/template/package.json, line 99 (link)

    logic: Inconsistency: peer deps require React 19 RC but dev deps use React 18.2. This mismatch could cause development environment issues.

  2. packages/react/package.json, line 86 (link)

    logic: Dev dependencies use React 18.2.0 but peer deps require React 19+. This mismatch could cause development/production inconsistencies.

  3. packages/stack/package.json, line 94 (link)

    logic: Dev dependencies still use React 18.2.0 while peer deps now require React 19+. This version mismatch could cause development issues.

  4. packages/template/package-template.json, line 138 (link)

    logic: Inconsistency: devDependencies still use React 18 while peerDependencies now require React 19+. This could cause development environment issues and makes the change seem incomplete.

4 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27f6a91 and a247eb0.

📒 Files selected for processing (4)
  • packages/react/package.json (1 hunks)
  • packages/stack/package.json (1 hunks)
  • packages/template/package-template.json (1 hunks)
  • packages/template/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
packages/stack/**

📄 CodeRabbit inference engine (AGENTS.md)

Never modify packages/stack; make changes in packages/template instead as packages/stack is a copy

Files:

  • packages/stack/package.json
packages/template/**

📄 CodeRabbit inference engine (AGENTS.md)

When modifying the SDK copies, make changes in packages/template (source of truth)

Files:

  • packages/template/package-template.json
  • packages/template/package.json
🪛 Biome (2.1.2)
packages/template/package-template.json

[error] 102-102: The key // was already declared.

This where a duplicated key was declared again.

If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.

(lint/suspicious/noDuplicateObjectKeys)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: setup-tests
  • GitHub Check: docker
  • GitHub Check: restart-dev-and-test
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: all-good
  • GitHub Check: build (22.x)
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: Security Check

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/template/package-template.json (1)

100-106: Biome duplicate key ‘//’ warning in JSON template.

The template uses repeated “//” keys for directives; JSON linters flag duplicates. Either rename file to .jsonc and configure tooling to parse as JSONC, or add a linter ignore for this file/object section.

🧹 Nitpick comments (2)
packages/template/package-template.json (2)

101-108: Avoid a breaking peer range; keep React 18 compatibility or bump major.

Tightening to ">=19.0.0-rc.0" drops React 18 consumers while package version remains 2.8.41. Either:

  • keep a dual range (recommended), or
  • if 19-only is required, coordinate a major version bump for all affected packages.

Suggested dual-range diff:

-    "@types/react": ">=19.0.0-rc.0",
+    "@types/react": ">=18.3.1 || >=19.0.0",
@@
-    "@types/react-dom": ">=19.0.0-rc.0",
-    "react-dom": ">=19.0.0-rc.0",
+    "@types/react-dom": ">=18.3.1 || >=19.0.0",
+    "react-dom": ">=18.3.1 || >=19.0.0",
@@
-    "react": ">=19.0.0-rc.0"
+    "react": ">=18.3.1 || >=19.0.0"

138-140: Prefer stable React 19 in devDependencies over RC.

Pinning devDeps to an RC can cause churn and mismatches with peer ranges. Use stable 19.x:

-    "react": "^19.0.0-rc.0",
+    "react": "^19.0.0",
@@
-    "react-dom": "^19.0.0-rc.0",
+    "react-dom": "^19.0.0",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a247eb0 and 41079a2.

📒 Files selected for processing (5)
  • packages/js/package.json (1 hunks)
  • packages/react/package.json (2 hunks)
  • packages/stack/package.json (2 hunks)
  • packages/template/package-template.json (2 hunks)
  • packages/template/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/react/package.json
  • packages/template/package.json
  • packages/stack/package.json
🧰 Additional context used
📓 Path-based instructions (2)
packages/template/**

📄 CodeRabbit inference engine (AGENTS.md)

When modifying the SDK copies, make changes in packages/template (source of truth)

Files:

  • packages/template/package-template.json
packages/js/**

📄 CodeRabbit inference engine (AGENTS.md)

Never modify packages/js; make changes in packages/template instead as packages/js is a copy

Files:

  • packages/js/package.json
🪛 Biome (2.1.2)
packages/template/package-template.json

[error] 102-102: The key // was already declared.

This where a duplicated key was declared again.

If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.

(lint/suspicious/noDuplicateObjectKeys)

🪛 GitHub Actions: Runs E2E API Tests
packages/js/package.json

[error] 1-1: Lockfile specifiers do not match package.json. The lockfile contains dependencies that differ from what is specified in package.json.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: docker
  • GitHub Check: all-good
  • GitHub Check: Vercel Agent Review
  • GitHub Check: Security Check

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (1)
packages/js/package.json (1)

63-63: Do not edit generated package; update the template and re-sync.

This file is auto-generated. Revert this direct change and apply it in packages/template/package-template.json, then run the template sync and regenerate the lockfile.

Run to confirm only the template source is edited and outputs are in sync:

#!/bin/bash
set -euo pipefail

echo "Any direct edits to generated packages?"
rg -n 'THIS FILE IS AUTO-GENERATED FROM TEMPLATE' -C1 packages | sed -n 's/^\(\S\+package\.json\).*/\1/p' | sort -u | while read -r f; do
  echo "- $f"
done

echo
echo "React devDeps still on 18.x anywhere?"
rg -nP '"devDependencies"\s*:\s*\{(?s).*?"react"\s*:\s*"\^18' -C0 packages

echo
echo "Leftover RC ranges?"
rg -nP '>=19\.0\.0-rc\.0' -C2
🧹 Nitpick comments (1)
packages/template/package-template.json (1)

138-141: LGTM on devDeps to ^19; ensure Next devDep is bumped in tandem.

After adjusting the Next peer to 15+, bump dev next from ^14.1.0 to ^15.x here too.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41079a2 and 7e5752e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/js/package.json (1 hunks)
  • packages/react/package.json (2 hunks)
  • packages/stack-sc/package.json (2 hunks)
  • packages/stack-shared/package.json (1 hunks)
  • packages/stack-ui/package.json (1 hunks)
  • packages/stack/package.json (2 hunks)
  • packages/template/package-template.json (2 hunks)
  • packages/template/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/package.json
🧰 Additional context used
📓 Path-based instructions (3)
packages/js/**

📄 CodeRabbit inference engine (AGENTS.md)

Never modify packages/js; make changes in packages/template instead as packages/js is a copy

Files:

  • packages/js/package.json
packages/template/**

📄 CodeRabbit inference engine (AGENTS.md)

When modifying the SDK copies, make changes in packages/template (source of truth)

Files:

  • packages/template/package.json
  • packages/template/package-template.json
packages/stack/**

📄 CodeRabbit inference engine (AGENTS.md)

Never modify packages/stack; make changes in packages/template instead as packages/stack is a copy

Files:

  • packages/stack/package.json
🪛 Biome (2.1.2)
packages/template/package-template.json

[error] 102-102: The key // was already declared.

This where a duplicated key was declared again.

If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.

(lint/suspicious/noDuplicateObjectKeys)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: docker
  • GitHub Check: all-good
  • GitHub Check: Vercel Agent Review
  • GitHub Check: restart-dev-and-test
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: setup-tests
  • GitHub Check: build (22.x)
  • GitHub Check: Security Check
🔇 Additional comments (4)
packages/template/package.json (1)

99-100: LGTM on devDeps bump to React 19.

Matches the peer floor.

packages/stack/package.json (1)

94-95: DevDeps bump to React 19 looks good.

packages/stack-sc/package.json (1)

49-50: LGTM on React/DOM devDeps to ^19.

packages/template/package-template.json (1)

101-108: Next constraints now require v15+ across template and downstream packages. Verified no remaining mismatches between React ≥19 and Next versions.

@BilalG1 BilalG1 assigned N2D4 and unassigned BilalG1 Oct 3, 2025
@BilalG1 BilalG1 changed the title fix peer dep drop react v18 support Oct 3, 2025
@github-actions github-actions bot assigned BilalG1 and unassigned N2D4 Oct 4, 2025
@BilalG1 BilalG1 merged commit 88e6900 into dev Oct 6, 2025
19 checks passed
@BilalG1 BilalG1 deleted the fix-react-version-peer-dep branch October 6, 2025 19:46
@coderabbitai coderabbitai bot mentioned this pull request Oct 25, 2025
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.

2 participants