@shopify/hydrogen 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { NoIndexPageSeo } from './NoIndexSeo.client.js';
6
6
  import type { DefaultPage as DefaultPageType, HomePage as HomePageType } from './seo-types';
7
7
  declare type Props = {
8
8
  type: 'defaultSeo';
9
- data: Omit<DefaultPageType, 'url'>;
9
+ data: Omit<DefaultPageType, 'url' | 'metafields' | 'id' | 'moneyFormat' | 'name' | 'paymentSettings' | 'primaryDomain' | 'shipsToCountries'>;
10
10
  } | {
11
11
  type: 'homepage';
12
12
  data: Omit<HomePageType, 'url'>;
@@ -164,7 +164,7 @@ async function processRequest(handleRequest, App, url, request, sessionApi, opti
164
164
  const buffered = await bufferReadableStream(rsc.readable.getReader());
165
165
  const rscDidError = !!rsc.didError();
166
166
  postRequestTasks('rsc', rscDidError ? 500 : 200, request, response, rscDidError);
167
- if (rscDidError) {
167
+ if (!rscDidError) {
168
168
  response.headers.set('cache-control', response.cacheControlHeader);
169
169
  cacheResponse(response, request, [buffered], revalidate);
170
170
  }
@@ -4,9 +4,11 @@ export declare type RouteProps = {
4
4
  path: string;
5
5
  /** A reference to a React Server Component that's rendered when the route is active. */
6
6
  page: ReactElement;
7
+ /** The base path to use for links. Defaults to `/`. */
8
+ basePath?: string;
7
9
  };
8
10
  /**
9
11
  * The `Route` component is used to set up a route in Hydrogen that's independent of the file system. Routes are
10
12
  * matched in the order that they're defined.
11
13
  */
12
- export declare function Route({ path, page }: RouteProps): ReactElement | null;
14
+ export declare function Route({ path, page, basePath, }: RouteProps): ReactElement | null;
@@ -6,7 +6,7 @@ import { RouteParamsProvider } from '../useRouteParams/RouteParamsProvider.clien
6
6
  * The `Route` component is used to set up a route in Hydrogen that's independent of the file system. Routes are
7
7
  * matched in the order that they're defined.
8
8
  */
9
- export function Route({ path, page }) {
9
+ export function Route({ path, page, basePath = '/', }) {
10
10
  const request = useServerRequest();
11
11
  const { routeRendered, serverProps } = request.ctx.router;
12
12
  if (routeRendered)
@@ -22,7 +22,7 @@ export function Route({ path, page }) {
22
22
  if (match) {
23
23
  request.ctx.router.routeRendered = true;
24
24
  request.ctx.router.routeParams = match.params;
25
- return (React.createElement(RouteParamsProvider, { routeParams: match.params, basePath: '/' }, cloneElement(page, { params: match.params || {}, ...serverProps })));
25
+ return (React.createElement(RouteParamsProvider, { routeParams: match.params, basePath: basePath }, cloneElement(page, { params: match.params || {}, ...serverProps })));
26
26
  }
27
27
  return null;
28
28
  }
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.6.0";
1
+ export declare const LIB_VERSION = "1.6.1";
@@ -1 +1 @@
1
- export const LIB_VERSION = '1.6.0';
1
+ export const LIB_VERSION = '1.6.1';
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "engines": {
8
8
  "node": ">=14"
9
9
  },
10
- "version": "1.6.0",
10
+ "version": "1.6.1",
11
11
  "description": "Modern custom Shopify storefronts",
12
12
  "license": "MIT",
13
13
  "main": "dist/esnext/index.js",