mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 21:24:22 +08:00
Migrates client SDK References to App Router. (Management and CLI API references aren't migrated yet, nor are self-hosting config references.) Some notes: Big changes to the way crawler pages are built and individual section URLs (e.g., javascript/select) are served. All of these used to be SSG-generated pages, but the number of heavy pages was just too much to handle -- slow as molasses and my laptop sounded like it was taking off, and CI sometimes refuses to build it all at all. Tried various tricks with caching and pre-generating data but no dice. So I changed to only building one copy of each SDK+version page, then serving the sub-URLs through a response rewrite. That's for the actual user-visible pages. For the bot pages, each sub-URL needs to be its own page, but prebuilding it doesn't work, and rendering on demand from React components is too slow (looking for super-fast response here for SEO). Instead I changed to using an API route that serves very minimal, hand-crafted HTML. It looks ugly, but it's purely for the search bots. You can test what bots see by running curl --user-agent "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" <URL_OF_PAGE> Also added some smoke tests to run against prod for the crawler routes, since we don't keep an eye on those regularly, and Vercel config changes could surprise-break them. Tested the meta images on Open Graph and all seems to work fine. With this approach, full production builds are really fast: ~5 minutes Starts using the new type spec handling, which is better at finding params automatically, so I could remove some of the manually written ones from the spec files.
110 lines
4.0 KiB
TypeScript
110 lines
4.0 KiB
TypeScript
import {
|
|
IconBranching,
|
|
IconGitHub,
|
|
IconMenuApi,
|
|
IconMenuAuth,
|
|
IconMenuCli,
|
|
IconMenuCsharp,
|
|
IconMenuDatabase,
|
|
IconMenuGraphQL,
|
|
IconMenuEdgeFunctions,
|
|
IconMenuFlutter,
|
|
IconMenuGettingStarted,
|
|
IconMenuHome,
|
|
IconMenuIntegrations,
|
|
IconMenuJavascript,
|
|
IconMenuPlatform,
|
|
IconMenuPython,
|
|
IconMenuRealtime,
|
|
IconMenuResources,
|
|
IconMenuSelfHosting,
|
|
IconMenuRestApis,
|
|
IconMenuStorage,
|
|
IconMenuSwift,
|
|
IconMenuStatus,
|
|
IconMenuKotlin,
|
|
IconMenuAI,
|
|
IconMenuDevCli,
|
|
IconSupport,
|
|
IconTroubleshooting,
|
|
} from './MenuIcons'
|
|
|
|
function getMenuIcon(menuKey: string, width: number = 16, height: number = 16, className?: string) {
|
|
switch (menuKey) {
|
|
case 'home':
|
|
return <IconMenuHome width={width} height={height} className={className} />
|
|
case 'branching':
|
|
return <IconBranching width={width} height={height} className={className} />
|
|
case 'getting-started':
|
|
return <IconMenuGettingStarted width={width} height={height} className={className} />
|
|
case 'database':
|
|
return <IconMenuDatabase width={width} height={height} className={className} />
|
|
case 'rest':
|
|
return <IconMenuRestApis width={width} height={height} className={className} />
|
|
case 'graphql':
|
|
return <IconMenuGraphQL width={width} height={height} className={className} />
|
|
case 'auth':
|
|
return <IconMenuAuth width={width} height={height} className={className} />
|
|
case 'edge-functions':
|
|
return <IconMenuEdgeFunctions width={width} height={height} className={className} />
|
|
case 'realtime':
|
|
return <IconMenuRealtime width={width} height={height} className={className} />
|
|
case 'storage':
|
|
return <IconMenuStorage width={width} height={height} className={className} />
|
|
case 'ai':
|
|
return <IconMenuAI width={width} height={height} className={className} />
|
|
case 'platform':
|
|
return <IconMenuPlatform width={width} height={height} className={className} />
|
|
case 'resources':
|
|
return <IconMenuResources width={width} height={height} className={className} />
|
|
case 'self-hosting':
|
|
return <IconMenuSelfHosting width={width} height={height} className={className} />
|
|
case 'integrations':
|
|
return <IconMenuIntegrations width={width} height={height} className={className} />
|
|
case 'reference-javascript':
|
|
return <IconMenuJavascript width={width} height={height} className={className} />
|
|
case 'reference-dart':
|
|
return <IconMenuFlutter width={width} height={height} className={className} />
|
|
case 'reference-python':
|
|
return <IconMenuPython width={width} height={height} className={className} />
|
|
case 'reference-csharp':
|
|
return <IconMenuCsharp width={width} height={height} className={className} />
|
|
case 'reference-swift':
|
|
return <IconMenuSwift width={width} height={height} className={className} />
|
|
case 'reference-kotlin':
|
|
return <IconMenuKotlin width={width} height={height} className={className} />
|
|
case 'reference-api':
|
|
return <IconMenuApi width={width} height={height} className={className} />
|
|
case 'dev-cli':
|
|
return <IconMenuDevCli width={width} height={height} className={className} />
|
|
case 'reference-cli':
|
|
return <IconMenuCli width={width} height={height} className={className} />
|
|
case 'status':
|
|
return <IconMenuStatus width={width} height={height} className={className} />
|
|
case 'github':
|
|
return <IconGitHub width={width} height={height} className={className} />
|
|
case 'support':
|
|
return <IconSupport width={width} height={height} className={className} />
|
|
case 'contributing':
|
|
return <IconTroubleshooting width={width} height={height} className={className} />
|
|
default:
|
|
return <IconMenuPlatform width={width} height={height} className={className} />
|
|
}
|
|
}
|
|
|
|
type MenuIconPickerProps = {
|
|
icon: string
|
|
width?: number
|
|
height?: number
|
|
className?: string
|
|
}
|
|
|
|
export default function MenuIconPicker({
|
|
icon,
|
|
width = 16,
|
|
height = 16,
|
|
className,
|
|
}: MenuIconPickerProps) {
|
|
return getMenuIcon(icon, width, height, className)
|
|
}
|