Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/solid/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"build": "echo 'Skipped: waiting for @astrojs/solid-js Solid v2 support'",
"preview": "astro preview",
"astro": "astro"
},
Expand All @@ -18,7 +18,8 @@
"@tanstack/solid-query": "^5.90.26",
"@tanstack/solid-query-devtools": "^5.91.3",
"astro": "^5.5.6",
"solid-js": "^1.9.7",
"@solidjs/web": "2.0.0-beta.2",
"solid-js": "2.0.0-beta.2",
"tailwindcss": "^3.4.7",
"typescript": "5.8.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/astro/src/components/SolidApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
createSignal,
useContext,
} from 'solid-js'
import { isServer } from 'solid-js/web'
import { isServer } from '@solidjs/web'
import { getSearchParams, properCase } from '../utils'
import { Link } from './Link'

Expand Down
5 changes: 3 additions & 2 deletions examples/solid/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"@tanstack/solid-query-devtools": "^5.91.3",
"graphql": "^16.9.0",
"graphql-request": "^7.1.2",
"solid-js": "^1.9.7"
"@solidjs/web": "2.0.0-beta.2",
"solid-js": "2.0.0-beta.2"
},
"devDependencies": {
"typescript": "5.8.3",
"vite": "^6.4.1",
"vite-plugin-solid": "^2.11.6"
"vite-plugin-solid": "3.0.0-next.2"
}
}
62 changes: 35 additions & 27 deletions examples/solid/basic-graphql-request/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
useQuery,
} from '@tanstack/solid-query'
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
import { For, Match, Switch, createSignal } from 'solid-js'
import { render } from 'solid-js/web'
import { For, Loading, Match, Switch, createSignal } from 'solid-js'
import { render } from '@solidjs/web'
import { gql, request } from 'graphql-request'
import type { Accessor, Setter } from 'solid-js'

