snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s

This commit is contained in:
upstream-mirror
2026-09-16 01:13:08 +05:00
commit 3a013ccdfe
3570 changed files with 490194 additions and 0 deletions

24
integrations/solid-vite/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Vite + Solid</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>

View File

@@ -0,0 +1,15 @@
{
"name": "solid-vite",
"private": true,
"type": "module",
"scripts": {
"build": "vite build"
},
"dependencies": {
"@tanstack/solid-query": "workspace:*",
"@tanstack/solid-query-devtools": "workspace:*",
"solid-js": "^1.9.7",
"vite": "^6.4.1",
"vite-plugin-solid": "^2.11.6"
}
}

View File

@@ -0,0 +1,22 @@
import { Match, Switch } from 'solid-js'
import { useQuery } from '@tanstack/solid-query'
const App = () => {
const query = useQuery(() => ({
queryKey: ['test'],
queryFn: async () => {
await new Promise((r) => setTimeout(r, 1000))
return 'Success'
},
}))
return (
<Switch>
<Match when={query.isPending}>Loading...</Match>
<Match when={query.isError}>An error has occurred!</Match>
<Match when={query.isSuccess}>{query.data}</Match>
</Switch>
)
}
export default App

View File

@@ -0,0 +1,19 @@
/* @refresh reload */
import { render } from 'solid-js/web'
import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
import App from './App'
const queryClient = new QueryClient()
const root = document.getElementById('root')
render(
() => (
<QueryClientProvider client={queryClient}>
<SolidQueryDevtools />
<App />
</QueryClientProvider>
),
root,
)

View File

@@ -0,0 +1,6 @@
import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid'
export default defineConfig({
plugins: [solid()],
})