TechBuzzPro

Why Shopify Built Hydrogen on Remix

· 6 min read · Apps & Browsers

In this article
  1. Background: The Shift to Headless Commerce
  2. Why Remix? Core Technical Reasons
  3. How Hydrogen Uses Remix
  4. Comparison: Hydrogen vs. Other Headless Options
  5. Common Problems and Misconceptions
  6. Cost and Hosting Considerations
  7. Future of Hydrogen and Remix
  8. Frequently Asked Questions

Shopify built its Hydrogen framework on Remix because Remix provides a server-first, standards-based architecture that aligns with Shopify’s goal of delivering fast, SEO-friendly storefronts while keeping a familiar React developer experience. By leveraging Remix’s nested routing, loaders, and progressive enhancement, Hydrogen can offer a modern headless commerce solution without reinventing core web infrastructure. This article explains the technical and strategic reasons behind that choice, how Hydrogen and Remix work together, and what it means for developers building on Shopify.

Background: The Shift to Headless Commerce

Shopify’s traditional themes are monolithic—they handle both the storefront and the admin in a single system. But as brands demand more customization and performance, headless commerce has grown: the frontend is decoupled from the backend, allowing developers to use any technology to build the storefront while Shopify handles products, carts, and checkout via APIs. Hydrogen is Shopify’s React-based framework for building these custom storefronts. When Shopify first launched Hydrogen in 2021, it was built on its own custom server-rendering solution. However, maintaining a custom framework is costly and fragmented. In 2022, Shopify announced that Hydrogen would be rebuilt on Remix, an open-source full-stack web framework that had already gained traction for its simplicity and adherence to web standards.

Why Remix? Core Technical Reasons

Remix was created by Michael Jackson and Ryan Florence, the same team behind React Router. It emphasizes using standard web APIs (like fetch and Request/Response) and treats the browser as the platform rather than abstracting it away. For Shopify, this meant several key benefits:

  • Server-first rendering: Remix renders on the server by default, which is critical for SEO and initial page load speed—both non-negotiable for ecommerce.
  • Nested routes: Remix uses a file-based routing system where each route can have its own loader (data fetching) and component. This allows Hydrogen to co-locate data requirements with UI components, reducing over-fetching and simplifying code organization.
  • Progressive enhancement: Remix apps work even before JavaScript loads (for basic navigation and forms), which improves resilience and accessibility.
  • Built-in error handling: Remix provides boundaries for errors and not-found states, making it easier to build robust storefronts.
  • Active community: Remix had a growing ecosystem and was already used by many developers, so Shopify could leverage existing knowledge rather than teaching a proprietary framework.

How Hydrogen Uses Remix

Hydrogen is essentially a set of Shopify-specific components and utilities that plug into Remix. When you create a new Hydrogen app, you get a Remix project with extra features:

  • Storefront API integration: Hydrogen provides a createStorefrontClient that handles authentication and queries to Shopify’s GraphQL Storefront API.
  • Cart and checkout components: Ready-made components like CartProvider and CartLineProvider manage cart state and integrate with Shopify’s checkout.
  • Hydrogen-specific utilities: Helpers for money formatting, product options, and SEO meta tags.
  • Oxygen deployment: Hydrogen apps are designed to run on Oxygen, Shopify’s global hosting platform, which supports Remix’s server runtime out of the box.

In practice, a developer writes a route like /products/$handle and uses a loader to fetch product data from the Storefront API. Remix handles the server rendering and hydration, while Hydrogen provides the Shopify-specific glue.

Comparison: Hydrogen vs. Other Headless Options

Developers often compare Hydrogen to other headless commerce solutions like Next.js with Shopify’s custom storefront API, or third-party frameworks like Gatsby. Here’s how Hydrogen/Remix stacks up:

  • Hydrogen vs. Next.js: Next.js is more popular and has a larger ecosystem, but it’s not Shopify-specific. Hydrogen gives you pre-built ecommerce components and better integration with Shopify’s data model. However, Next.js offers more flexibility if you plan to use multiple backends or have a team already familiar with it.
  • Hydrogen vs. Gatsby: Gatsby is static-first, which can be great for content-heavy sites but less ideal for dynamic storefronts with frequent inventory changes. Remix’s server rendering is more suitable for real-time data.
  • Hydrogen vs. custom React: Building a storefront from scratch with React and the Storefront API is possible but requires you to solve routing, data fetching, and SSR yourself. Hydrogen/Remix provides a structured, tested foundation.