Expand Down Expand Up @@ -36,11 +36,13 @@ function App() {
loading sequences)
</strong>
</p>
{postId() > -1 ? (
<Post postId={postId()} setPostId={setPostId} />
) : (
<Posts setPostId={setPostId} />
)}
<Loading fallback={<div>Loading...</div>}>
{postId() > -1 ? (
<Post postId={postId()} setPostId={setPostId} />
) : (
<Posts setPostId={setPostId} />
)}
</Loading>
</QueryClientProvider>
)
}
Expand Down Expand Up @@ -85,26 +87,32 @@ function Posts(props: { setPostId: Setter<number> }) {
<>
<div>
<For each={state.data}>
{(post: any) => (
<p>
<a
onClick={() => props.setPostId(post.id)}
href="#"
style={
// We can find the existing query data here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', post.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{post.title}
</a>
</p>
)}
{(postAccessor: any) => {
const post =
typeof postAccessor === 'function'
? postAccessor()
: postAccessor
return (
<p>
<a
onClick={() => props.setPostId(post.id)}
href="#"
style={
// We can find the existing query data here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', post.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{post.title}
</a>
</p>
)
}}
</For>
</div>
<div>{state.isFetching ? 'Background Updating...' : ' '}</div>
Expand Down
5 changes: 3 additions & 2 deletions examples/solid/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"dependencies": {
"@tanstack/solid-query": "^5.90.26",
"@tanstack/solid-query-devtools": "^5.91.3",
"solid-js": "^1.9.7"
"@solidjs/web": "2.0.0-beta.2",
"solid-js": "2.0.0-beta.2"
},
"devDependencies": {
"typescript": "5.8.3",
"vite": "^6.4.1",
"vite-plugin-solid": "^2.11.6"
"vite-plugin-solid": "3.0.0-next.2"
}
}
60 changes: 33 additions & 27 deletions examples/solid/basic/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
useQuery,
} from '@tanstack/solid-query'
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
import { For, Match, Switch, createSignal } from 'solid-js'
import { render } from 'solid-js/web'
import { For, Loading, Match, Switch, createSignal } from 'solid-js'
import { render } from '@solidjs/web'
import type { Component, Setter } from 'solid-js'

const queryClient = new QueryClient({
Expand Down Expand Up @@ -49,26 +49,30 @@ function Posts(props: { setPostId: Setter<number> }) {
<>
<div>
<For each={state.data}>
{(post) => (
<p>
<a
onClick={() => props.setPostId(post.id)}
href="#"
style={
// We can access the query data here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', post.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{post.title}
</a>
</p>
)}
{(post) => {
const p =
typeof post === 'function' ? (post as () => Post)() : post
return (
<p>
<a
onClick={() => props.setPostId(p.id)}
href="#"
style={
// We can access the query data here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', p.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{p.title}
</a>
</p>
)
}}
</For>
</div>
<div>{state.isFetching ? 'Background Updating...' : ' '}</div>
Expand Down Expand Up @@ -142,11 +146,13 @@ const App: Component = () => {
loading sequences)
</strong>
</p>
{postId() > -1 ? (
<Post postId={postId()} setPostId={setPostId} />
) : (
<Posts setPostId={setPostId} />
)}
<Loading fallback={<div>Loading...</div>}>
{postId() > -1 ? (
<Post postId={postId()} setPostId={setPostId} />
) : (
<Posts setPostId={setPostId} />
)}
</Loading>
</QueryClientProvider>
)
}
Expand Down
5 changes: 3 additions & 2 deletions examples/solid/default-query-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"dependencies": {
"@tanstack/solid-query": "^5.90.26",
"@tanstack/solid-query-devtools": "^5.91.3",
"solid-js": "^1.9.7"
"@solidjs/web": "2.0.0-beta.2",
"solid-js": "2.0.0-beta.2"
},
"devDependencies": {
"typescript": "5.8.3",
"vite": "^6.4.1",
"vite-plugin-solid": "^2.11.6"
"vite-plugin-solid": "3.0.0-next.2"
}
}
58 changes: 33 additions & 25 deletions examples/solid/default-query-function/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
useQuery,
} from '@tanstack/solid-query'
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
import { For, Match, Show, Switch, createSignal } from 'solid-js'
import { render } from 'solid-js/web'
import { For, Loading, Match, Show, Switch, createSignal } from 'solid-js'
import { render } from '@solidjs/web'
import type { Setter } from 'solid-js'
import type { QueryFunction } from '@tanstack/solid-query'

Expand Down Expand Up @@ -46,9 +46,11 @@ function App() {
loading sequences)
</strong>
</p>
<Show when={postId() > -1} fallback={<Posts setPostId={setPostId} />}>
<Post postId={postId()} setPostId={setPostId} />
</Show>
<Loading fallback={<div>Loading...</div>}>
<Show when={postId() > -1} fallback={<Posts setPostId={setPostId} />}>
<Post postId={postId()} setPostId={setPostId} />
</Show>
</Loading>
</QueryClientProvider>
)
}
Expand All @@ -70,26 +72,32 @@ function Posts(props: { setPostId: Setter<number> }) {
<>
<div>
<For each={state.data}>
{(post) => (
<p>
<a
onClick={() => props.setPostId(post.id)}
href="#"
style={
// We can use the queryCache here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', post.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{post.title}
</a>
</p>
)}
{(postAccessor) => {
const post =
typeof postAccessor === 'function'
? (postAccessor as any)()
: postAccessor
return (
<p>
<a
onClick={() => props.setPostId(post.id)}
href="#"
style={
// We can use the queryCache here to show bold links for
// ones that are cached
queryClient.getQueryData(['post', post.id])
? {
'font-weight': 'bold',
color: 'green',
}
: {}
}
>
{post.title}
</a>
</p>
)
}}
</For>
</div>
<div>{state.isFetching ? 'Background Updating...' : ' '}</div>
Expand Down
5 changes: 3 additions & 2 deletions examples/solid/offline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"@tanstack/solid-query-devtools": "^5.91.3",
"@tanstack/solid-query-persist-client": "^5.90.25",
"msw": "^2.6.6",
"solid-js": "^1.9.7"
"@solidjs/web": "2.0.0-beta.2",
"solid-js": "2.0.0-beta.2"
},
"devDependencies": {
"typescript": "5.8.3",
"vite": "^6.4.1",
"vite-plugin-solid": "^2.11.6"
"vite-plugin-solid": "3.0.0-next.2"
},
"msw": {
"workerDirectory": [
Expand Down
Loading
Loading