MCPcopy Create free account
hub / github.com/vercel/vercel / getHTMLPostponedState

Function getHTMLPostponedState

packages/next/src/utils.ts:4747–4771  ·  view source on GitHub ↗

* Get the postponed state for a route. * * @param appDir - The app directory. * @param routeFileNoExt - The route file name without the extension. * @returns The postponed state for the route.

({
  appDir,
  routeFileNoExt,
}: {
  appDir: string;
  routeFileNoExt: string;
})

Source from the content-addressed store, hash-verified

4745 * @returns The postponed state for the route.
4746 */
4747function getHTMLPostponedState({
4748 appDir,
4749 routeFileNoExt,
4750}: {
4751 appDir: string;
4752 routeFileNoExt: string;
4753}) {
4754 const metaPath = path.join(appDir, `${routeFileNoExt}.meta`);
4755 if (!fs.existsSync(metaPath)) {
4756 return null;
4757 }
4758
4759 const meta: unknown = JSON.parse(fs.readFileSync(metaPath, 'utf8'));
4760
4761 if (
4762 typeof meta !== 'object' ||
4763 meta === null ||
4764 !('postponed' in meta) ||
4765 typeof meta.postponed !== 'string'
4766 ) {
4767 return null;
4768 }
4769
4770 return meta.postponed;
4771}
4772
4773export async function getServerActionMetaRoutes(
4774 distDir: string

Callers 1

onPrerenderRouteFunction · 0.85

Calls 4

joinMethod · 0.45
existsSyncMethod · 0.45
parseMethod · 0.45
readFileSyncMethod · 0.45

Tested by

no test coverage detected