<Back to Updates

September 2024 release: Improved sitemaps, search enhancements, cart gift card support, consent localization, content security policy fixes

September 12, 2024

Welcome to Hydrogen's September 2024 release.

This month's highlights include improved sitemaps, a new search template for easier implementation of search and predictive search, cart gift card support, content security policy improvements and consent localization.

We've also addressed several important fixes and received valuable community contributions. Let's dive in.

Sitemaps (Unstable)

We're excited to introduce an unstable release of improved sitemaps functionality. This leverages recent enhancements to the Storefront API to offer a more robust and scalable solution for generating sitemaps. It addresses previous limitations, particularly for stores with large product catalogs, ensuring more comprehensive coverage of your store's structure.

This update marks a significant step forward in how Hydrogen handles sitemaps, improving store discoverability by search engines. As with all unstable features, we recommend using it cautiously and welcome your feedback as we continue to refine this functionality. Check out the example.

Code Example


// app/routes/[sitemap.xml].tsx
import {unstable__getSitemapIndex as getSitemapIndex} from '@shopify/hydrogen';

export async function loader({request, context: {storefront}}) {
  return await getSitemapIndex({storefront, request});
}

Search Enhancement

We've added two new search implementations to the starter template for search and predictive search functionality. This addition includes comprehensive guides to help you set up and customize the search experience for your customers. Check out the new guides.

Cart Gift Card Support

Thanks to a recent update to the Storefront API, customers can now apply gift cards directly to their carts, giving them more payment options during checkout. We've added this feature to Hydrogen’s cart handler and included it in the starter template. To add this feature to an existing storefront, check out the docs.

Consent Localization

To better serve global audiences, we've implemented consent localization. This feature allows your app to present consent requests in multiple languages, improving user understanding and compliance across different regions.

Consent localization on the Skeleton template

Improved Content Security Policy Implementation

We've addressed an issue related to Content Security Policy (CSP) configuration. Previously, when defining CSP config in an external file, there was a potential for header sizes to grow excessively large. This could lead to 413 responses (Request Entity Too Large), effectively blocking access to the site for affected users.

CSP headers now remain within acceptable size limits, regardless of where the configuration is defined. This fix enhances the overall stability and reliability of Hydrogen applications, particularly for more complex setups with extensive CSP rules.

Updates, optimizations, and fixes

  • Resolved an issue causing infinite redirects with // (#2449)
  • Improved useOptimisticCart to optimistically calculate totals (#2459)
  • Fixed functionality of links on mobile devices (#2450)
  • Utilities privacyBanner and customerPrivacy have been added to useAnalytics and useCustomerPrivacy (#2457)

We're grateful for our community's ongoing support - a special shout-out to @andershagbard for their performance enhancement to the <Image/> component! (#2469)

To take advantage of all the latest features and improvements in Hydrogen, just run npx shopify hydrogen upgrade. That’s it for the September release — see you in October!

Get building

Spin up a new Hydrogen app in minutes.

See documentation