-
Notifications
You must be signed in to change notification settings - Fork 9.3k
perf: Remove data fetching in metadata for non-booking pages #20734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
if (!parsed.success) { | ||
notFound(); | ||
} | ||
const workflow = await getWorkflow(parsed.data.workflow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data fetching for metadata isn't optimal. Below is enough.
await _generateMetadata(
(t) => t("workflows"),
(t) => t("workflows_to_automate_notifications")
);
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (04/16/25)1 reviewer was added to this PR based on Keith Williams's automation. |
import { _generateMetadata } from "app/_utils"; | ||
import type { ReactNode } from "react"; | ||
|
||
export const generateMetadata = async () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now used for both /workflows and /workflows/[workflow] page
E2E results are ready! |
export const generateMetadata = async ({ params, searchParams }: PageProps) => { | ||
const legacyCtx = buildLegacyCtx(await headers(), await cookies(), await params, await searchParams); | ||
|
||
const { appMetadata } = await getData(legacyCtx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data fetching
@@ -23,7 +23,6 @@ const normalizePages = (pages: string[] | string | undefined) => { | |||
export const generateMetadata = async ({ params }: { params: Promise<{ pages: string[] }> }) => { | |||
const { mainPage } = normalizePages((await params).pages); | |||
return await _generateMetadata( | |||
// TODO: Need to show the actual form name instead of "Form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, keeping it the current way is better
@zomars Had to resolve conflicts. Can you re-approve? 🙏 |
What does this PR do?
t
function for i18n)Before OG image
15-minute Reminder is the name of the workflow
After OG image
/workflows/[id]
page now has this metadata:Mandatory Tasks (DO NOT REMOVE)
How should this be tested?