Remove MetadataContext type and construct isStaticMetadataRouteFile inside resolveMetadata
MetadataContext was a single-field object ({ isStaticMetadataRouteFile: boolean }) that was threaded from createMetadataComponents through the entire metadata resolution chain — six layers of function calls deep — even though every external caller always passed false. The only place that ever set it to true was mergeStaticMetadata, internally.
Instead of threading a constant through the closure and across the call stack, resolveMetadata now constructs the default false value internally. The field is replaced with a plain boolean parameter that only appears in functions that actually distinguish between static and non-static metadata routes.
Deletes metadata-context.tsx and the MetadataContext type.
Showing
Please
register
or
sign in
to comment