Skip to content

Docs/feedback june batch #80651

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

Open
wants to merge 8 commits into
base: canary
Choose a base branch
from
Open

Docs/feedback june batch #80651

wants to merge 8 commits into from

Conversation

icyJoseph
Copy link
Contributor

@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Jun 18, 2025
@icyJoseph icyJoseph requested a review from delbaoliveira June 18, 2025 10:50
@ijjk ijjk added the Font (next/font) Related to Next.js Font Optimization. label Jun 18, 2025
@icyJoseph icyJoseph changed the title Docs/feedback jun batch Docs/feedback june batch Jun 18, 2025
@gmoniava
Copy link

gmoniava commented Jun 19, 2025

Resolving generateMetadata is part of rendering the page. If the page can be pre-rendered and generateMetadata doesn't introduce dynamic behavior, its result is included in the page’s initial HTML

I hope it is ok to make a comment here.
Maybe in the above text it will be helpful to mention what kind of dynamic behavior you meant.
Because even in your first example on the linked issue, you have:

export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;
  const { uuid } = await fetch("https://httpbin.dev/uuid").then(res => res.json())

  return {
    title: slug,
    description: uuid,
  };
}

So maybe someone can assume since we are reading slug, this is dynamic behavior - which AFAIK it is not.

@icyJoseph
Copy link
Contributor Author

icyJoseph commented Jun 24, 2025

So maybe someone can assume since we are reading slug, this is dynamic behavior - which AFAIK it is not.

That's the nuanced part here... defining generateStaticParams is the key - that's what I am missing on this PR, or rather, I thought If the page can be pre-rendered was clear enough.

On second thought, I think this can stay that way.

@gmoniava
Copy link

So maybe someone can assume since we are reading slug, this is dynamic behavior - which AFAIK it is not.

That's the nuanced part here... defining generateStaticParams is the key - that's what I am missing on this PR, or rather, I thought If the page can be pre-rendered was clear enough.

On second thought, I think this can stay that way.

Well, it is up to you, I assume the dynamic behavior you mean actually implies the so called dynamic APIs (cookies, headers, etc).
For me it would be more clear to see it mentioned that way. Because like I said reading slug can also be considered dynamic by someone. But maybe some readers will understand.

@icyJoseph
Copy link
Contributor Author

icyJoseph commented Jun 24, 2025

Because like I said reading slug can also be considered dynamic by someone. But maybe some readers will understand.

I hear ya, it is dynamic though, but you can provide ahead-of-time info for pre-rendering, by defining generateStaticParams - and then you can control with dynamicParams whether, more variants are allowed at runtime - very layered issue - if you go the dynamicParams false way, then things are settled, no more pages will be built. If you let it be true, then at runtime more pages can be made, on demand. And defining no generateStaticParams keeps these pages dynamic by definition.

@gmoniava
Copy link

gmoniava commented Jun 25, 2025

Because like I said reading slug can also be considered dynamic by someone. But maybe some readers will understand.

I hear ya, it is dynamic though, but you can provide ahead-of-time info for pre-rendering, by defining generateStaticParams - and then you can control with dynamicParams whether, more variants are allowed at runtime - very layered issue - if you go the dynamicParams false way, then things are settled, no more pages will be built. If you let it be true, then at runtime more pages can be made, on demand. And defining no generateStaticParams keeps these pages dynamic by definition.

I may know that, but my point is in the documentation, someone else could have understood it differently. That's why one must strive to write docs in a way to not leave room for misinterpreting things.

@icyJoseph
Copy link
Contributor Author

I may know that, but my point is in the documentation, someone else could have understood it differently. That's why one must strive to write docs in a way to not leave room for misinterpreting things.

Totally agree. I monitor several channels to try and catch these. Also as features evolved, and defaults changed, some pieces of documentation that pinned, or relied, on other bits, have lost their implicit context, and I am always trying to find those. I appreciate the feedback and effort to discuss this.

@gmoniava
Copy link

gmoniava commented Jun 25, 2025

I may know that, but my point is in the documentation, someone else could have understood it differently. That's why one must strive to write docs in a way to not leave room for misinterpreting things.

Totally agree. I monitor several channels to try and catch these. Also as features evolved, and defaults changed, some pieces of documentation that pinned, or relied, on other bits, have lost their implicit context, and I am always trying to find those. I appreciate the feedback and effort to discuss this.

Well that's good because like I mentioned here (just resharing the link here), bad docs can alienate developers. Sadly I have found something unclear or confusing more than a few times in Nextjs docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. Font (next/font) Related to Next.js Font Optimization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants