Skip to content

fix(solid-query): deprecate create in favor of use, and add full docs - #8950

Merged
birkskyum merged 10 commits into
mainfrom
fix(solid-query)--deprecate-create-syntax
Apr 3, 2025
Merged

fix(solid-query): deprecate create in favor of use, and add full docs#8950
birkskyum merged 10 commits into
mainfrom
fix(solid-query)--deprecate-create-syntax

Conversation

@birkskyum

Copy link
Copy Markdown
Member

No description provided.

@nx-cloud

nx-cloud Bot commented Apr 3, 2025

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 121daeb.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 48s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-03 20:11:04 UTC

@pkg-pr-new

pkg-pr-new Bot commented Apr 3, 2025

Copy link
Copy Markdown
More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8950

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@8950

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@8950

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8950

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@8950

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@8950

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@8950

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@8950

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@8950

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@8950

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@8950

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@8950

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@8950

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@8950

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@8950

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@8950

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@8950

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@8950

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@8950

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@8950

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@8950

commit: 121daeb

@github-actions

github-actions Bot commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

Sizes for commit 121daeb:

Branch Bundle Size
Main
This PR

@codecov

codecov Bot commented Apr 3, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.70%. Comparing base (4e45d7c) to head (121daeb).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #8950       +/-   ##
===========================================
+ Coverage   44.07%   79.70%   +35.62%     
===========================================
  Files         200       16      -184     
  Lines        8021      335     -7686     
  Branches     1760       63     -1697     
===========================================
- Hits         3535      267     -3268     
+ Misses       4058       56     -4002     
+ Partials      428       12      -416     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental ∅ <ø> (∅)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister ∅ <ø> (∅)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core ∅ <ø> (∅)
@tanstack/query-devtools ∅ <ø> (∅)
@tanstack/query-persist-client-core ∅ <ø> (∅)
@tanstack/query-sync-storage-persister ∅ <ø> (∅)
@tanstack/react-query ∅ <ø> (∅)
@tanstack/react-query-devtools ∅ <ø> (∅)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client ∅ <ø> (∅)
@tanstack/solid-query 78.48% <100.00%> (+0.27%) ⬆️
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query ∅ <ø> (∅)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client ∅ <ø> (∅)
@tanstack/vue-query ∅ <ø> (∅)
@tanstack/vue-query-devtools ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@birkskyum
birkskyum merged commit d040eaa into main Apr 3, 2025
@birkskyum
birkskyum deleted the fix(solid-query)--deprecate-create-syntax branch April 3, 2025 21:54
incognitojam added a commit to commaai/new-connect that referenced this pull request Apr 13, 2025
create* has been deprecated in solid-query

TanStack/query#8950
ryansolid added a commit to ryansolid/query that referenced this pull request Aug 27, 2026
…ck#8950 deprecation

