-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(react-query/HydrationBoundary): prevent unnecessary refetch during hydration #9968
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
Draft
sukvvon
wants to merge
22
commits into
TanStack:main
Choose a base branch
from
sukvvon:fix/hydration-boundary-double-fetch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,017
β47
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
8626d42
fix(react-query/HydrationBoundary): prevent unnecessary refetch durinβ¦
sukvvon 25499fc
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 695fa28
chore(.changeset): change version bump from 'patch' to 'minor'
sukvvon 2738c99
refactor(react-query/HydrationBoundary): add useEffect cleanup and exβ¦
sukvvon 9267ccc
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 992bee3
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon b8f5e0a
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 9d64cf1
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon bcd214e
chore(.changeset): change version bump from 'minor' to 'patch'
sukvvon 607f405
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon aa4c923
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 653df2c
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 08715e6
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon d3bf064
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 2a65e27
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 78ce3f5
Merge branch 'main' into fix/hydration-boundary-double-fetch
sukvvon 058fee0
refactor(react-query): replace global 'pendingHydrationQueries' with β¦
sukvvon cdbc754
ci: apply automated fixes
autofix-ci[bot] f840a0a
fix(query-core): refetch stale data during hydration for cached markuβ¦
sukvvon bb9cced
docs(react): update hydration docs to reflect stale data refetch behaβ¦
sukvvon b63f6ec
refactor(react-query/IsHydratingProvider): simplify context definition
sukvvon c4ad620
refactor(react-query): simplify hydration context from '{ current: Seβ¦
sukvvon 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 hidden or 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,6 @@ | ||
| --- | ||
| '@tanstack/query-core': patch | ||
| '@tanstack/react-query': patch | ||
| --- | ||
|
|
||
| fix(react-query/HydrationBoundary): prevent unnecessary refetch during hydration |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| 'use client' | ||
| import * as React from 'react' | ||
|
|
||
| const IsHydratingContext = React.createContext<Set<string>>(new Set()) | ||
|
|
||
| export const useIsHydrating = () => React.useContext(IsHydratingContext) | ||
| export const IsHydratingProvider = IsHydratingContext.Provider |
Oops, something went wrong.
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.
π§© Analysis chain
π Script executed:
Repository: TanStack/query
Length of output: 1194
π Script executed:
Repository: TanStack/query
Length of output: 193
π Script executed:
Repository: TanStack/query
Length of output: 687
π Script executed:
Repository: TanStack/query
Length of output: 1004
π Script executed:
Repository: TanStack/query
Length of output: 1355
π Web query:
eslint-plugin-react-hooks rules documentationπ‘ Result:
The official documentation for eslint-plugin-react-hooks and its rules is on the React site. Key pages:
If you want, I can fetch and list every rule and their options/examples from the plugin docs.
π Script executed:
Repository: TanStack/query
Length of output: 164
π Script executed:
Repository: TanStack/query
Length of output: 2186
π Script executed:
Repository: TanStack/query
Length of output: 936
π Script executed:
Repository: TanStack/query
Length of output: 144
Remove invalid ESLint disable directives for non-existent
react-hooks/refsruleThe
react-hooks/refsrule does not exist ineslint-plugin-react-hooks. Onlyreact-hooks/rules-of-hooksandreact-hooks/exhaustive-depsare official rules. These disable directives are invalid and should be removed:// eslint-disable-next-line react-hooks/refs/* eslint-disable react-hooks/refs *///* eslint-enable react-hooks/refs *//* eslint-disable react-hooks/refs *///* eslint-enable react-hooks/refs */Also in
packages/react-query/src/useBaseQuery.ts:60π§° Tools
πͺ ESLint
[error] 97-97: Definition for rule 'react-hooks/refs' was not found.
(react-hooks/refs)
[error] 103-103: Definition for rule 'react-hooks/refs' was not found.
(react-hooks/refs)
[error] 107-107: Definition for rule 'react-hooks/refs' was not found.
(react-hooks/refs)
π€ Prompt for AI Agents