Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate React Router to React Data Router pattern #4834

Merged
merged 6 commits into from
Nov 3, 2023

Conversation

grhallenbeck
Copy link
Contributor

Changes

Migrates routing from React Router components to a data router using createHashRouter. There was logic previously in a custom HistoryRouter implementation that handles syncing a router history between the experimental React application and the legacy router, as well as handling legacy hash-bang routes, which has been moved into a useLegacyRouterSync hook. This allows syncing changes from one router to the other since data routers don't expose their internal history or allow an externally-initialized history.

There is some risk here with the history sync logic around potential double history entries, which should be managed with checks against both histories to make sure they aren't already the same before updating one in response to the other. This would probably be a good early target for some unit testing once a testing library has been chosen.

Issues

@grhallenbeck grhallenbeck requested a review from a team as a code owner October 4, 2023 04:47
@thornbill thornbill added the enhancement Improve existing functionality or small fixes label Oct 4, 2023
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Oct 4, 2023
@jellyfin-bot

This comment was marked as outdated.

@grhallenbeck grhallenbeck marked this pull request as draft October 4, 2023 20:11
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Oct 7, 2023
@grhallenbeck grhallenbeck marked this pull request as ready for review October 7, 2023 04:01
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Oct 9, 2023
@jellyfin-bot

This comment was marked as outdated.

@jellyfin-bot jellyfin-bot added merge conflict Conflicts prevent merging and removed merge conflict Conflicts prevent merging labels Oct 9, 2023
@jellyfin-bot

This comment was marked as outdated.

@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Oct 17, 2023
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Oct 20, 2023
@jellyfin-bot

This comment was marked as outdated.

Copy link
Member

@grafixeyehero grafixeyehero left a comment

Choose a reason for hiding this comment

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

LGTM

src/apps/experimental/routes/routes.tsx Outdated Show resolved Hide resolved
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Oct 28, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit 8227642
Status ✅ Deployed!
Preview URL https://8a0d4585.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs
View bot logs

@thornbill thornbill added this to the v10.9.0 milestone Nov 3, 2023
@thornbill thornbill merged commit 35429ca into jellyfin:master Nov 3, 2023
22 checks passed
@dmitrylyzo dmitrylyzo mentioned this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality or small fixes hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants