feat(solid-query): Rework internals of createBaseQuery #7272
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.
This change aims to simplify and enhance the internals of
createBaseQuery
.This change is a precursor to fix a couple of pressing issues in solid-query mentioned in
#7079
#7083
#7173
#7036
#6620
#6373
PRs for which are coming soon.
A key few highlights coming with this change:
mutate
andrefetch
branches increateClientSubscriber
: We had two different ways of resolving a query resource. Themutate
option that optimistically updated a resource proved to be a problem with error queries. A query that hasplaceholder
data and fails for any reason would see a flash of blank content before yielding to the ErrorBoundary. Usingrefetch
for all query resolutions gives us a nice and simple way to transition to error boundariesnotifyManager
: With the new approach we dont need to batch anything. Everything is taken care of automatically. This removes all sideEffects from solid-query as a nice plussetStateWithReconciliation
function provides a nice and easy way to make thereconcile
option way more powerfuldata
property now would trigger Suspense boundary. Previously any property accessed on a query would trigger the suspense boundary. This was not intentional and has been fixed nowdata
doesn't jump between different values in most cases