Skip to content

Commit d19dbff

Browse files
committed
feat: support vite 6
1 parent b01dce4 commit d19dbff

File tree

5 files changed

+180
-73
lines changed

5 files changed

+180
-73
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"mlly": "^1.7.3",
179179
"pathe": "^1.1.2",
180180
"scule": "^1.3.0",
181-
"unplugin": "^1.16.0",
181+
"unplugin": "2.0.0-beta.1",
182182
"yaml": "^2.6.1"
183183
},
184184
"peerDependencies": {
@@ -219,7 +219,7 @@
219219
"unplugin-auto-import": "^0.18.6",
220220
"unplugin-vue-markdown": "^0.26.3",
221221
"unplugin-vue-router": "workspace:*",
222-
"vite": "^5.4.11",
222+
"vite": "^6.0.1",
223223
"vite-plugin-vue-devtools": "^7.6.7",
224224
"vitepress": "1.5.0",
225225
"vitest": "^2.1.6",

playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"@vue/tsconfig": "^0.6.0",
1313
"json-server": "^0.17.4",
1414
"unplugin-vue-router": "workspace:*",
15-
"vite": "^5.4.11",
16-
"vite-plugin-inspect": "^0.8.8"
15+
"vite": "^6.0.1",
16+
"vite-plugin-inspect": "^0.10.1"
1717
},
1818
"dependencies": {
1919
"@tanstack/vue-query": "^5.60.6",

playground/src/pages/users/colada-loader.[id].vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts" setup>
22
import { simulateError, useUserData } from '@/loaders/colada-loaders'
3-
import { serializeTreeMap } from '@pinia/colada'
4-
import { getActivePinia } from 'pinia'
3+
import { serializeTreeMap, useQueryCache } from '@pinia/colada'
54
65
definePage({
76
meta: {
@@ -10,16 +9,9 @@ definePage({
109
})
1110
1211
const route = useRoute('/users/colada-loader.[id]')
13-
14-
const pinia = getActivePinia()!
12+
const queryCache = useQueryCache()
1513
function copy() {
16-
console.log(
17-
JSON.parse(
18-
JSON.stringify(
19-
serializeTreeMap(pinia.state.value._pc_query.entryRegistry)
20-
)
21-
)
22-
)
14+
console.log(JSON.parse(JSON.stringify(serializeTreeMap(queryCache.caches))))
2315
}
2416
2517
const {

playground/src/pages/users/pinia-colada.[id].vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,24 @@ const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
33
</script>
44

55
<script lang="ts" setup>
6-
import { computed, ref } from 'vue'
7-
import { useQuery, serialize } from '@pinia/colada'
8-
import { getActivePinia } from 'pinia'
6+
import { ref } from 'vue'
7+
import { useQuery, serializeTreeMap, useQueryCache } from '@pinia/colada'
98
109
const route = useRoute('/users/[id]')
1110
1211
const simulateError = ref(false)
1312
14-
const pinia = getActivePinia()!
13+
const queryCache = useQueryCache()
14+
1515
function copy() {
16-
console.log(
17-
JSON.parse(
18-
JSON.stringify(serialize(pinia.state.value._pc_query.entryRegistry))
19-
)
20-
)
16+
console.log(JSON.parse(JSON.stringify(serializeTreeMap(queryCache.caches))))
2117
}
2218
2319
const {
2420
data: pcUSer,
2521
status,
2622
error: pcError,
27-
isFetching: pcIsFetching,
23+
isLoading: pcIsFetching,
2824
refetch,
2925
refresh,
3026
} = useQuery({

0 commit comments

Comments
 (0)