mcp-probe-kit 3.0.14 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/build/lib/__tests__/gitnexus-bridge.unit.test.js +9 -1
- package/build/lib/gitnexus-bridge.d.ts +1 -0
- package/build/lib/gitnexus-bridge.js +29 -1
- package/build/lib/skill-bridge.d.ts +31 -0
- package/build/lib/skill-bridge.js +100 -0
- package/build/resources/ui-ux-data/charts.json +302 -0
- package/build/resources/ui-ux-data/colors.json +1058 -0
- package/build/resources/ui-ux-data/icons.json +1102 -0
- package/build/resources/ui-ux-data/landing.json +262 -0
- package/build/resources/ui-ux-data/metadata.json +6 -0
- package/build/resources/ui-ux-data/products.json +1058 -0
- package/build/resources/ui-ux-data/react-performance.json +574 -0
- package/build/resources/ui-ux-data/stacks/astro.json +266 -0
- package/build/resources/ui-ux-data/stacks/flutter.json +626 -0
- package/build/resources/ui-ux-data/stacks/html-tailwind.json +662 -0
- package/build/resources/ui-ux-data/stacks/jetpack-compose.json +626 -0
- package/build/resources/ui-ux-data/stacks/nextjs.json +218 -0
- package/build/resources/ui-ux-data/stacks/nuxt-ui.json +14 -0
- package/build/resources/ui-ux-data/stacks/nuxtjs.json +182 -0
- package/build/resources/ui-ux-data/stacks/react-native.json +350 -0
- package/build/resources/ui-ux-data/stacks/react.json +530 -0
- package/build/resources/ui-ux-data/stacks/shadcn.json +566 -0
- package/build/resources/ui-ux-data/stacks/svelte.json +134 -0
- package/build/resources/ui-ux-data/stacks/swiftui.json +26 -0
- package/build/resources/ui-ux-data/stacks/vue.json +170 -0
- package/build/resources/ui-ux-data/styles.json +1610 -0
- package/build/resources/ui-ux-data/typography.json +743 -0
- package/build/resources/ui-ux-data/ui-reasoning.json +1431 -0
- package/build/resources/ui-ux-data/ux-guidelines.json +1190 -0
- package/build/resources/ui-ux-data/web-interface.json +389 -0
- package/build/schemas/ui-ux-schemas.js +1 -1
- package/build/tools/start_product.js +8 -1
- package/build/tools/start_ui.js +14 -3
- package/build/tools/ui-ux-tools.js +21 -17
- package/build/utils/ui-data-loader.d.ts +18 -2
- package/build/utils/ui-data-loader.js +74 -12
- package/docs/i18n/en.json +4 -2
- package/docs/i18n/ja.json +4 -2
- package/docs/i18n/ko.json +4 -2
- package/docs/i18n/zh-CN.json +4 -2
- package/docs/pages/getting-started.html +3 -0
- package/package.json +2 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"No": "1",
|
|
4
|
+
"Category": "Routing",
|
|
5
|
+
"Guideline": "Use App Router for new projects",
|
|
6
|
+
"Description": "App Router is the recommended approach in Next.js 14+",
|
|
7
|
+
"Do": "app/ directory with page.tsx",
|
|
8
|
+
"Don't": "pages/ for new projects",
|
|
9
|
+
"Code Good": "app/dashboard/page.tsx",
|
|
10
|
+
"Code Bad": "pages/dashboard.tsx",
|
|
11
|
+
"Severity": "Medium",
|
|
12
|
+
"Docs URL": "https://nextjs.org/docs/app"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"No": "2",
|
|
16
|
+
"Category": "Routing",
|
|
17
|
+
"Guideline": "Use file-based routing",
|
|
18
|
+
"Description": "Create routes by adding files in app directory",
|
|
19
|
+
"Do": "page.tsx for routes layout.tsx for layouts",
|
|
20
|
+
"Don't": "Manual route configuration",
|
|
21
|
+
"Code Good": "app/blog/[slug]/page.tsx",
|
|
22
|
+
"Code Bad": "Custom router setup",
|
|
23
|
+
"Severity": "Medium",
|
|
24
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/routing"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"No": "3",
|
|
28
|
+
"Category": "Routing",
|
|
29
|
+
"Guideline": "Colocate related files",
|
|
30
|
+
"Description": "Keep components styles tests with their routes",
|
|
31
|
+
"Do": "Component files alongside page.tsx",
|
|
32
|
+
"Don't": "Separate components folder",
|
|
33
|
+
"Code Good": "app/dashboard/_components/",
|
|
34
|
+
"Code Bad": "components/dashboard/",
|
|
35
|
+
"Severity": "Low",
|
|
36
|
+
"Docs URL": ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"No": "4",
|
|
40
|
+
"Category": "Routing",
|
|
41
|
+
"Guideline": "Use route groups for organization",
|
|
42
|
+
"Description": "Group routes without affecting URL",
|
|
43
|
+
"Do": "Parentheses for route groups",
|
|
44
|
+
"Don't": "Nested folders affecting URL",
|
|
45
|
+
"Code Good": "(marketing)/about/page.tsx",
|
|
46
|
+
"Code Bad": "marketing/about/page.tsx",
|
|
47
|
+
"Severity": "Low",
|
|
48
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/routing/route-groups"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"No": "5",
|
|
52
|
+
"Category": "Routing",
|
|
53
|
+
"Guideline": "Handle loading states",
|
|
54
|
+
"Description": "Use loading.tsx for route loading UI",
|
|
55
|
+
"Do": "loading.tsx alongside page.tsx",
|
|
56
|
+
"Don't": "Manual loading state management",
|
|
57
|
+
"Code Good": "app/dashboard/loading.tsx",
|
|
58
|
+
"Code Bad": "useState for loading in page",
|
|
59
|
+
"Severity": "Medium",
|
|
60
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"No": "6",
|
|
64
|
+
"Category": "Routing",
|
|
65
|
+
"Guideline": "Handle errors with error.tsx",
|
|
66
|
+
"Description": "Catch errors at route level",
|
|
67
|
+
"Do": "error.tsx with reset function",
|
|
68
|
+
"Don't": "try/catch in every component",
|
|
69
|
+
"Code Good": "app/dashboard/error.tsx",
|
|
70
|
+
"Code Bad": "try/catch in page component",
|
|
71
|
+
"Severity": "High",
|
|
72
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/routing/error-handling"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"No": "7",
|
|
76
|
+
"Category": "Rendering",
|
|
77
|
+
"Guideline": "Use Server Components by default",
|
|
78
|
+
"Description": "Server Components reduce client JS bundle",
|
|
79
|
+
"Do": "Keep components server by default",
|
|
80
|
+
"Don't": "Add 'use client' unnecessarily",
|
|
81
|
+
"Code Good": "export default function Page()",
|
|
82
|
+
"Code Bad": "('use client') for static content",
|
|
83
|
+
"Severity": "High",
|
|
84
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/rendering/server-components"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"No": "8",
|
|
88
|
+
"Category": "Rendering",
|
|
89
|
+
"Guideline": "Mark Client Components explicitly",
|
|
90
|
+
"Description": "'use client' for interactive components",
|
|
91
|
+
"Do": "Add 'use client' only when needed",
|
|
92
|
+
"Don't": "Server Component with hooks/events",
|
|
93
|
+
"Code Good": "('use client') for onClick useState",
|
|
94
|
+
"Code Bad": "No directive with useState",
|
|
95
|
+
"Severity": "High",
|
|
96
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/rendering/client-components"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"No": "9",
|
|
100
|
+
"Category": "Rendering",
|
|
101
|
+
"Guideline": "Push Client Components down",
|
|
102
|
+
"Description": "Keep Client Components as leaf nodes",
|
|
103
|
+
"Do": "Client wrapper for interactive parts only",
|
|
104
|
+
"Don't": "Mark page as Client Component",
|
|
105
|
+
"Code Good": "<InteractiveButton/> in Server Page",
|
|
106
|
+
"Code Bad": "('use client') on page.tsx",
|
|
107
|
+
"Severity": "High",
|
|
108
|
+
"Docs URL": ""
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"No": "10",
|
|
112
|
+
"Category": "Rendering",
|
|
113
|
+
"Guideline": "Use streaming for better UX",
|
|
114
|
+
"Description": "Stream content with Suspense boundaries",
|
|
115
|
+
"Do": "Suspense for slow data fetches",
|
|
116
|
+
"Don't": "Wait for all data before render",
|
|
117
|
+
"Code Good": "<Suspense><SlowComponent/></Suspense>",
|
|
118
|
+
"Code Bad": "await allData then render",
|
|
119
|
+
"Severity": "Medium",
|
|
120
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"No": "11",
|
|
124
|
+
"Category": "Rendering",
|
|
125
|
+
"Guideline": "Choose correct rendering strategy",
|
|
126
|
+
"Description": "SSG for static SSR for dynamic ISR for semi-static",
|
|
127
|
+
"Do": "generateStaticParams for known paths",
|
|
128
|
+
"Don't": "SSR for static content",
|
|
129
|
+
"Code Good": "export const revalidate = 3600",
|
|
130
|
+
"Code Bad": "fetch without cache config",
|
|
131
|
+
"Severity": "Medium",
|
|
132
|
+
"Docs URL": ""
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"No": "12",
|
|
136
|
+
"Category": "DataFetching",
|
|
137
|
+
"Guideline": "Fetch data in Server Components",
|
|
138
|
+
"Description": "Fetch directly in async Server Components",
|
|
139
|
+
"Do": "async function Page() { const data = await fetch() }",
|
|
140
|
+
"Don't": "useEffect for initial data",
|
|
141
|
+
"Code Good": "const data = await fetch(url)",
|
|
142
|
+
"Code Bad": "useEffect(() => fetch(url))",
|
|
143
|
+
"Severity": "High",
|
|
144
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/data-fetching"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"No": "13",
|
|
148
|
+
"Category": "DataFetching",
|
|
149
|
+
"Guideline": "Configure caching explicitly (Next.js 15+)",
|
|
150
|
+
"Description": "Next.js 15 changed defaults to uncached for fetch",
|
|
151
|
+
"Do": "Explicitly set cache: 'force-cache' for static data",
|
|
152
|
+
"Don't": "Assume default is cached (it's not in Next.js 15)",
|
|
153
|
+
"Code Good": "fetch(url { cache: 'force-cache' })",
|
|
154
|
+
"Code Bad": "fetch(url) // Uncached in v15",
|
|
155
|
+
"Severity": "High",
|
|
156
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/upgrading/version-15"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"No": "14",
|
|
160
|
+
"Category": "DataFetching",
|
|
161
|
+
"Guideline": "Deduplicate fetch requests",
|
|
162
|
+
"Description": "React and Next.js dedupe same requests",
|
|
163
|
+
"Do": "Same fetch call in multiple components",
|
|
164
|
+
"Don't": "Manual request deduplication",
|
|
165
|
+
"Code Good": "Multiple components fetch same URL",
|
|
166
|
+
"Code Bad": "Custom cache layer",
|
|
167
|
+
"Severity": "Low",
|
|
168
|
+
"Docs URL": ""
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"No": "15",
|
|
172
|
+
"Category": "DataFetching",
|
|
173
|
+
"Guideline": "Use Server Actions for mutations",
|
|
174
|
+
"Description": "Server Actions for form submissions",
|
|
175
|
+
"Do": "action={serverAction} in forms",
|
|
176
|
+
"Don't": "API route for every mutation",
|
|
177
|
+
"Code Good": "<form action={createPost}>",
|
|
178
|
+
"Code Bad": "<form onSubmit={callApiRoute}>",
|
|
179
|
+
"Severity": "Medium",
|
|
180
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"No": "16",
|
|
184
|
+
"Category": "DataFetching",
|
|
185
|
+
"Guideline": "Revalidate data appropriately",
|
|
186
|
+
"Description": "Use revalidatePath/revalidateTag after mutations",
|
|
187
|
+
"Do": "Revalidate after Server Action",
|
|
188
|
+
"Don't": "'use client' with manual refetch",
|
|
189
|
+
"Code Good": "revalidatePath('/posts')",
|
|
190
|
+
"Code Bad": "router.refresh() everywhere",
|
|
191
|
+
"Severity": "Medium",
|
|
192
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/caching#revalidating"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"No": "17",
|
|
196
|
+
"Category": "Images",
|
|
197
|
+
"Guideline": "Use next/image for optimization",
|
|
198
|
+
"Description": "Automatic image optimization and lazy loading",
|
|
199
|
+
"Do": "<Image> component for all images",
|
|
200
|
+
"Don't": "<img> tags directly",
|
|
201
|
+
"Code Good": "<Image src={} alt={} width={} height={}>",
|
|
202
|
+
"Code Bad": "<img src={}/>",
|
|
203
|
+
"Severity": "High",
|
|
204
|
+
"Docs URL": "https://nextjs.org/docs/app/building-your-application/optimizing/images"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"No": "18",
|
|
208
|
+
"Category": "Images",
|
|
209
|
+
"Guideline": "Provide width and height",
|
|
210
|
+
"Description": "Prevent layout shift with dimensions",
|
|
211
|
+
"Do": "width and height props or fill",
|
|
212
|
+
"Don't": "Missing dimensions",
|
|
213
|
+
"Code Good": "<Image width={400} height={300}/>",
|
|
214
|
+
"Code Bad": "<Image src={url}/>",
|
|
215
|
+
"Severity": "High",
|
|
216
|
+
"Docs URL": ""
|
|
217
|
+
}
|
|
218
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"No": "1",
|
|
4
|
+
"Category": "Installation",
|
|
5
|
+
"Guideline": "Add Nuxt UI module",
|
|
6
|
+
"Description": "Install and configure Nuxt UI in your Nuxt project",
|
|
7
|
+
"Do": "pnpm add @nuxt/ui and add to modules",
|
|
8
|
+
"Don't": "Manual component imports",
|
|
9
|
+
"Code Good": "modules: ['@nuxt/ui']",
|
|
10
|
+
"Code Bad": "import { UButton } from '@nuxt/ui'",
|
|
11
|
+
"Severity": "High",
|
|
12
|
+
"Docs URL": "https://ui.nuxt.com/docs/getting-started/installation/nuxt"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"No": "1",
|
|
4
|
+
"Category": "Routing",
|
|
5
|
+
"Guideline": "Use file-based routing",
|
|
6
|
+
"Description": "Create routes by adding files in pages directory",
|
|
7
|
+
"Do": "pages/ directory with index.vue",
|
|
8
|
+
"Don't": "Manual route configuration",
|
|
9
|
+
"Code Good": "pages/dashboard/index.vue",
|
|
10
|
+
"Code Bad": "Custom router setup",
|
|
11
|
+
"Severity": "Medium",
|
|
12
|
+
"Docs URL": "https://nuxt.com/docs/getting-started/routing"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"No": "2",
|
|
16
|
+
"Category": "Routing",
|
|
17
|
+
"Guideline": "Use dynamic route parameters",
|
|
18
|
+
"Description": "Create dynamic routes with bracket syntax",
|
|
19
|
+
"Do": "[id].vue for dynamic params",
|
|
20
|
+
"Don't": "Hardcoded routes for dynamic content",
|
|
21
|
+
"Code Good": "pages/posts/[id].vue",
|
|
22
|
+
"Code Bad": "pages/posts/post1.vue",
|
|
23
|
+
"Severity": "Medium",
|
|
24
|
+
"Docs URL": "https://nuxt.com/docs/getting-started/routing"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"No": "3",
|
|
28
|
+
"Category": "Routing",
|
|
29
|
+
"Guideline": "Use catch-all routes",
|
|
30
|
+
"Description": "Handle multiple path segments with [...slug]",
|
|
31
|
+
"Do": "[...slug].vue for catch-all",
|
|
32
|
+
"Don't": "Multiple nested dynamic routes",
|
|
33
|
+
"Code Good": "pages/[...slug].vue",
|
|
34
|
+
"Code Bad": "pages/[a]/[b]/[c].vue",
|
|
35
|
+
"Severity": "Low",
|
|
36
|
+
"Docs URL": "https://nuxt.com/docs/getting-started/routing"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"No": "4",
|
|
40
|
+
"Category": "Routing",
|
|
41
|
+
"Guideline": "Define page metadata with definePageMeta",
|
|
42
|
+
"Description": "Set page-level configuration and middleware",
|
|
43
|
+
"Do": "definePageMeta for layout middleware title",
|
|
44
|
+
"Don't": "Manual route meta configuration",
|
|
45
|
+
"Code Good": "definePageMeta({ layout: 'admin', middleware: 'auth' })",
|
|
46
|
+
"Code Bad": "router.beforeEach for page config",
|
|
47
|
+
"Severity": "High",
|
|
48
|
+
"Docs URL": "https://nuxt.com/docs/api/utils/define-page-meta"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"No": "5",
|
|
52
|
+
"Category": "Routing",
|
|
53
|
+
"Guideline": "Use validate for route params",
|
|
54
|
+
"Description": "Validate dynamic route parameters before rendering",
|
|
55
|
+
"Do": "validate function in definePageMeta",
|
|
56
|
+
"Don't": "Manual validation in setup",
|
|
57
|
+
"Code Good": "definePageMeta({ validate: (route) => /^d+$/.test(route.params.id) })",
|
|
58
|
+
"Code Bad": "if (!valid) navigateTo('/404')",
|
|
59
|
+
"Severity": "Medium",
|
|
60
|
+
"Docs URL": "https://nuxt.com/docs/api/utils/define-page-meta"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"No": "6",
|
|
64
|
+
"Category": "Rendering",
|
|
65
|
+
"Guideline": "Use SSR by default",
|
|
66
|
+
"Description": "Server-side rendering is enabled by default",
|
|
67
|
+
"Do": "Keep ssr: true (default)",
|
|
68
|
+
"Don't": "Disable SSR unnecessarily",
|
|
69
|
+
"Code Good": "ssr: true (default)",
|
|
70
|
+
"Code Bad": "ssr: false for all pages",
|
|
71
|
+
"Severity": "High",
|
|
72
|
+
"Docs URL": "https://nuxt.com/docs/guide/concepts/rendering"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"No": "7",
|
|
76
|
+
"Category": "Rendering",
|
|
77
|
+
"Guideline": "Use .client suffix for client-only components",
|
|
78
|
+
"Description": "Mark components to render only on client",
|
|
79
|
+
"Do": "ComponentName.client.vue suffix",
|
|
80
|
+
"Don't": "v-if with process.client check",
|
|
81
|
+
"Code Good": "Comments.client.vue",
|
|
82
|
+
"Code Bad": "<div v-if=\"process.client\"><Comments/></div>",
|
|
83
|
+
"Severity": "Medium",
|
|
84
|
+
"Docs URL": "https://nuxt.com/docs/guide/directory-structure/components"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"No": "8",
|
|
88
|
+
"Category": "Rendering",
|
|
89
|
+
"Guideline": "Use .server suffix for server-only components",
|
|
90
|
+
"Description": "Mark components to render only on server",
|
|
91
|
+
"Do": "ComponentName.server.vue suffix",
|
|
92
|
+
"Don't": "Manual server check",
|
|
93
|
+
"Code Good": "HeavyMarkdown.server.vue",
|
|
94
|
+
"Code Bad": "v-if=\"process.server\"",
|
|
95
|
+
"Severity": "Low",
|
|
96
|
+
"Docs URL": "https://nuxt.com/docs/guide/directory-structure/components"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"No": "9",
|
|
100
|
+
"Category": "DataFetching",
|
|
101
|
+
"Guideline": "Use useFetch for simple data fetching",
|
|
102
|
+
"Description": "Wrapper around useAsyncData for URL fetching",
|
|
103
|
+
"Do": "useFetch for API calls",
|
|
104
|
+
"Don't": "$fetch in onMounted",
|
|
105
|
+
"Code Good": "const { data } = await useFetch('/api/posts')",
|
|
106
|
+
"Code Bad": "onMounted(async () => { data.value = await $fetch('/api/posts') })",
|
|
107
|
+
"Severity": "High",
|
|
108
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-fetch"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"No": "10",
|
|
112
|
+
"Category": "DataFetching",
|
|
113
|
+
"Guideline": "Use useAsyncData for complex fetching",
|
|
114
|
+
"Description": "Fine-grained control over async data",
|
|
115
|
+
"Do": "useAsyncData for CMS or custom fetching",
|
|
116
|
+
"Don't": "useFetch for non-URL data sources",
|
|
117
|
+
"Code Good": "const { data } = await useAsyncData('posts', () => cms.getPosts())",
|
|
118
|
+
"Code Bad": "const { data } = await useFetch(() => cms.getPosts())",
|
|
119
|
+
"Severity": "Medium",
|
|
120
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-async-data"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"No": "11",
|
|
124
|
+
"Category": "DataFetching",
|
|
125
|
+
"Guideline": "Use $fetch for non-reactive requests",
|
|
126
|
+
"Description": "$fetch for event handlers and non-component code",
|
|
127
|
+
"Do": "$fetch in event handlers or server routes",
|
|
128
|
+
"Don't": "useFetch in click handlers",
|
|
129
|
+
"Code Good": "async function submit() { await $fetch('/api/submit', { method: 'POST' }) }",
|
|
130
|
+
"Code Bad": "async function submit() { await useFetch('/api/submit') }",
|
|
131
|
+
"Severity": "High",
|
|
132
|
+
"Docs URL": "https://nuxt.com/docs/api/utils/dollarfetch"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"No": "12",
|
|
136
|
+
"Category": "DataFetching",
|
|
137
|
+
"Guideline": "Use lazy option for non-blocking fetch",
|
|
138
|
+
"Description": "Defer data fetching for better initial load",
|
|
139
|
+
"Do": "lazy: true for below-fold content",
|
|
140
|
+
"Don't": "Blocking fetch for non-critical data",
|
|
141
|
+
"Code Good": "useFetch('/api/comments', { lazy: true })",
|
|
142
|
+
"Code Bad": "await useFetch('/api/comments') for footer",
|
|
143
|
+
"Severity": "Medium",
|
|
144
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-fetch"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"No": "13",
|
|
148
|
+
"Category": "DataFetching",
|
|
149
|
+
"Guideline": "Use server option to control fetch location",
|
|
150
|
+
"Description": "Choose where data is fetched",
|
|
151
|
+
"Do": "server: false for client-only data",
|
|
152
|
+
"Don't": "Server fetch for user-specific client data",
|
|
153
|
+
"Code Good": "useFetch('/api/user-preferences', { server: false })",
|
|
154
|
+
"Code Bad": "useFetch for localStorage-dependent data",
|
|
155
|
+
"Severity": "Medium",
|
|
156
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-fetch"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"No": "14",
|
|
160
|
+
"Category": "DataFetching",
|
|
161
|
+
"Guideline": "Use pick to reduce payload size",
|
|
162
|
+
"Description": "Select only needed fields from response",
|
|
163
|
+
"Do": "pick option for large responses",
|
|
164
|
+
"Don't": "Fetching entire objects when few fields needed",
|
|
165
|
+
"Code Good": "useFetch('/api/user', { pick: ['id', 'name'] })",
|
|
166
|
+
"Code Bad": "useFetch('/api/user') then destructure",
|
|
167
|
+
"Severity": "Low",
|
|
168
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-fetch"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"No": "15",
|
|
172
|
+
"Category": "DataFetching",
|
|
173
|
+
"Guideline": "Use transform for data manipulation",
|
|
174
|
+
"Description": "Transform data before storing in state",
|
|
175
|
+
"Do": "transform option for data shaping",
|
|
176
|
+
"Don't": "Manual transformation after fetch",
|
|
177
|
+
"Code Good": "useFetch('/api/posts', { transform: (posts) => posts.map(p => p.title) })",
|
|
178
|
+
"Code Bad": "const titles = data.value.map(p => p.title)",
|
|
179
|
+
"Severity": "Low",
|
|
180
|
+
"Docs URL": "https://nuxt.com/docs/api/composables/use-fetch"
|
|
181
|
+
}
|
|
182
|
+
]
|