Ultimately, the choice depends on your team’s skills and whether you want a Shopify-tight integration or a more generic framework.

Common Problems and Misconceptions

One common misconception is that Hydrogen is a “plugin” for Remix—it’s actually a framework that uses Remix under the hood. Another is that Hydrogen is only for large enterprises; while it offers advanced features, it’s also suitable for smaller stores that want a custom frontend without building everything from scratch.

Developers often run into issues with:

  • Version mismatches: Hydrogen updates frequently, and Remix has its own release cycle. Keeping both in sync can be tricky, but Shopify provides a CLI to scaffold and update projects.
  • Learning curve: If you’re new to Remix, concepts like loaders and actions take time to master. But the official docs and examples help.
  • Data fetching complexity: The Storefront API is GraphQL, so you need to write queries and handle caching. Hydrogen provides utilities, but you still need to understand GraphQL.

Another misconception is that Hydrogen is “just” a marketing site builder—it’s actually a full ecommerce framework, capable of handling complex product catalogs, cart logic, and checkout integration.

Cost and Hosting Considerations

Hydrogen itself is open-source and free to use. The main cost is hosting: Shopify recommends Oxygen, which is included in Shopify’s Plus plans or available as an add-on. Alternatively, you can deploy a Hydrogen app to any Node.js-compatible hosting provider (like Vercel or Cloudflare Workers), but you’ll need to configure the environment yourself. This flexibility is a plus for teams that already have infrastructure, but it also means you’re responsible for scaling and maintenance.

If you’re on a basic Shopify plan, you might not have access to Oxygen, so you’d need to factor in third-party hosting costs. For most small-to-medium stores, the added complexity of headless may not be worth it unless you have specific performance or customization needs.

Future of Hydrogen and Remix

In 2023, Shopify announced that Hydrogen would be the foundation for all new storefronts, and they’ve continued to invest in it. Remix itself was acquired by Shopify in 2022, which solidified the partnership. This means Remix’s development is now directly aligned with Shopify’s needs, and we can expect tighter integration over time. For developers, this is a signal that learning Remix is a good long-term investment, especially if you work in the Shopify ecosystem.

However, it’s worth noting that Hydrogen is still evolving. Some features that exist in traditional Shopify themes (like the theme editor) don’t have direct equivalents in Hydrogen, so merchants may need to rely more on developers for changes. This is a trade-off between flexibility and ease of use.

Frequently Asked Questions

Is Hydrogen a replacement for Shopify themes?

No, Hydrogen is an alternative. Traditional themes are still supported and are easier for non-developers to customize. Hydrogen is for teams that want a fully custom frontend and are comfortable with coding.

Do I need to know Remix to use Hydrogen?

Yes, a basic understanding of Remix is essential. Hydrogen builds on Remix’s concepts, so you’ll need to know how routes, loaders, and actions work. Shopify’s Hydrogen docs assume some Remix knowledge.

Can I use Hydrogen with other backends?

Hydrogen is designed specifically for Shopify, so it’s tightly coupled to Shopify’s Storefront API. If you want to use multiple backends, you’d be better off with a generic framework like Next.js or Remix alone.

Is Hydrogen production-ready?

Yes, Shopify uses Hydrogen for its own demo storefronts and many live stores. However, it’s a relatively new framework, so you may encounter edge cases. The community and Shopify’s support are active.

What are the performance benefits of Hydrogen?

Because Hydrogen uses server-side rendering (via Remix), pages load faster and are more SEO-friendly. It also supports streaming and partial hydration, which can reduce JavaScript on the client. That said, performance depends on how you write your code and handle data.