Skip to content

Commit

Permalink
Add vue-vite test
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jul 21, 2023
1 parent f03c6d4 commit 6050efb
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 127 deletions.
4 changes: 2 additions & 2 deletions integrations/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"dependencies": {
"@tanstack/react-query": "workspace:*",
"@tanstack/react-query-devtools": "workspace:*",
"@vitejs/plugin-react": "^4.0.1",
"@vitejs/plugin-react": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.4.0"
"vite": "^4.4.4"
}
}
6 changes: 3 additions & 3 deletions integrations/solid-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"@tanstack/solid-query": "workspace:*",
"solid-js": "^1.7.7",
"vite": "^4.4.0",
"vite-plugin-solid": "^2.7.0"
"solid-js": "^1.6.13",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.5.0"
}
}
4 changes: 2 additions & 2 deletions integrations/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@tanstack/svelte-query": "workspace:*",
"@tanstack/svelte-query-devtools": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"svelte": "^4.0.3",
"vite": "^4.4.0"
"svelte": "^4.0.0",
"vite": "^4.4.4"
}
}
24 changes: 24 additions & 0 deletions integrations/vue-vite/.gitignore
Original file line number Diff line number Diff line change
@@ -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?
11 changes: 11 additions & 0 deletions integrations/vue-vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions integrations/vue-vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "vue-vite",
"private": true,
"type": "module",
"scripts": {
"test:bundle": "vite build"
},
"dependencies": {
"@tanstack/vue-query": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"vue": "^3.2.47",
"vite": "^4.4.4"
}
}
17 changes: 17 additions & 0 deletions integrations/vue-vite/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup>
import { useQuery } from '@tanstack/vue-query'
const { isPending, isError, data } = useQuery({
queryKey: ['test'],
queryFn: async () => {
await new Promise((r) => setTimeout(r, 1000))
return 'Success'
},
})
</script>

<template>
<div v-if="isPending">Loading...</div>
<div v-else-if="isError">An error has occurred!</div>
<div v-else-if="data">{{ data }}</div>
</template>
5 changes: 5 additions & 0 deletions integrations/vue-vite/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import { VueQueryPlugin } from '@tanstack/vue-query'

createApp(App).use(VueQueryPlugin).mount('#app')
6 changes: 6 additions & 0 deletions integrations/vue-vite/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
plugins: [vue()],
})
147 changes: 27 additions & 120 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6050efb

Please sign in to comment.