Skip to content

Commit 069bef8

Browse files
docs for humans by humans
1 parent 85cb6e9 commit 069bef8

19 files changed

Lines changed: 247 additions & 1813 deletions

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ A type-safe, composable query system designed specifically for Vue.js applicatio
55
[![NPM Version][npm-badge]][npm-url]
66
[![Netlify Status][netlify-badge]][netlify-url]
77
[![Discord chat][discord-badge]][discord-url]
8+
[![Open in StackBlitz][stackblitz-badge]][stackblitz-url]
89

910
<img src="https://kitbag.dev/kitbag-logo.svg" width="20%" />
1011

@@ -63,5 +64,7 @@ const user = useQuery(userQuery, { params: [123] })
6364
[npm-url]: https://www.npmjs.org/package/@kitbag/query
6465
[netlify-badge]: https://api.netlify.com/api/v1/badges/c12f79b8-49f9-4529-bc23-f8ffca8919a3/deploy-status
6566
[netlify-url]: https://app.netlify.com/sites/kitbag-query/deploys
67+
[stackblitz-badge]: https://developer.stackblitz.com/img/open_in_stackblitz_small.svg
68+
[stackblitz-url]: https://stackblitz.com/~/github.com/kitbagjs/query-preview
6669
[discord-badge]: https://img.shields.io/discord/1079625926024900739?logo=discord&label=Discord
6770
[discord-url]: https://discord.gg/zw7dpcc5HV

