mirror of
https://github.com/supabase/supabase.git
synced 2026-06-23 04:07:46 +08:00
Before: All pages have the Home nav menu in static HTML, which is blown away and replaced by the proper nav menu upon hydration. This leads to jankiness when the page first loads and an unpleasant flash of the wrong nav menu (especially obvious on the JavaScript ref page, which takes a long time to process and rerender the nav). Now: All pages have their correct nav menu in static HTML.
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import clientLibsCommonSections from '~/spec/common-client-libs-sections.json'
|
|
import typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json'
|
|
import spec from '~/spec/supabase_py_v2.yml' assert { type: 'yml' }
|
|
import RefSectionHandler from '~/components/reference/RefSectionHandler'
|
|
import { flattenSections } from '~/lib/helpers'
|
|
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
|
|
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
|
|
import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
|
|
|
|
const sections = flattenSections(clientLibsCommonSections)
|
|
const libraryPath = '/python'
|
|
|
|
export default function PyReference(props) {
|
|
return (
|
|
<RefSectionHandler
|
|
menuId={MenuId.RefPythonV2}
|
|
sections={sections}
|
|
spec={spec}
|
|
typeSpec={typeSpec}
|
|
pageProps={props}
|
|
type="client-lib"
|
|
/>
|
|
)
|
|
}
|
|
|
|
export async function getStaticProps() {
|
|
return handleRefStaticProps(sections, libraryPath)
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
return handleRefGetStaticPaths(sections)
|
|
}
|