next.js
00c875f5 - refactor: remove indirection in metadata image resolution (#73225)

Commit
1 year ago
refactor: remove indirection in metadata image resolution (#73225) This refactors some unnecessary indirection that made it trickier for me to understand the flow of ogImage resolution. Specifically: - `getSocialImageFallbackMetadataBase` was taking in `metadataBase` and then inverting it and returning `isMetadataBaseMissing` which is circular. It was also being called higher up in the stack than it needed to be resulting in args being passed through intermediary functions that didn't need it - `validateResolvedImageUrl` was removed in favor of grabbing the fallback and warning appropriately in `resolveAndValidateImage`. This makes it more obvious that when we're warning about using the fallback, we should actually use the fallback, which I've done in #73066
Author
Parents
Loading