docs/.vitepress/config.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,13 @@ export default defineConfig({
4949
{
5050
text: 'Core Concepts',
5151
items: [
52-
{ text: 'Query Client', link: '/core-concepts/query-client' },
5352
{ text: 'Queries', link: '/core-concepts/queries' },
54-
{ text: 'Mutations', link: '/core-concepts/mutations' },
5553
{ text: 'Tags & Invalidation', link: '/core-concepts/tags-invalidation' },
54+
{ text: 'Mutations', link: '/core-concepts/mutations' },
55+
{ text: 'Query Client', link: '/core-concepts/query-client' },
5656
{ text: 'Caching', link: '/core-concepts/caching' },
5757
],
5858
},
59-
{
60-
text: 'Composables',
61-
items: [
62-
{ text: 'useQuery', link: '/composables/useQuery' },
63-
{ text: 'useMutation', link: '/composables/useMutation' },
64-
],
65-
},
6659
{
6760
text: 'Advanced Concepts',
6861
items: [
@@ -72,6 +65,7 @@ export default defineConfig({
7265
{ text: 'Optimistic Updates', link: '/advanced-concepts/optimistic-updates' },
7366
],
7467
},
68+
{ text: 'Migrating from Tanstack', link: '/compare-to-tanstack' },
7569
]
7670
},
7771

docs/advanced-concepts/background-updates.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Background Updates
22

3-
Background updates allow your application to keep data fresh without interrupting the user experience. @kitbag/query provides several mechanisms for updating data in the background.
3+
<!-- Background updates allow your application to keep data fresh without interrupting the user experience. Kitbag query provides several mechanisms for updating data in the background.
44
55
## Automatic Background Updates
66
@@ -506,18 +506,18 @@ Show non-intrusive indicators for background updates:
506506
```vue
507507
<template>
508508
<div class="content-container">
509-
<!-- Subtle refresh indicator -->
509+
// Subtle refresh indicator
510510
<div
511511
v-if="user.executing && user.data"
512512
class="refresh-indicator"
513513
>
514514
<div class="refresh-bar"></div>
515515
</div>
516516
517-
<!-- Main content -->
517+
// Main content
518518
<UserProfile v-if="user.data" :user="user.data" />
519519
520-
<!-- Toast notification for successful updates -->
520+
// Toast notification for successful updates
521521
<Teleport to="body">
522522
<Toast
523523
v-if="showUpdateToast"
@@ -762,4 +762,4 @@ const user = useQuery(userQuery, {
762762
763763
- [Optimistic Updates](/advanced-concepts/optimistic-updates) - Improving perceived performance
764764
- [Caching](/core-concepts/caching) - Understanding cache behavior
765-
- [Error Handling](/advanced-concepts/error-handling) - Handling background update errors
765+
- [Error Handling](/advanced-concepts/error-handling) - Handling background update errors -->

docs/advanced-concepts/error-handling.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Error Handling
22

3-
Effective error handling is crucial for building robust applications. @kitbag/query provides multiple layers of error handling for both queries and mutations.
3+
<!-- Effective error handling is crucial for building robust applications. Kitbag query provides multiple layers of error handling for both queries and mutations.
44
55
## Basic Error Handling
66
@@ -16,7 +16,7 @@ Effective error handling is crucial for building robust applications. @kitbag/qu
1616
<button @click="user.execute()">Retry</button>
1717
</div>
1818
<div v-else-if="user.data">
19-
<!-- User data -->
19+
// User data
2020
</div>
2121
</div>
2222
</template>
@@ -182,7 +182,7 @@ export const { query, useQuery, mutation, useMutation } = createQueryClient({
182182
Create reusable error boundary components:
183183
184184
```vue
185-
<!-- ErrorBoundary.vue -->
185+
// ErrorBoundary.vue
186186
<template>
187187
<div class="error-boundary">
188188
<div v-if="hasError" class="error-container">
@@ -337,14 +337,14 @@ const canShowSettings = computed(() => !userSettings.error)
337337
<template>
338338
<div>
339339
<div v-if="canShowProfile">
340-
<!-- User profile section -->
340+
// User profile section
341341
</div>
342342
<div v-else class="error">
343343
Failed to load profile
344344
</div>
345345
346346
<div v-if="canShowPosts">
347-
<!-- User posts section -->
347+
// User posts section
348348
</div>
349349
<div v-else class="error">
350350
Failed to load posts
@@ -401,12 +401,12 @@ Provide clear feedback during error recovery:
401401
```vue
402402
<template>
403403
<div>
404-
<!-- Loading state -->
404+
// Loading state
405405
<div v-if="user.executing && !user.data" class="loading">
406406
Loading user profile...
407407
</div>
408408
409-
<!-- Error state with retry -->
409+
// Error state with retry
410410
<div v-else-if="user.error" class="error">
411411
<h3>Unable to load profile</h3>
412412
<p>{{ getErrorMessage(user.error) }}</p>
@@ -419,9 +419,9 @@ Provide clear feedback during error recovery:
419419
</div>
420420
</div>
421421
422-
<!-- Success state -->
422+
// Success state
423423
<div v-else-if="user.data">
424-
<!-- Profile content -->
424+
// Profile content
425425
</div>
426426
</div>
427427
</template>
@@ -461,7 +461,7 @@ watch(isOnline, (online) => {
461461
You are currently offline
462462
</div>
463463
464-
<!-- Rest of component -->
464+
// Rest of component
465465
</div>
466466
</template>
467467
```
@@ -526,7 +526,7 @@ const user = useQuery(userQuery, {
526526
Create an error reporting component:
527527
528528
```vue
529-
<!-- ErrorReporter.vue -->
529+
// ErrorReporter.vue
530530
<template>
531531
<div class="error-reporter">
532532
<h3>Something went wrong</h3>
@@ -622,7 +622,7 @@ const queryClient = createQueryClient({
622622
### 3. Provide Recovery Options
623623
624624
```vue
625-
<!-- ✅ Always provide a way to recover -->
625+
// ✅ Always provide a way to recover
626626
<div v-if="error" class="error">
627627
<p>{{ error.message }}</p>
628628
<button @click="retry">Try Again</button>
@@ -661,4 +661,4 @@ const user = useQuery(userQuery, {
661661
662662
- [Loading States](/advanced-concepts/loading-states) - Managing loading UX
663663
- [Background Updates](/advanced-concepts/background-updates) - Handling background data refresh
664-
- [Optimistic Updates](/advanced-concepts/optimistic-updates) - Improving perceived performance
664+
- [Optimistic Updates](/advanced-concepts/optimistic-updates) - Improving perceived performance -->

0 commit comments

Comments
 (0)