mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
chore: enable prefetch
This commit is contained in:
@@ -25,7 +25,6 @@ export default async function Page({ params }: { params: { package: string } })
|
||||
className={buttonVariants({ variant: 'secondary' })}
|
||||
href={`/docs/packages/${params.package}/${version}`}
|
||||
key={`${version}-${idx}`}
|
||||
prefetch={false}
|
||||
>
|
||||
<div className="flex grow flex-row place-content-between place-items-center gap-4">
|
||||
<div className="flex flex-row place-content-between place-items-center gap-4">
|
||||
|
||||
@@ -16,7 +16,6 @@ export default function Page() {
|
||||
className={buttonVariants({ variant: 'secondary' })}
|
||||
href={`/docs/packages/${pkg}`}
|
||||
key={`${pkg}-${idx}`}
|
||||
prefetch={false}
|
||||
>
|
||||
<div className="flex grow flex-row place-content-between place-items-center gap-4">
|
||||
<div className="flex flex-row place-content-between place-items-center gap-4">
|
||||
|
||||
@@ -30,7 +30,6 @@ export default function Header() {
|
||||
className="rounded outline-none hover:underline focus:ring focus:ring-width-2 focus:ring-blurple"
|
||||
href={`/${original.slice(0, idx + 1).join('/')}` as Route}
|
||||
key={`${path}-${idx}`}
|
||||
prefetch={false}
|
||||
>
|
||||
{path}
|
||||
</Link>
|
||||
|
||||
@@ -39,7 +39,5 @@ export function ItemLink<Route extends string>(props: PropsWithChildren<ItemLink
|
||||
|
||||
const { itemURI, packageName: pkgName, ...linkProps } = props;
|
||||
|
||||
return (
|
||||
<Link {...linkProps} prefetch={false} href={`/docs/packages/${pkgName ?? packageName}/${version}/${itemURI}`} />
|
||||
);
|
||||
return <Link {...linkProps} href={`/docs/packages/${pkgName ?? packageName}/${version}/${itemURI}`} />;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export default function PackageSelect() {
|
||||
const packageMenuItems = useMemo(
|
||||
() =>
|
||||
PACKAGES.map((pkg, idx) => (
|
||||
<Link href={`/docs/packages/${pkg}/main`} key={`${pkg}-${idx}`} prefetch={false}>
|
||||
<Link href={`/docs/packages/${pkg}/main`} key={`${pkg}-${idx}`}>
|
||||
<MenuItem
|
||||
className="my-0.5 rounded bg-white p-3 text-sm outline-none active:bg-light-800 dark:bg-dark-600 hover:bg-light-700 focus:ring focus:ring-width-2 focus:ring-blurple dark:active:bg-dark-400 dark:hover:bg-dark-500"
|
||||
id={pkg}
|
||||
|
||||
@@ -19,7 +19,7 @@ export default function VersionSelect({ versions }: { readonly versions: string[
|
||||
const versionMenuItems = useMemo(
|
||||
() =>
|
||||
versions?.map((item, idx) => (
|
||||
<Link href={`/docs/packages/${packageName}/${isDev ? 'main' : item}`} key={`${item}-${idx}`} prefetch={false}>
|
||||
<Link href={`/docs/packages/${packageName}/${isDev ? 'main' : item}`} key={`${item}-${idx}`}>
|
||||
<MenuItem
|
||||
className="my-0.5 rounded bg-white p-3 text-sm outline-none active:bg-light-800 dark:bg-dark-600 hover:bg-light-700 focus:ring focus:ring-width-2 focus:ring-blurple dark:active:bg-dark-400 dark:hover:bg-dark-500"
|
||||
onClick={() => versionMenu.setOpen(false)}
|
||||
|
||||
@@ -73,7 +73,6 @@ export function TSDoc({ item, tsdoc }: { readonly item: ApiItem; readonly tsdoc:
|
||||
className="rounded font-mono text-blurple outline-none focus:ring focus:ring-width-2 focus:ring-blurple"
|
||||
href={urlDestination as Route}
|
||||
key={idx}
|
||||
prefetch={false}
|
||||
>
|
||||
{linkText ?? urlDestination}
|
||||
</Link>
|
||||
|
||||
@@ -16,26 +16,14 @@ export const fetchMember = cache(async (packageName: string, branchName: string,
|
||||
|
||||
const model = new ApiModel();
|
||||
|
||||
if (branchName === 'main') {
|
||||
const modelJSONFiles = await Promise.all(PACKAGES.map(async (pkg) => fetchModelJSON(pkg, branchName)));
|
||||
const modelJSON = await fetchModelJSON(packageName, branchName);
|
||||
|
||||
for (const modelJSONFile of modelJSONFiles) {
|
||||
if (!modelJSONFile) {
|
||||
continue;
|
||||
}
|
||||
|
||||
addPackageToModel(model, modelJSONFile);
|
||||
}
|
||||
} else {
|
||||
const modelJSON = await fetchModelJSON(packageName, branchName);
|
||||
|
||||
if (!modelJSON) {
|
||||
return null;
|
||||
}
|
||||
|
||||
addPackageToModel(model, modelJSON);
|
||||
if (!modelJSON) {
|
||||
return null;
|
||||
}
|
||||
|
||||
addPackageToModel(model, modelJSON);
|
||||
|
||||
const [memberName, overloadIndex] = decodeURIComponent(item).split(OVERLOAD_SEPARATOR);
|
||||
|
||||
// eslint-disable-next-line prefer-const
|
||||
|
||||
Reference in New Issue
Block a user