Context
7873aea — Perf: Simplify static metadata handling (Next.js canary, 2026-04-17)
Next.js added a dedicated fillStaticMetadataSegment() function in lib/metadata/get-metadata-route.ts that resolves static metadata file URLs without route-regex work. Static metadata files like favicon.ico, icon.png, and other static metadata images no longer go through the generic fillMetadataSegment(..., true) path that was designed for dynamic metadata routes.
What changed
- New
fillStaticMetadataSegment(segment, lastSegment) function that:
- Normalizes app path segments
- Replaces dynamic and catch-all segments with
- placeholder
- Preserves metadata filename suffix logic for route groups and parallel routes
fillMetadataSegment() now short-circuits to fillStaticMetadataSegment() when isStatic=true
- Webpack static metadata image loader now emits the final static URL string at build time instead of generating runtime code that awaits
props.params
- Dev bundler uses
fillStaticMetadataSegment() for static metadata file mapping
Relevance to vinext
If vinext serves static metadata files (favicon, icons, etc.) from the app/ directory, it needs to correctly compute their URLs. The new static path handles:
- Root favicon (
/favicon.ico)
- Static metadata under dynamic parents (
/blog/-/favicon.ico)
- Route-group / parallel-route suffix behavior (hash-based suffixes)
The routing layer that scans app/ directories should use equivalent logic when resolving static metadata file paths.
Context
7873aea— Perf: Simplify static metadata handling (Next.js canary, 2026-04-17)Next.js added a dedicated
fillStaticMetadataSegment()function inlib/metadata/get-metadata-route.tsthat resolves static metadata file URLs without route-regex work. Static metadata files likefavicon.ico,icon.png, and other static metadata images no longer go through the genericfillMetadataSegment(..., true)path that was designed for dynamic metadata routes.What changed
fillStaticMetadataSegment(segment, lastSegment)function that:-placeholderfillMetadataSegment()now short-circuits tofillStaticMetadataSegment()whenisStatic=trueprops.paramsfillStaticMetadataSegment()for static metadata file mappingRelevance to vinext
If vinext serves static metadata files (favicon, icons, etc.) from the
app/directory, it needs to correctly compute their URLs. The new static path handles:/favicon.ico)/blog/-/favicon.ico)The routing layer that scans
app/directories should use equivalent logic when resolving static metadata file paths.