Skip to content

fix(metadata): render the Open Graph tags of each type like Next.js - #4753

Open
ash1day wants to merge 1 commit into
cloudflare:mainfrom
ash1day:fix/metadata-open-graph-type-fields
Open

ash1day wants to merge 1 commit into
cloudflare:mainfrom
ash1day:fix/metadata-open-graph-type-fields

Conversation

@ash1day

@ash1day ash1day commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

openGraph renders only og:type, the article times and article:author, whatever the type. Next.js renders a set of tags per type:

openGraph.type Next.js 16.2.6 main f4f6d48
article article:expiration_time, article:section, article:tag missing
book book:isbn, book:release_date, book:author, book:tag authors as article:author, rest missing
profile profile:first_name, last_name, username, gender missing
music.* music:duration, album, song, musician, creator, release_date missing
video.movie, video.episode video:actor, director, writer, duration, release_date, tag, series missing
any og:determiner, og:country_name, og:ttl, og:image:secure_url, twitter:image:secure_url missing

A single value where Next.js accepts one or a list (authors: new URL(...)) also answers 500 on main.

This change ports the type switch of createMetadataElements (packages/next/src/lib/metadata/metadata.tsx). Without a type, the article times and authors are still rendered as before (Next.js renders them only for type: "article").

Verification

16 pages covering each type: with this change the type-specific tags equal Next.js 16.2.6 (next start) in content and order on vite preview, and on workers.dev for the six pages checked there. One input differs on purpose: Next.js splits a single-string songs into characters; this renders one tag.

Tests

tests/features.test.ts: one case per type with the tags Next.js renders, plus the four basic fields.

Only og:type, the article times and article:author were rendered, so an
article lost its section and tags, a book's authors became article:author,
and profile, music and video pages had no type-specific tags. og:determiner,
og:country_name, og:ttl and an image's secure_url were dropped too.
@clanky-the-clanker

Copy link
Copy Markdown

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

npm i https://pkg.pr.new/@vinext/cloudflare@4753

create-vinext-app

npm i https://pkg.pr.new/create-vinext-app@4753

@vinext/types

npm i https://pkg.pr.new/@vinext/types@4753

vinext

npm i https://pkg.pr.new/vinext@4753

@cloudflare/workers-response-store

npm i https://pkg.pr.new/@cloudflare/workers-response-store@4753

commit: f2e2bc0

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared f2e2bc0 against base 7183a4c using alternating same-runner rounds. Next.js was unchanged and skipped.

1 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 152.5 KB 152.5 KB ⚫ 0.0%
Client entry size (gzip) vinext 140.8 KB 140.8 KB ⚫ 0.0%
Dev server cold start vinext 2.30 s 2.25 s 🟢 -2.5%
Dev server cold start (large Pages Router app) vinext 18.34 s 18.25 s ⚫ -0.5%
Production build time vinext 2.73 s 2.71 s ⚫ -0.9%
RSC entry closure size (gzip) vinext 143.0 KB 143.5 KB ⚫ +0.4%
Server bundle size (gzip) vinext 250.9 KB 251.4 KB ⚫ +0.2%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant