@shopify/hydrogen 2025.4.0 → 2025.4.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.
@@ -416,7 +416,7 @@ function getPrivacyBanner() {
416
416
  }
417
417
 
418
418
  // package.json
419
- var version = "2025.4.0";
419
+ var version = "2025.4.1";
420
420
 
421
421
  // src/analytics-manager/ShopifyAnalytics.tsx
422
422
  function getCustomerPrivacyRequired() {
@@ -1739,7 +1739,7 @@ function generateUUID() {
1739
1739
  }
1740
1740
 
1741
1741
  // src/version.ts
1742
- var LIB_VERSION = "2025.4.0";
1742
+ var LIB_VERSION = "2025.4.1";
1743
1743
 
1744
1744
  // src/utils/graphql.ts
1745
1745
  function minifyQuery(string) {
@@ -2868,7 +2868,8 @@ function createCartHandler(options) {
2868
2868
  storefront,
2869
2869
  customerAccount,
2870
2870
  cartQueryFragment,
2871
- cartMutateFragment
2871
+ cartMutateFragment,
2872
+ buyerIdentity
2872
2873
  } = options;
2873
2874
  let cartId = _getCartId();
2874
2875
  const getCartId = () => cartId || _getCartId();
@@ -2880,6 +2881,10 @@ function createCartHandler(options) {
2880
2881
  };
2881
2882
  const _cartCreate = cartCreateDefault(mutateOptions);
2882
2883
  const cartCreate = async function(...args) {
2884
+ args[0].buyerIdentity = {
2885
+ ...buyerIdentity,
2886
+ ...args[0].buyerIdentity
2887
+ };
2883
2888
  const result = await _cartCreate(...args);
2884
2889
  cartId = result?.cart?.id;
2885
2890
  return result;
@@ -2903,7 +2908,7 @@ function createCartHandler(options) {
2903
2908
  sellingPlanId: line.sellingPlanId
2904
2909
  };
2905
2910
  });
2906
- return cartId || optionalParams?.cartId ? await cartLinesAddDefault(mutateOptions)(lines, optionalParams) : await cartCreate({ lines }, optionalParams);
2911
+ return cartId || optionalParams?.cartId ? await cartLinesAddDefault(mutateOptions)(lines, optionalParams) : await cartCreate({ lines, buyerIdentity }, optionalParams);
2907
2912
  },
2908
2913
  updateLines: cartLinesUpdateDefault(mutateOptions),
2909
2914
  removeLines: cartLinesRemoveDefault(mutateOptions),
@@ -2919,11 +2924,11 @@ function createCartHandler(options) {
2919
2924
  optionalParams
2920
2925
  ) : await cartCreate({ giftCardCodes }, optionalParams);
2921
2926
  },
2922
- updateBuyerIdentity: async (buyerIdentity, optionalParams) => {
2927
+ updateBuyerIdentity: async (buyerIdentity2, optionalParams) => {
2923
2928
  return cartId || optionalParams?.cartId ? await cartBuyerIdentityUpdateDefault(mutateOptions)(
2924
- buyerIdentity,
2929
+ buyerIdentity2,
2925
2930
  optionalParams
2926
- ) : await cartCreate({ buyerIdentity }, optionalParams);
2931
+ ) : await cartCreate({ buyerIdentity: buyerIdentity2 }, optionalParams);
2927
2932
  },
2928
2933
  updateNote: async (note, optionalParams) => {
2929
2934
  return cartId || optionalParams?.cartId ? await cartNoteUpdateDefault(mutateOptions)(note, optionalParams) : await cartCreate({ note }, optionalParams);
@@ -3818,7 +3823,8 @@ function createHydrogenContext(options) {
3818
3823
  logErrors,
3819
3824
  storefront: storefrontOptions = {},
3820
3825
  customerAccount: customerAccountOptions,
3821
- cart: cartOptions = {}
3826
+ cart: cartOptions = {},
3827
+ buyerIdentity
3822
3828
  } = options;
3823
3829
  if (!session) {
3824
3830
  console.warn(
@@ -3868,6 +3874,7 @@ function createHydrogenContext(options) {
3868
3874
  cartQueryFragment: cartOptions.queryFragment,
3869
3875
  cartMutateFragment: cartOptions.mutateFragment,
3870
3876
  customMethods: cartOptions.customMethods,
3877
+ buyerIdentity,
3871
3878
  // defaults
3872
3879
  storefront,
3873
3880
  customerAccount