The create*/Create* names were kept as a migration bridge when v5 made
use* canonical (TanStack#8950 deprecated them). This major already rewrites every
callsite's semantics, so the bridge retires: use* is the only naming,
matching the docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
birkskyum pushed a commit that referenced this pull request Aug 28, 2026
…model (#11308)

* feat(solid-query): rewrite the adapter onto Solid 2's native async model

Reads become a single async memo over the query cache (suspends into
<Loading>, holds previous data through refetches, routes rejections to
<Errored>, serializes settled values for streaming hydration); mutations
ride Solid core's `action` primitive with transactional settle and
optimistic overlays; cross-cache hooks share a dual-write aggregate
with a hydration latch. The observer notification/store layer
(createStore/reconcile, tracking proxies, notifyManager batching) is
deleted — QueryObserver/MutationObserver remain as lifecycle/policy
engines with noop listeners.

Breaking: result `data` is non-optional (reads suspend instead of
returning undefined), mutateAsync is removed (mutate returns a
promise), and the reconcile/suspense/deferStream options are removed.

SSR contracts pinned by the fixture suite: settled-only serialization
for every exposed field, hydration id parity, no fetches inside the
hydration/restore windows, and hydration-latched cross-cache
aggregates. Validated against solid-js 2.0.0-rc.0 and rc.3, including
an end-to-end template run with single-flight mutations.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

* feat(solid-query): wire deferStream through to Solid's per-computation SSR option

deferStream was declared in the option types on this line but wired to
nothing. Solid 2 exposes it as a creation-time memo option, so pass it
straight through to the data node: the server holds the stream flush
until the query resolves instead of flushing the surrounding boundary's
fallback. Server-only; ignored on the client.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-query): serve data through an auto-reconciling store projection

Solid 2 projections auto-reconcile their returns by key, so the data face
becomes a store: deep reads are fine-grained and item identity survives
across refetches (keyed by the new `reconcile` option, default 'id').
The async memo remains the SSR/hydration spine underneath; the projection
derive is inert on the server — server projections run eagerly at
creation, so a live derive would fetch at hook creation and serialize a
duplicate payload, and the serialized entry would latch the hydrating
client's projection for the whole stream. With nothing serialized the
client projection computes live through the hydration window.

Rewrites the structural-sharing test to the stronger store contract and
adds leaf-granularity, custom-key, and primitive-data semantics tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(solid-query): green up CI for the native rewrite

- align @solidjs/web, babel-preset-solid and solid-js dev ranges across the
  solid packages (sherif flagged the split, and devtools/persist-client were
  resolving a second solid-js copy)
- drop the unused `export` on the internal BaseQueryLayer seam (knip)
- port the PersistQueryClientProvider suite to the 2.0 read layer: a query
  with nothing cached now suspends for the whole restore window, so the
  tests assert the visible fallback -> restored -> refreshed transitions
  and the fetch/callback bookkeeping instead of observer result snapshots

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor(solid-query): unify the data node into a single hybrid projection

Collapse the three-node data face (serialized async memo + transparent
hydration memo + client-only projection) into one createProjection with
an identical derive on both sides — the Solid Router feed-query-into-
projection shape. The engine owns SSR serialization (deferStream rides
the projection now), suspense, hydration adoption, and keyed
reconciliation. ssrSource 'hybrid' keeps hydrated components live: the
serialized value claims the DOM and the derive re-takes over from the
live cache per hydrated region. A per-hook `primed` signal gates the
pull-model fetch so the hydration takeover recompute cannot race data
the channel is about to deliver (SSR-errored queries fall through and
fetch normally once the channel declines them).

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-query): default ('server') hydration semantics for the data node

Drop ssrSource 'hybrid' from the data projection: query data IS
server-serialized truth, so the serialized value owns the DOM for the
whole hydration window. Mid-stream cache writes commit when the stream
closes through Solid's hydration-end divergence takeover (solid-js >
2.0.0-rc.3 — earlier engines lose a latched node's mid-stream divergence
instead of deferring it). Network activity is unchanged: observers
attach per-query as the channel primes, so mid-stream invalidations
still refetch immediately; only the DOM commit defers to hydration end.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-query): single-channel hydration — the node payload is the transport

Delete the provider-owned dehydration channel and its coordinator. The
data projection's serialized root now carries the cache facts hydration
needs ({ value, t: dataUpdatedAt, raw?: pre-select data }); on a hydrated
mount each hook peeks its projection's node id, loads that entry itself,
primes the query cache through query-core hydrate() (staleness intact,
newer-wins, silent under external pre-priming), and attaches its observer
per query as chunks land. One serialization story, engine-owned; ~240
lines deleted. Requires solid-js > 2.0.0-rc.3 (peekNextChildId export).

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(solid-query): drop internal porting notes from the tree

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-query): content-addressed hydration transfer (router query() pattern)

Serialize cache entries under sq:<queryHash> at fetch-dispatch time
(provider-side, promise-valued so streaming settles ride the payload)
instead of tying transfer to a rendered node's positional id. Client
hooks look their own hash up and prime through query-core hydrate();
the registry outlives the hydration window, so prefetched-never-rendered
queries transfer and late mounts (lazy routes, post-hydration navigation)
adopt the server payload instead of refetching — restoring full
cache-level dehydration coverage with less machinery. Priming moved ahead
of the attach render effect (its effect half runs synchronously inside an
active flush, and mount policy against a cold cache would refetch).
Drops the peekNextChildId dependency; the data root reverts to { value }.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(solid-query): drop internal porting notes from the tree

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-query)!: remove create* aliases, completing the #8950 deprecation

The create*/Create* names were kept as a migration bridge when v5 made
use* canonical (#8950 deprecated them). This major already rewrites every
callsite's semantics, so the bridge retires: use* is the only naming,
matching the docs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

* refactor(solid-query)!: drop isInitialLoading (deprecated alias of isLoading)

Core deprecated it in favor of isLoading; the adapter's getter was
byte-identical. Result types now omit it (distributively over the
Defined result unions so status discriminants survive), and useBaseQuery
declares the adapter's own result face instead of the core union.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(solid-query): require solid-js >= 2.0.0-rc.4

rc.4 is published and carries the hydration-end divergence takeover the
adapter's streaming hydration relies on. Bump the peer range and dev dep
off the locally-built solid and onto the released bits; full suite (344
adapter + 7 persist-client tests, typecheck) green against published rc.4.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant