[PR #946] [MERGED] fix: support static metadata URL resolver (fillStaticMetadataSegment) #971

Closed
opened 2026-05-06 13:11:20 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/946
Author: @Divkix
Created: 4/29/2026
Status: Merged
Merged: 4/29/2026
Merged by: @james-elicx

Base: mainHead: fix/861-static-metadata-url


📝 Commits (2)

  • 9871be4 fix: support static metadata URL resolver (fillStaticMetadataSegment) (#861)
  • b8d8bb1 fix: address review feedback for PR #946

📊 Changes

2 files changed (+199 additions, -3 deletions)

View changed files

📝 packages/vinext/src/server/metadata-routes.ts (+123 -3)
📝 tests/metadata-routes.test.ts (+76 -0)

📄 Description

Fixes #861

Summary

  • Port fillStaticMetadataSegment from Next.js (commit 7873aea) to correctly resolve URLs for static metadata files under dynamic parent segments
  • Update scanMetadataFiles to normalize dynamic segments to "-" placeholders in servedUrl for static metadata files
  • Strip route groups and parallel route slots from static metadata URL paths, applying djb2 hash suffixes for collision avoidance
  • Keep dynamic metadata files on the existing urlPrefix path for patternParts-based runtime matching
  • Add unit tests for fillStaticMetadataSegment and integration tests for static metadata scanning under dynamic parents

Test plan

  • Unit tests: tests/metadata-routes.test.ts — 69 tests (8 new for fillStaticMetadataSegment, 3 new for scan with dynamic parents)
  • Integration tests: tests/app-router.test.ts — metadata routes section (20 tests, all passing)
  • Full suite: 4398 tests passing (1 pre-existing flaky timeout in pages-router)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/946 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 4/29/2026 **Status:** ✅ Merged **Merged:** 4/29/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/861-static-metadata-url` --- ### 📝 Commits (2) - [`9871be4`](https://github.com/cloudflare/vinext/commit/9871be4cfb52af8c486cd2ded0165ba84ee56c28) fix: support static metadata URL resolver (fillStaticMetadataSegment) (#861) - [`b8d8bb1`](https://github.com/cloudflare/vinext/commit/b8d8bb124ceb754b012af95f0c647c8f6efdaa3e) fix: address review feedback for PR #946 ### 📊 Changes **2 files changed** (+199 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/metadata-routes.ts` (+123 -3) 📝 `tests/metadata-routes.test.ts` (+76 -0) </details> ### 📄 Description Fixes #861 ## Summary - Port `fillStaticMetadataSegment` from Next.js (commit 7873aea) to correctly resolve URLs for static metadata files under dynamic parent segments - Update `scanMetadataFiles` to normalize dynamic segments to "-" placeholders in servedUrl for static metadata files - Strip route groups and parallel route slots from static metadata URL paths, applying djb2 hash suffixes for collision avoidance - Keep dynamic metadata files on the existing `urlPrefix` path for patternParts-based runtime matching - Add unit tests for `fillStaticMetadataSegment` and integration tests for static metadata scanning under dynamic parents ## Test plan - Unit tests: `tests/metadata-routes.test.ts` — 69 tests (8 new for `fillStaticMetadataSegment`, 3 new for scan with dynamic parents) - Integration tests: `tests/app-router.test.ts` — metadata routes section (20 tests, all passing) - Full suite: 4398 tests passing (1 pre-existing flaky timeout in pages-router) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:20 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#971
No description provided.