mirror of
https://github.com/supabase/supabase.git
synced 2026-05-23 19:13:13 +08:00
The examples folder needs to be explicitly included in the Vercel Serverless bundle. Because it's at the root of the monorepo rather than being within the `app/docs` folder, we copy it over pre-build (and pre-dev). Test the examples/prompts fix by re-enabling revalidations on graphql pages. Added a temp version of the fetch function so we can gradually reenable and monitor Vercel error rates over time.
29 lines
813 B
TypeScript
29 lines
813 B
TypeScript
/**
|
|
* Next.js extends native `fetch` with revalidation options.
|
|
*
|
|
* This module provides some reusable utility functions to set revalidation
|
|
* options for `fetch`, for example when it needs to be passed to a
|
|
* third-party API.
|
|
*/
|
|
|
|
import { ONE_DAY_IN_SECONDS } from './helpers.time'
|
|
|
|
function fetchWithNextOptions({
|
|
next,
|
|
cache,
|
|
}: {
|
|
next?: NextFetchRequestConfig
|
|
cache?: RequestInit['cache']
|
|
}) {
|
|
return (info: RequestInfo) => fetch(info, { next, cache })
|
|
}
|
|
|
|
const fetchRevalidatePerDay_TEMP_TESTING = fetchWithNextOptions({
|
|
next: { revalidate: ONE_DAY_IN_SECONDS },
|
|
})
|
|
// [Charis 2024-12-28]
|
|
// Temporarily disabling revalidation as a hotfix for Vercel NFT problem
|
|
const fetchRevalidatePerDay = fetch
|
|
|
|
export { fetchWithNextOptions, fetchRevalidatePerDay, fetchRevalidatePerDay_TEMP_TESTING }
|