next.js
6519ac4f - [dynamicIO] model pathname access in metadata as async (#79136)

Commit
354 days ago
[dynamicIO] model pathname access in metadata as async (#79136) reading the pathname is akin to reading params and it should be an async function so metadata can postpone during prerendering just like usercode can. Unforutnately the current metadata merging implementation was synchronous. It might be tempting to just await the pathname high up and let the merge continue to be sync but this might trigger dynamic metadata when not necessary since only certain metadata properties require the pathname. In an effort to maximize which metadata can be prerendered I converted the necessary merging functions to be async and passed a promise in that will exhibit the correct semantics when accessed when dynamicIO is enabled.
Author
Parents
Loading