Skip to content

Commit e82a2aa

Browse files
committed
Fix create-hydrogen snapshot for TokenlessApi route
Update the integration test snapshot to include the TokenlessApi route that was added in #2948 but the snapshot was never updated. Also includes skeleton template changes for the cookie migration backport: - Use createRequestHandler from @Shopify/hydrogen with proxyStandardRoutes - Minor formatting cleanup in root.tsx
1 parent aa4bc92 commit e82a2aa

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@shopify/hydrogen': patch
3+
'@shopify/hydrogen-react': patch
4+
---
5+
6+
Support Shopify's new consolidated cookie architecture.
7+
8+
- Added `createRequestHandler` export to `@shopify/hydrogen` with built-in SFAPI proxy support
9+
- Added `getTrackingValues()` utility to read tracking values (`uniqueToken`/`visitToken`) from `server-timing` headers via the Performance API
10+
- Updated `useShopifyCookies` hook with `fetchTrackingValues` and `ignoreDeprecatedCookies` options
11+
- Added `sameDomainForStorefrontApi` option to `ShopifyProvider` for proxy-aware consent libraries
12+
- Storefront client now collects and forwards cookies and server-timing headers from subrequests

.changeset/remix-oxygen-proxy.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@shopify/remix-oxygen': minor
3+
---
4+
5+
Added built-in Storefront API proxy support to `createRequestHandler`.
6+
7+
- New `proxyStandardRoutes` option (default: `true`) automatically proxies `/api/.../graphql.json` requests via `storefront.forward()`
8+
- New `collectTrackingInformation` option (default: `true`) forwards cookies and server-timing headers from SFAPI subrequests to the browser
9+
- Sets `_sfapi_proxy` server-timing header for document requests to signal proxy availability
10+
- Updated `getStorefrontHeaders` to check `sec-purpose` header before `purpose` header

packages/create-hydrogen/integration.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('create-hydrogen', () => {
5959
│ • Search (/search) │
6060
│ • Robots (/robots.txt) │
6161
│ • Sitemap (/sitemap.xml & /sitemap/:type/:page.xml) │
62+
│ • TokenlessApi (/api/:version/graphql.json) │
6263
│ │
6364
│ Next steps │
6465
│ │

templates/skeleton/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// @ts-ignore
44
// eslint-disable-next-line import/no-unresolved
55
import * as remixBuild from 'virtual:remix/server-build';
6-
import {storefrontRedirect} from '@shopify/hydrogen';
7-
import {createRequestHandler} from '@shopify/remix-oxygen';
6+
import {storefrontRedirect, createRequestHandler} from '@shopify/hydrogen';
87
import {createAppLoadContext} from '~/lib/context';
98

109
/**
@@ -31,6 +30,7 @@ export default {
3130
build: remixBuild,
3231
mode: process.env.NODE_ENV,
3332
getLoadContext: () => appLoadContext,
33+
proxyStandardRoutes: true,
3434
});
3535

3636
const response = await handleRequest(request);

0 commit comments

Comments
 (0)