-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(solid-query-devtools): fix clientOnly component instantiation in Solid Start / SSR #11346
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
Open
VedAnt-1004
wants to merge
1
commit into
TanStack:main
Choose a base branch
from
VedAnt-1004:fix/solid-query-devtools-render-start
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.
+20
−21
Open
Changes from all commits
Commits
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
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
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: TanStack/query
Length of output: 15212
🏁 Script executed:
Repository: TanStack/query
Length of output: 10528
🌐 Web query:
SolidJS 1.9.7 untrack documentation reactive dependencies component return createMemo💡 Result:
In SolidJS, component functions are executed exactly once to initialize the reactive graph, and they are wrapped in an implicit untrack call to prevent them from becoming reactive dependencies themselves [1][2]. The core reactive primitives, such as createMemo and createEffect, manage tracking automatically when reactive values (like signals) are accessed within their execution functions [3][4][5]. 1. Untrack The untrack function is a utility that executes a function without collecting reactive dependencies from the current reactive scope [6]. It is frequently used to read a signal's value inside a reactive computation (like an effect) without subscribing that computation to the signal's updates [6][7][8]. 2. Component Execution When a component is initialized, SolidJS calls the component function inside an untrack wrapper [1][2]. This ensures that any signals accessed during the component's top-level setup do not inadvertently track the component itself as a dependency [2]. Because components do not re-render in the way typical of frameworks like React, logic that relies on signal updates must be encapsulated within fine-grained reactive primitives like createMemo or createEffect, or placed directly inside JSX where Solid can handle the reactivity implicitly [9][2]. 3. createMemo The createMemo function creates a read-only signal that derives its value from other reactive values [4]. It is optimized to be eager (it executes immediately upon creation) and caches its result [4][10]. It re-executes only when its tracked dependencies change [4][5]. If the computed value remains the same after re-execution (based on an optional equality check), it will suppress downstream updates [4][5]. Memos are generally preferred over effects for derived state because they are more efficient and follow the pattern of avoiding side effects during the reactive computation phase [5][11]. Top Results: [6] https://docs.solidjs.com/reference/reactive-utilities/untrack [4] https://docs.solidjs.com/reference/basic-reactivity/create-memo [1] https://github.com/solidjs/solid/blob/7d913a69/packages/solid/src/render/component.ts [2] https://deepwiki.com/solidjs/solid/2.2-component-model
Citations:
Keep the fallback branch reactive.
The
untrackimported fromsolid-jspreventscomp()andmounted()from becoming dependencies. Later calls tosetCompandsetMountedtherefore cannot rerun this branch, soprops.fallbackcan remain rendered afterfn()resolves.Wrap the branch in
createMemoor another reactive computation, and add a delayed-resolution regression test.🤖 Prompt for AI Agents