@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.
- package/dist/esnext/components/Seo/Seo.client.d.ts +1 -1
- package/dist/esnext/entry-server.js +1 -1
- package/dist/esnext/foundation/Route/Route.server.d.ts +3 -1
- package/dist/esnext/foundation/Route/Route.server.js +2 -2
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/package.json +1 -1
|
@@ -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:
|
|
25
|
+
return (React.createElement(RouteParamsProvider, { routeParams: match.params, basePath: basePath }, cloneElement(page, { params: match.params || {}, ...serverProps })));
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
}
|
package/dist/esnext/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.6.
|
|
1
|
+
export declare const LIB_VERSION = "1.6.1";
|
package/dist/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = '1.6.
|
|
1
|
+
export const LIB_VERSION = '1.6.1';
|