Skip to content

Upgrade react-router to v8.3.0 and update postcss to 8.5.18 - #4337

Merged
ThaminduDilshan merged 1 commit into
thunder-id:mainfrom
ThaminduDilshan:thamindu-fix-3
Jul 24, 2026
Merged

Upgrade react-router to v8.3.0 and update postcss to 8.5.18#4337
ThaminduDilshan merged 1 commit into
thunder-id:mainfrom
ThaminduDilshan:thamindu-fix-3

Conversation

@ThaminduDilshan

@ThaminduDilshan ThaminduDilshan commented Jul 24, 2026

Copy link
Copy Markdown
Member

Purpose

This pull request bumps the react-router version to 8.x, updates related peer dependencies, and applies some minor dependency version bumps for postcss. These changes ensure consistency across samples, templates, and documentation, and align the SDK integration guides with the new routing package.

Approach

Dependency and version updates:

  • The react-router dependency is updated to version 8.3.0 in the workspace, and peer dependency rules are adjusted to ensure compatibility with the current react version used in the workspace. [1] [2]
  • postcss is updated from 8.5.12 to 8.5.18 in multiple package.json files for improved security and compatibility. [1] [2] [3] [4]

Template and sample app alignment:

  • The React application template and sample apps are updated to use react-router for routing, with all relevant code snippets, installation commands, and configuration steps revised accordingly. [1] [2] [3] [4]

Migration to react-router (from react-router-dom):

These changes standardize routing across the codebase, reduce confusion for new users, and ensure that all guides and templates reflect the current best practices for integrating ThunderID authentication in React applications.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • Updated React sample routing to import routing utilities from react-router while preserving existing navigation and route behavior.
  • Documentation

    • Refreshed React Router and route-protection guides/examples to use react-router imports instead of react-router-dom.
    • Updated embedded and SDK/tool instruction snippets to match the same react-router import style.
  • Chores

    • Bumped react-router in the workspace catalog.
    • Upgraded the postcss override version across affected packages/samples.

@ThaminduDilshan ThaminduDilshan added Type/Improvement trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes labels Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates the React Router dependency and imports from react-router-dom to react-router across the vanilla sample, documentation, SDK-generated guidance, and application templates. PostCSS overrides are also updated across workspace and sample manifests.

Changes

React Router import alignment

Layer / File(s) Summary
Dependency catalog and overrides
pnpm-workspace.yaml, samples/apps/react-*/package.json
React Router is upgraded to 8.3.0, PostCSS overrides to 8.5.18, and the vanilla sample uses the catalog-provided react-router package.
Vanilla sample router imports
samples/apps/react-vanilla-sample/src/...
Routing components and navigation hooks now import from react-router.
Documentation and generated guidance
backend/internal/authn/reactsdk/tool.go, docs/content/sdks/..., frontend/apps/console/.../react.json
Examples, installation instructions, and generated React guidance now reference react-router.

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

Possibly related PRs

Suggested reviewers: brionmario, donomalvindula

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: upgrading react-router and postcss versions.
Description check ✅ Passed The description covers Purpose, Approach, issues/PRs, checklist, and security sections, matching the template well.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/content/sdks/react-router/apis/callback-route.mdx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

docs/content/sdks/react-router/apis/protected-route.mdx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

docs/content/sdks/react-router/overview.mdx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 2 others

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.

@ThaminduDilshan
ThaminduDilshan force-pushed the thamindu-fix-3 branch 2 times, most recently from ce68a43 to d66a940 Compare July 24, 2026 18:11
jeradrutnam
jeradrutnam previously approved these changes Jul 24, 2026
thiva-k
thiva-k previously approved these changes Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ThaminduDilshan
ThaminduDilshan added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
@ThaminduDilshan
ThaminduDilshan dismissed stale reviews from thiva-k and jeradrutnam via ca529fc July 24, 2026 18:56
jeradrutnam
jeradrutnam previously approved these changes Jul 24, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/sdks/react-router/overview.mdx`:
- Line 45: Align the React Router documentation with the intended supported
version: update the version text, peer-dependency table, and surrounding v6
wording to React Router v7 when retaining imports from react-router; otherwise
change the example imports back to react-router-dom and preserve v6
documentation consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 932ff884-b699-4aac-a867-56db24b982e3

📥 Commits

Reviewing files that changed from the base of the PR and between 8fd57f6 and 7274c5b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • backend/internal/authn/reactsdk/tool.go
  • docs/content/sdks/react-router/apis/callback-route.mdx
  • docs/content/sdks/react-router/apis/protected-route.mdx
  • docs/content/sdks/react-router/overview.mdx
  • docs/content/sdks/react/guides/protecting-routes/custom.mdx
  • docs/content/sdks/react/guides/protecting-routes/react-router.mdx
  • frontend/apps/console/src/features/applications/data/application-templates/technology-based/react.json
  • pnpm-workspace.yaml
  • samples/apps/react-api-based-sample/package.json
  • samples/apps/react-sdk-sample/package.json
  • samples/apps/react-vanilla-sample/package.json
  • samples/apps/react-vanilla-sample/src/App.tsx
  • samples/apps/react-vanilla-sample/src/components/Layout.tsx
  • samples/apps/react-vanilla-sample/src/pages/InvitePage.tsx
  • samples/apps/react-vanilla-sample/src/pages/ProfilePage.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • samples/apps/react-sdk-sample/package.json
  • samples/apps/react-vanilla-sample/src/pages/InvitePage.tsx
  • samples/apps/react-vanilla-sample/src/pages/ProfilePage.tsx
  • samples/apps/react-vanilla-sample/src/components/Layout.tsx
  • samples/apps/react-api-based-sample/package.json
  • samples/apps/react-vanilla-sample/package.json


```tsx title="src/App.tsx" showLineNumbers
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import { BrowserRouter, Routes, Route } from 'react-router'

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file path =="
git ls-files | rg 'docs/content/sdks/react-router/overview\.mdx|package\.json|pnpm-lock\.yaml|package-lock\.json|yarn\.lock' || true

