-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Update/fix Single Fetch revalidation behavior #9938
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d34fcf7
Fix single fetch revalidation behavior
brophdawg11 0332c3f
Add e2e tests
brophdawg11 d32cc7c
Updates and more e2e tests
brophdawg11 fef1426
Bump router to prerelease
brophdawg11 b9f9077
Adopt router dataStrategy changes to fix revalidation issues
brophdawg11 07fc2a6
Merge branch 'dev' into brophdawg11/single-fetch-revalidation
brophdawg11 6715b40
Fix test, update docs and chanbgeset
brophdawg11 99a0e5d
polish
brophdawg11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
"@remix-run/react": patch | ||
"@remix-run/server-runtime": patch | ||
--- | ||
|
||
Single Fetch - fix revalidation behavior bugs | ||
|
||
- With Single Fetch, existing routes revalidate by default | ||
- This means requests do not need special query params for granular route revalidations out of the box - i.e., `GET /a/b/c.data` | ||
- There are two conditions that will trigger granular revalidation: | ||
- If a route opts out of revalidation via `shouldRevalidate`, it will be excluded from the single fetch call | ||
- If a route defines a `clientLoader` then it will be excluded from the single fetch call and if you call `serverLoader()` from your `clientLoader`, that will make a separarte HTTP call for just that route loader - i.e., `GET /a/b/c.data?_routes=routes/a` for a `clientLoader` in `routes/a.tsx` | ||
- When one or more routes are excluded from the single fetch call, the remaining routes that have loaders are included as query params: | ||
- For example, if A was excluded, and the `root` route and `routes/b` had a `loader` but `routes/c` did not, the single fetch request would be `GET /a/b/c.data?_routes=root,routes/a` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the entire single fetch call fails we'll report this error for all the routes so it'll naturally "bubble" to the parent