@shopify/hydrogen 1.6.2 → 1.6.3
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/Link/Link.client.d.ts +1 -1
- package/dist/esnext/foundation/Cookie/Cookie.d.ts +1 -1
- package/dist/esnext/foundation/Cookie/Cookie.js +1 -1
- package/dist/esnext/foundation/Form/Form.client.js +1 -1
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +1 -1
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +1 -1
- package/dist/esnext/foundation/useQuery/hooks.d.ts +2 -2
- package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +1 -1
- package/dist/esnext/foundation/useServerProps/use-server-props.js +1 -1
- package/dist/esnext/foundation/useShop/use-shop.d.ts +1 -1
- package/dist/esnext/foundation/useShop/use-shop.js +1 -1
- package/dist/esnext/hooks/useShopQuery/hooks.d.ts +2 -2
- package/dist/esnext/utilities/log/log-query-timeline.js +1 -1
- package/dist/esnext/utilities/storefrontApi.js +2 -2
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorEle
|
|
|
8
8
|
clientState?: any;
|
|
9
9
|
/** Whether to reload the whole document on navigation. */
|
|
10
10
|
reloadDocument?: boolean;
|
|
11
|
-
/** Whether to prefetch the link source when the user signals intent. Defaults to `true`. For more information, refer to [Prefetching a link source](https://shopify.dev/custom-storefronts/hydrogen/
|
|
11
|
+
/** Whether to prefetch the link source when the user signals intent. Defaults to `true`. For more information, refer to [Prefetching a link source](https://shopify.dev/custom-storefronts/hydrogen/routing/manage-routes/#prefetching-a-link-source). */
|
|
12
12
|
prefetch?: boolean;
|
|
13
13
|
/** Whether to emulate natural browser behavior and restore scroll position on navigation. Defaults to `true`. */
|
|
14
14
|
scroll?: boolean;
|
|
@@ -27,7 +27,7 @@ export declare type CookieOptions = {
|
|
|
27
27
|
maxAge?: number;
|
|
28
28
|
};
|
|
29
29
|
/** The `Cookie` component helps you build your own custom cookie and session implementations. All
|
|
30
|
-
* [Hydrogen session storage mechanisms](https://shopify.dev/custom-storefronts/hydrogen/
|
|
30
|
+
* [Hydrogen session storage mechanisms](https://shopify.dev/custom-storefronts/hydrogen/sessions#types-of-session-storage) use the
|
|
31
31
|
* same configuration options as what's available in `Cookie`.
|
|
32
32
|
*/
|
|
33
33
|
export declare class Cookie {
|
|
@@ -3,7 +3,7 @@ import { log } from '../../utilities/log/index.js';
|
|
|
3
3
|
import { parseJSON } from '../../utilities/parse.js';
|
|
4
4
|
const reservedCookieNames = ['mac', 'user_session_id'];
|
|
5
5
|
/** The `Cookie` component helps you build your own custom cookie and session implementations. All
|
|
6
|
-
* [Hydrogen session storage mechanisms](https://shopify.dev/custom-storefronts/hydrogen/
|
|
6
|
+
* [Hydrogen session storage mechanisms](https://shopify.dev/custom-storefronts/hydrogen/sessions#types-of-session-storage) use the
|
|
7
7
|
* same configuration options as what's available in `Cookie`.
|
|
8
8
|
*/
|
|
9
9
|
export class Cookie {
|
|
@@ -30,7 +30,7 @@ export function Form({ action, method, children, onSubmit, encType = 'applicatio
|
|
|
30
30
|
.then((fetchResponse) => {
|
|
31
31
|
const rscPathname = fetchResponse.headers.get('Hydrogen-RSC-Pathname');
|
|
32
32
|
if (!rscPathname)
|
|
33
|
-
throw new Error(`The component's \`action\` attribute must point to an API route that responds with a new Request()\nRead more at https://shopify.dev/custom-storefronts/hydrogen/
|
|
33
|
+
throw new Error(`The component's \`action\` attribute must point to an API route that responds with a new Request()\nRead more at https://shopify.dev/custom-storefronts/hydrogen/forms`);
|
|
34
34
|
if (rscPathname !== window.location.pathname) {
|
|
35
35
|
window.history.pushState(null, '', rscPathname);
|
|
36
36
|
}
|
|
@@ -11,7 +11,7 @@ export declare const SHOPIFY_PROVIDER_CONTEXT_KEY: unique symbol;
|
|
|
11
11
|
export declare function ShopifyProvider({
|
|
12
12
|
/**
|
|
13
13
|
* Shopify connection information. Defaults to
|
|
14
|
-
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/
|
|
14
|
+
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/configuration).
|
|
15
15
|
*/
|
|
16
16
|
shopifyConfig, countryCode, languageCode,
|
|
17
17
|
/** Any `ReactNode` elements. */
|
|
@@ -45,7 +45,7 @@ export const SHOPIFY_PROVIDER_CONTEXT_KEY = Symbol.for('SHOPIFY_PROVIDER_RSC');
|
|
|
45
45
|
export function ShopifyProvider({
|
|
46
46
|
/**
|
|
47
47
|
* Shopify connection information. Defaults to
|
|
48
|
-
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/
|
|
48
|
+
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/configuration).
|
|
49
49
|
*/
|
|
50
50
|
shopifyConfig, countryCode, languageCode,
|
|
51
51
|
/** Any `ReactNode` elements. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CachingStrategy, PreloadOptions, QueryKey } from '../../types.js';
|
|
2
2
|
import type { HydrogenRequest } from '../HydrogenRequest/HydrogenRequest.server.js';
|
|
3
3
|
export interface HydrogenUseQueryOptions {
|
|
4
|
-
/** The [caching strategy](https://shopify.dev/custom-storefronts/hydrogen/
|
|
4
|
+
/** The [caching strategy](https://shopify.dev/custom-storefronts/hydrogen/querying/cache#caching-strategies) to help you
|
|
5
5
|
* determine which cache control header to set.
|
|
6
6
|
*/
|
|
7
7
|
cache?: CachingStrategy;
|
|
8
|
-
/** Whether to [preload the query](https://shopify.dev/custom-storefronts/hydrogen/
|
|
8
|
+
/** Whether to [preload the query](https://shopify.dev/custom-storefronts/hydrogen/querying/preloaded-queries).
|
|
9
9
|
* Defaults to `false`. Specify `true` to preload the query for the URL or `'*'`
|
|
10
10
|
* to preload the query for all requests.
|
|
11
11
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServerPropsContextValue, InternalServerPropsContextValue } from '../ServerPropsProvider/ServerPropsProvider.js';
|
|
2
2
|
/**
|
|
3
|
-
* The `useServerProps` hook allows you to manage the [server props](https://shopify.dev/custom-storefronts/hydrogen/
|
|
3
|
+
* The `useServerProps` hook allows you to manage the [server props](https://shopify.dev/custom-storefronts/hydrogen/server-props) passed to your server components when using Hydrogen as a React Server Component framework. The server props get cleared when you navigate from one route to another.
|
|
4
4
|
*
|
|
5
5
|
* ## Return value
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { ServerPropsContext, } from '../ServerPropsProvider/ServerPropsProvider.js';
|
|
3
3
|
/**
|
|
4
|
-
* The `useServerProps` hook allows you to manage the [server props](https://shopify.dev/custom-storefronts/hydrogen/
|
|
4
|
+
* The `useServerProps` hook allows you to manage the [server props](https://shopify.dev/custom-storefronts/hydrogen/server-props) passed to your server components when using Hydrogen as a React Server Component framework. The server props get cleared when you navigate from one route to another.
|
|
5
5
|
*
|
|
6
6
|
* ## Return value
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `useShop` hook provides access to values within
|
|
3
|
-
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/
|
|
3
|
+
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/configuration).
|
|
4
4
|
* The `useShop` hook must be a descendent of a `ShopifyProvider` component.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useShop(): import("../ShopifyProvider/types.js").ShopifyContextServerValue;
|
|
@@ -2,7 +2,7 @@ import { ShopifyContext } from '../ShopifyProvider/index.js';
|
|
|
2
2
|
import { useEnvContext } from '../ssr-interop.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `useShop` hook provides access to values within
|
|
5
|
-
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/
|
|
5
|
+
* [the `shopify` property in the `hydrogen.config.js` file](https://shopify.dev/custom-storefronts/hydrogen/configuration).
|
|
6
6
|
* The `useShop` hook must be a descendent of a `ShopifyProvider` component.
|
|
7
7
|
*/
|
|
8
8
|
export function useShop() {
|
|
@@ -14,13 +14,13 @@ export declare function useShopQuery<T>({ query, variables, cache, preload, }: {
|
|
|
14
14
|
query?: string;
|
|
15
15
|
/** An object of the variables for the GraphQL query. */
|
|
16
16
|
variables?: Record<string, any>;
|
|
17
|
-
/** The [caching strategy](https://shopify.dev/custom-storefronts/hydrogen/
|
|
17
|
+
/** The [caching strategy](https://shopify.dev/custom-storefronts/hydrogen/querying/cache#caching-strategies) to
|
|
18
18
|
* help you determine which cache control header to set.
|
|
19
19
|
*/
|
|
20
20
|
cache?: CachingStrategy;
|
|
21
21
|
/** A string corresponding to a valid locale identifier like `en-us` used to make the request. */
|
|
22
22
|
locale?: string;
|
|
23
|
-
/** Whether to[preload the query](https://shopify.dev
|
|
23
|
+
/** Whether to[preload the query](https://shopify.dev//custom-storefronts/hydrogen/querying/preloaded-queries).
|
|
24
24
|
* Defaults to `false`. Specify `true` to preload the query for the URL or `'*'`
|
|
25
25
|
* to preload the query for all requests.
|
|
26
26
|
*/
|
|
@@ -100,6 +100,6 @@ export function logQueryTimings(type, request) {
|
|
|
100
100
|
log.debug(yellow('Suspense waterfall detected on query: ' +
|
|
101
101
|
firstSuspenseWaterfallQueryName));
|
|
102
102
|
log.debug(' Add the `showQueryTiming` property to your Hydrogen configuration to see more information:');
|
|
103
|
-
log.debug(' https://shopify.dev/custom-storefronts/hydrogen/
|
|
103
|
+
log.debug(' https://shopify.dev/custom-storefronts/hydrogen/configuration#logger');
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -13,7 +13,7 @@ export function getStorefrontApiRequestHeaders({ buyerIp, publicStorefrontToken,
|
|
|
13
13
|
log.error('No secret Shopify storefront API token was defined. This means your app will be rate limited!\nSee how to add the token: ');
|
|
14
14
|
}
|
|
15
15
|
else if (privateStorefrontToken) {
|
|
16
|
-
log.warn('The private shopify storefront API token was loaded implicitly by an environment variable. This is deprecated, and instead the variable should be defined directly in the Hydrogen Config.\nFor more information: https://shopify.dev/custom-storefronts/hydrogen/
|
|
16
|
+
log.warn('The private shopify storefront API token was loaded implicitly by an environment variable. This is deprecated, and instead the variable should be defined directly in the Hydrogen Config.\nFor more information: https://shopify.dev/custom-storefronts/hydrogen/configuration');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -22,7 +22,7 @@ export function getStorefrontApiRequestHeaders({ buyerIp, publicStorefrontToken,
|
|
|
22
22
|
if (!storefrontIdWarned) {
|
|
23
23
|
storefrontIdWarned = true;
|
|
24
24
|
if (storefrontId) {
|
|
25
|
-
log.warn('The storefrontId was loaded implicitly by an environment variable. This is deprecated, and instead the variable should be defined directly in the Hydrogen Config.\nFor more information: https://shopify.dev/custom-storefronts/hydrogen/
|
|
25
|
+
log.warn('The storefrontId was loaded implicitly by an environment variable. This is deprecated, and instead the variable should be defined directly in the Hydrogen Config.\nFor more information: https://shopify.dev/custom-storefronts/hydrogen/configuration');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
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.3";
|
package/dist/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = '1.6.
|
|
1
|
+
export const LIB_VERSION = '1.6.3';
|