Repository navigation
Advertise the UCP profile with a <link rel="ucp"> tag in ShopifyScripts - #4154
Open
mdamjanic7 wants to merge 5 commits into
Open
mdamjanic7 wants to merge 5 commits into
mdamjanic7 wants to merge 5 commits into
Conversation
5 tasks done
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
mdamjanic7
force-pushed
the
misha/ucp-discovery-link-tag
branch
from
October 14, 2026 21:23
b895385 to
37219f9
Compare
mdamjanic7
force-pushed
the
misha/ucp-discovery-link-tag
branch
from
October 14, 2026 22:26
37219f9 to
0c977b6
Compare
mdamjanic7
changed the base branch from
main
to
misha/ucp-discovery-link-header
October 14, 2026 22:26
mdamjanic7
force-pushed
the
misha/ucp-discovery-link-tag
branch
2 times, most recently
from
October 21, 2026 00:09
8a80792 to
0a66cd2
Compare
fredericoo
approved these changes
Oct 21, 2026
fredericoo
left a comment
Contributor
There was a problem hiding this comment.
very cool!
zero setup, just works, unsupported browsers ignore the unknown rel type and do not fetch it
PR body says this should ship after #3976 and it has merged so we seem to be ready
mdamjanic7
force-pushed
the
misha/ucp-discovery-link-tag
branch
from
October 23, 2026 00:59
0a66cd2 to
b230554
Compare
fredericoo
force-pushed
the
misha/ucp-discovery-link-tag
branch
from
November 12, 2026 11:41
b230554 to
0477229
Compare
fredericoo
enabled stacked auto-merge
November 12, 2026 11:43
github-merge-queue
Bot
removed this pull request from the merge queue due to invalid changes in the merge commit
Nov 12, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to invalid changes in the merge commit
Nov 12, 2026
Every storefront page now renders <link rel="ucp" href="/.well-known/ucp"> in its head through getShopifyScriptTags(), so agents and link-preview services reading the HTML can discover UCP support. The link omits Liquid's version attribute, matching Oxygen's Link header, so older Hydrogen releases never advertise a stale profile version. ShopifyLinkTagAttributes keeps its Partial shape and only gains the "ucp" rel, so existing consumer code keeps compiling.
The descriptor test already checks the exact UCP link attributes, and the UCP descriptor assignment in the type tests already covers the rel literal.
fredericoo
force-pushed
the
misha/ucp-discovery-link-tag
branch
from
November 12, 2026 11:47
0477229 to
fe61600
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Agents and link-preview services that read a storefront's HTML need a way to tell that the site supports UCP (Universal Commerce Protocol) and where its profile is. Liquid storefronts already render a
<link rel="ucp">tag in the page head. Hydrogen storefronts don't.WHAT is this pull request doing?
getShopifyScriptTags()now includes this link, so every framework'sShopifyScriptsrenders it in<head>:versionattribute. Agents get the latest stable profile, and old Hydrogen releases never advertise an outdated version. This matches Oxygen'sLinkheader.ShopifyLinkTagAttributesonly adds"ucp"torel. Type tests check that existing consumer code still compiles.ShopifyScriptslink descriptors in<head>.*.myshopify.devtoo. Those Oxygen deployment URLs don't serve the profile. Some frameworks build these tags without a request (SolidStart once per server, Next.js when prerendering), so skipping them would need a new hostname option. A 404 there is harmless.ShopifyScriptsdon't get the tag: root-loader failures in React Router and the Hydrogen example, Next'sglobal-error.tsx, and Nuxt'serror.vue. Agents find it on any normal page.hydrogen-setupruntime-scripts step mentions the link, where the profile is served, and asks you to confirm the link appears in the server-rendered<head>.Off Oxygen,
/.well-known/ucpis served byhandleShopifyRoutesonce #3976 lands, so the two should ship in the same release. TheLinkresponse header is added in #4153.HOW to test your changes?
pnpm --filter @shopify/hydrogen test. The core, React and VueShopifyScriptstests check that the link renders exactly once with onlyrelandhref.curl -s localhost:5173/ | grep 'rel="ucp"'. You should see one<link rel="ucp" href="/.well-known/ucp"/>in<head>./.well-known/ucp.Locally I confirmed the tag in server-rendered HTML from:
The Hydrogen and Astro examples share those render paths, but need example secrets to run.
Post-merge steps
Release together with or after #3976.
Checklist