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

Detect lazy route discovery manifest version mismatches and trigger reloads #13061

Merged
merged 5 commits into from
Feb 24, 2025

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Feb 19, 2025

This adds manifest version mismatch detection and forces a hard reload to get the user session onto the updated deployed version. Similar concept that we use when we hard reload on a route module asset 404.

Closes remix-run/remix#10455
Closes #12951

Copy link

changeset-bot bot commented Feb 19, 2025

🦋 Changeset detected

Latest commit: 638e0fa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
react-router Major
@react-router/architect Major
@react-router/cloudflare Major
@react-router/dev Major
react-router-dom Major
@react-router/express Major
@react-router/node Major
@react-router/serve Major
@react-router/fs-routes Major
@react-router/remix-routes-option-adapter Major
create-react-router Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brophdawg11 brophdawg11 force-pushed the brophdawg11/tokyo-drift branch from 451e1f6 to 1ab0914 Compare February 19, 2025 21:12
if (discoveredPaths.has(path)) {
return;
}
await fetchAndApplyManifestPatches(
[path],
fetcherKey ? window.location.href : path,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reload the current path on fetcher calls, or the next path on navigations

@brophdawg11 brophdawg11 force-pushed the brophdawg11/tokyo-drift branch from 72fbfb4 to 818bc00 Compare February 20, 2025 16:59
@brophdawg11 brophdawg11 marked this pull request as ready for review February 20, 2025 17:18
// This will hard reload the destination path on navigations, or the
// current path on fetcher calls
if (
sessionStorage.getItem(MANIFEST_VERSION_STORAGE_KEY) ===
Copy link
Member

Choose a reason for hiding this comment

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

Good call.

@brophdawg11 brophdawg11 merged commit 05f812b into dev Feb 24, 2025
5 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/tokyo-drift branch February 24, 2025 20:44
@tomerzcod7
Copy link

@brophdawg11 This is great! We've had this issue on production and this is exactly what we've been waiting for 🥳
Any ETA to when this will be released?

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

Successfully merging this pull request may close these issues.

3 participants