-
-
Notifications
You must be signed in to change notification settings - Fork 3
Develop #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #11
Conversation
* Add VPS and Dedicated server hosting support (#6) Added support for VPS and Dedicated server hosting. * Update providers readme Allow hosts who offer VPS and Dedicated servers
* Develop (#9) * Add VPS and Dedicated server hosting support (#6) (#7) Added support for VPS and Dedicated server hosting. * Updated stuff (#8) * Add VPS and Dedicated server hosting support (#6) Added support for VPS and Dedicated server hosting. * Update providers readme Allow hosts who offer VPS and Dedicated servers * Update contact link to open an issue on GitHub * feat(fix): my fixes --------- Co-authored-by: Pixelated <toxic.dev09@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes data-fetching and several UI/OG-image presentation details by migrating from Axios/custom hooks to native fetch + TanStack Query, while also refining landing-page layouts and OG image rendering.
Changes:
- Replaced the Axios-based GitHub API client with a
fetch-based implementation (timeout + rate-limit tracking). - Reworked
useFetchto use TanStack React Query and added a rootQueryProvider(plus dependencies). - Updated landing-page CTA/Tracer layouts and redesigned OG images to include the site logo via filesystem reads.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utils/src/functions/githubFetcher.ts | Migrates GitHub fetching from Axios to fetch and centralizes request handling. |
| packages/ui/src/core/layout/hero.tsx | Makes CTA buttons full-width on mobile and aligns button sizing. |
| packages/ui/src/core/landing/tracer.tsx | Reworks mobile tracer rendering into segmented steps for readability. |
| packages/core/src/useFetch/index.ts | Switches the hook implementation to TanStack Query’s useQuery. |
| package.json | Removes Axios and adds TanStack Query + Devtools dependencies. |
| components/providers/query-provider.tsx | Introduces QueryClientProvider wrapper for the app. |
| app/layout.tsx | Wraps the app with the new QueryProvider. |
| app/hosting/opengraph-image.tsx | Updates hosting OG image generation to embed a logo and new layout. |
| app/docs-og/[...slug]/route.tsx | Replaces fumadocs OG generation with a custom ImageResponse renderer and embedded logo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| body: JSON.stringify(data), | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| ...options?.headers, | ||
| }, |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...options?.headers here has the same HeadersInit issue as in request() (it may be a Headers instance or tuple array), so spreading can fail type-checking and/or behave unexpectedly at runtime. Consider normalizing headers (or accepting only plain-object headers) before merging.
| body: JSON.stringify(data), | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| ...options?.headers, | ||
| }, |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same HeadersInit spread problem as in post(): ...options?.headers may not be a plain object (can be Headers / tuple array), which can break compilation or runtime merging. Normalize headers before spreading/merging.
| } = useQuery({ | ||
| queryKey: [url, ...deps], | ||
| queryFn: async ({ signal }) => { | ||
| const res = await fetch(url, { ...reqOpt, signal }); |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useQuery defaults (notably retry: 3 and caching/stale behavior) change semantics vs the previous single-shot fetch implementation and can lead to unexpected extra requests/delays. If you want to preserve prior behavior, set query options explicitly (e.g., disable retries, and configure refetch-on-focus/mount as needed).
| return ( | ||
| <QueryClientProvider client={queryClient}> | ||
| {children} | ||
| <ReactQueryDevtools initialIsOpen={false} /> |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReactQueryDevtools is rendered unconditionally, which will ship devtools code in production bundles. Consider rendering it only in development (e.g., process.env.NODE_ENV === "development") and/or dynamically importing it to keep prod bundles smaller.
| <ReactQueryDevtools initialIsOpen={false} /> | |
| {process.env.NODE_ENV === "development" && ( | |
| <ReactQueryDevtools initialIsOpen={false} /> | |
| )} |
| import React from "react"; | ||
| import fs from "node:fs"; | ||
| import path from "node:path"; | ||
|
|
||
| export const dynamic = "force-dynamic"; |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This route now imports node:fs/node:path but does not pin runtime = "nodejs". The rest of the codebase explicitly sets Node runtime for ImageResponse routes (e.g., app/banner/route.tsx:3). Add export const runtime = "nodejs"; here to avoid accidental Edge runtime execution where fs isn’t available.
| <img | ||
| // @ts-ignore | ||
| src={logoData as any} | ||
| alt="Logo" |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid // @ts-ignore/as any for the <img src>. Use a type-safe src representation (e.g., data URL) or an explicit supported binary type so this doesn’t silently mask incorrect values.
| headers: { | ||
| ...config?.headers, | ||
| Accept: "application/vnd.github.v3+json", | ||
| "User-Agent": this.userAgent, | ||
| Authorization: `Bearer ${this.authToken}`, | ||
| ...options.headers, |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options.headers in fetch is HeadersInit (can be Headers or tuple array), so spreading it into an object is not type-safe and can break at runtime. Also, because ...options.headers comes after Authorization, callers can override the auth header (previous behavior always enforced the GitHub token). Normalize options.headers to a plain object first and apply Authorization last.
| url: string, | ||
| reqOpt?: RequestInit, | ||
| deps?: any[], | ||
| deps: any[] = [], |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type.
| } | ||
| throw error; | ||
| } | ||
| async post<T>(endpoint: string, data?: any, options?: RequestInit): Promise<GitHubResponse<T>> { |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type.
| } | ||
| throw error; | ||
| } | ||
| async put<T>(endpoint: string, data?: any, options?: RequestInit): Promise<GitHubResponse<T>> { |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type.
No description provided.