-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update/fix Single Fetch revalidation behavior (#9938)
- Loading branch information
1 parent
dc3c3e9
commit 5cfd3c3
Showing
14 changed files
with
1,458 additions
and
184 deletions.
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.