Skip to content
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

feat(solid-query): Rework internals of createBaseQuery #7272

Merged
merged 4 commits into from Apr 13, 2024

Conversation

ardeora
Copy link
Contributor

@ardeora ardeora commented Apr 13, 2024

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:

  1. Removal of mutate and refetch branches in createClientSubscriber: We had two different ways of resolving a query resource. The mutate option that optimistically updated a resource proved to be a problem with error queries. A query that has placeholder data and fails for any reason would see a flash of blank content before yielding to the ErrorBoundary. Using refetch for all query resolutions gives us a nice and simple way to transition to error boundaries
  2. Removal of batched calls with notifyManager: 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 plus
  3. Central place to update state: The new setStateWithReconciliation function provides a nice and easy way to make the reconcile option way more powerful
  4. Only accessing the data 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 now
  5. Proxied data doesn't jump between different values in most cases

Copy link

vercel bot commented Apr 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Apr 13, 2024 6:06am

Copy link

nx-cloud bot commented Apr 13, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b7925b9. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

codesandbox-ci bot commented Apr 13, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b7925b9:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@ardeora ardeora merged commit a122e7c into TanStack:main Apr 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant