1 Commits

Author SHA1 Message Date
Nathan Nguyen a3580bc79b refactor(metadata): share route pattern helpers (#996)
* refactor(metadata): share route pattern helpers

Metadata route handling repeated the same dynamic segment normalization and pattern matching in several places. That made the file-convention metadata path harder to review and kept generic routing behavior inside metadata-specific modules.

Move route pattern parsing, matching, and dynamic segment filling into a normal routing module. Reuse it from metadata route build data, file-based metadata, metadata route response matching, and app RSC intercept matching, then consolidate duplicated icon descriptor normalization in the metadata server and shim code.

Add focused route-pattern tests and keep the existing metadata and shim tests covering consumer behavior.

* fix(routing): preserve prototype-named route params

The shared route pattern matcher used a normal object for matched params, unlike the previous metadata and App RSC matchers. A route parameter named __proto__ could mutate the params object's prototype instead of being stored as an own value.

Restore a null-prototype params map and add regression coverage for single and catch-all prototype-named route params.

* fix(routing): preserve literal intercept target segments
2026-05-01 23:30:59 +01:00