[PR #4693] [MERGED] Migrate to react router createBrowserRouter #4717

Closed
opened 2026-02-22 18:36:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4693
Author: @shatfield4
Created: 11/26/2025
Status: Merged
Merged: 12/2/2025
Merged by: @timothycarambat

Base: masterHead: 4686-feat-migrate-react-router-to-use-createbrowserrouter


📝 Commits (3)

  • 332fe1c migrate to react router createBrowserRouter
  • a488d73 dev build
  • 3196739 Merge branch 'master' into 4686-feat-migrate-react-router-to-use-createbrowserrouter

📊 Changes

3 files changed (+376 additions, -283 deletions)

View changed files

📝 .github/workflows/dev-build.yaml (+1 -1)
📝 frontend/src/App.jsx (+3 -278)
📝 frontend/src/main.jsx (+372 -4)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4686

What is in this change?

  • Replace BrowserRouter with createBrowserRouter to enable useBlocker and other modern data router APIs
  • Move route definitions from App.jsx to main.jsx
  • Convert App.jsx to use <Outlet /> pattern
  • Implement route-level lazy loading instead of React.lazy() for better performance
  • Each route now lazy imports on route match rather than on first render

Additional Information

Previous version that uses React.lazy() would import as the component starts to render
(route match -> component starts to render -> import starts -> loading -> render complete)

New implementation allows for lazy loading on route matches
(route match -> import starts immediately -> component renders -> render complete)

Developer Validations

  • Keeps Login, SimpleSSOPassthrough, and OnboardingFlow as regular imports (not lazy loaded)
  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4693 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 11/26/2025 **Status:** ✅ Merged **Merged:** 12/2/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4686-feat-migrate-react-router-to-use-createbrowserrouter` --- ### 📝 Commits (3) - [`332fe1c`](https://github.com/Mintplex-Labs/anything-llm/commit/332fe1c36da851972d238f5c45c2caa958edc156) migrate to react router createBrowserRouter - [`a488d73`](https://github.com/Mintplex-Labs/anything-llm/commit/a488d731b61693274d4d22e57d87d17f4e4f4f1c) dev build - [`3196739`](https://github.com/Mintplex-Labs/anything-llm/commit/31967399bcb9c5c8f21b3eb74d05c17586b8404e) Merge branch 'master' into 4686-feat-migrate-react-router-to-use-createbrowserrouter ### 📊 Changes **3 files changed** (+376 additions, -283 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/dev-build.yaml` (+1 -1) 📝 `frontend/src/App.jsx` (+3 -278) 📝 `frontend/src/main.jsx` (+372 -4) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4686 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - Replace BrowserRouter with createBrowserRouter to enable useBlocker and other modern data router APIs - Move route definitions from `App.jsx` to `main.jsx` - Convert `App.jsx` to use `<Outlet />` pattern - Implement route-level lazy loading instead of React.lazy() for better performance - Each route now lazy imports on route match rather than on first render ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> Previous version that uses React.lazy() would import as the component starts to render (route match -> component starts to render -> import starts -> loading -> render complete) New implementation allows for lazy loading on route matches (route match -> import starts immediately -> component renders -> render complete) ### Developer Validations - Keeps Login, SimpleSSOPassthrough, and OnboardingFlow as regular imports (not lazy loaded) <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:23 -05:00
yindo closed this issue 2026-02-22 18:36:23 -05:00
yindo changed title from [PR #4693] Migrate to react router createBrowserRouter to [PR #4693] [MERGED] Migrate to react router createBrowserRouter 2026-06-05 15:20:00 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4717