echo
echo "== overview frontmatter and relevant lines =="
if [ -f docs/content/sdks/react-router/overview.mdx ]; then
  wc -l docs/content/sdks/react-router/overview.mdx
  sed -n '1,140p' docs/content/sdks/react-router/overview.mdx | cat -n
fi

echo
echo "== package files mentioning react-router =="
for f in $(git ls-files | rg '(^|/)package\.json$|pnpm-lock\.yaml|package-lock\.json|yarn\.lock$'); do
  echo "--- $f"
  rg -n '"react-router"|react-router-dom|react-router-dom' "$f" || true
done

echo
echo "== docs content react-router references =="
rg -n 'react-router|react-router-dom|React Router|v[678]|react-router-dom@|react-router@' docs/content/sdks docs/content 2>/dev/null | head -200 || true

Repository: thunder-id/thunderid

Length of output: 22421


🌐 Web query:

React Router v7 react-router import BrowserRouter Routes Route from react-router

💡 Result:

In React Router v7, the package structure has been simplified, significantly changing how you handle imports. The primary change is the consolidation of functionality into a single package, react-router [1][2][3]. Key changes for your imports: 1. Consolidated Package: You no longer need to maintain separate installations for react-router and react-router-dom [2][4][3]. You can uninstall react-router-dom and use only react-router [1][5]. 2. Standard Imports: Most standard components and hooks—such as BrowserRouter, Routes, Route, Link, and NavLink—are now imported directly from react-router [1][2][5]. Example v7 import: import { BrowserRouter, Routes, Route } from "react-router"; 3. DOM-Specific Imports: Certain APIs that depend specifically on react-dom (such as RouterProvider and HydratedRouter) must now be imported from react-router/dom [1][6][3]. This change ensures that react-dom remains an optional peer dependency, preventing issues in non-DOM environments [3]. Example DOM-specific import: import { RouterProvider } from "react-router/dom"; Summary of migration steps: - Uninstall react-router-dom: npm uninstall react-router-dom [1][4]. - Update all standard react-router-dom imports to react-router [2][5]. - Update any RouterProvider or hydration-related imports to react-router/dom [1][3]. While react-router-dom is still published in v7 as a convenience package that re-exports everything from react-router to ease the transition, the recommended practice is to move to the new import structure [3].

Citations:


Align the documented supported versions with the new imports.

This page still describes the SDK as supporting React Router v6, but it documents react-router >=6.30.1 and imports BrowserRouter, Routes, and Route from react-router. Those standard browser-router imports come from the React Router v7 package layout; v6 examples should use react-router-dom. Update the version text, peer table, and surrounding v6 wording to reflect React Router v7 support, or keep the example on react-router-dom if v6 remains the intended supported version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/sdks/react-router/overview.mdx` at line 45, Align the React
Router documentation with the intended supported version: update the version
text, peer-dependency table, and surrounding v6 wording to React Router v7 when
retaining imports from react-router; otherwise change the example imports back
to react-router-dom and preserve v6 documentation consistently.

@ThaminduDilshan
ThaminduDilshan added this pull request to the merge queue Jul 24, 2026
Merged via the queue into thunder-id:main with commit 0dc6476 Jul 24, 2026
27 checks passed
@ThaminduDilshan
ThaminduDilshan deleted the thamindu-fix-3 branch July 24, 2026 20:02
@coderabbitai coderabbitai Bot mentioned this pull request Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-approved trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants