Coder Social home page Coder Social logo

shopify / hydrogen Goto Github PK

View Code? Open in Web Editor NEW
1.2K 156.0 229.0 41.25 MB

Hydrogen lets you build faster headless storefronts in less time, on Shopify.

Home Page: https://hydrogen.shop

License: MIT License

TypeScript 91.97% JavaScript 3.65% CSS 1.18% Shell 0.11% HTML 3.10%
hydrogen react remix shopify

hydrogen's Introduction

Hydrogen Logo

MIT License npm downloads

📚 Docs | 🗣 Discord | 💬 Discussions | 📝 Changelog

Hydrogen is Shopify’s stack for headless commerce. It provides a set of tools, utilities, and best-in-class examples for building dynamic and performant commerce applications. Hydrogen is designed to dovetail with Remix, Shopify’s full stack web framework, but it also provides a React library portable to other supporting frameworks.

Hydrogen Legacy v1

Hydrogen legacy v1 has been moved to a separate repo and the docs can be found here.

Getting started with Hydrogen

Requirements:

  • Node.js version 16.14.0 or higher
  • npm (or your package manager of choice, such as yarn or pnpm)
  1. Install the latest version of Hydrogen:

    npm create @shopify/hydrogen@latest
  2. Run the local development server:

    npm install
    npm run dev
  3. Open your new Hydrogen app running at http://localhost:3000.

See the complete Hydrogen docs.

Packages in this repo

Hydrogen is organized as a monorepo, which includes multiple packages that can be used together.

Package Latest version Description Readme
@shopify/hydrogen Latest badge Opinionated tools, utilities, and best-in-class examples for building a commerce application with Remix. Readme
@shopify/hydrogen-react Latest badge Unopionated and performant library of Shopify-specific commerce components, hooks, and utilities. Readme
@shopify/cli-hydrogen Latest badge Hydrogen extension for Shopify CLI. Readme
@shopify/create-hydrogen Latest badge Generate a new Hydrogen project from the command line. Readme
@shopify/hydrogen-codegen Latest badge Generate types for Storefront API queries automatically. Readme
@shopify/remix-oxygen Latest badge Remix adapter enabling Hydrogen to run on the Oxygen runtime. Readme
@shopify/mini-oxygen Latest badge A local runtime for Hydrogen apps that simulates the Oxygen production environment. Readme

Versioning

Hydrogen and hydrogen-react are tied to specific versions of the Shopify Storefront API, which follows calver.

For example, if you're using Storefront API version 2023-01, then Hydrogen and hydrogen-react versions 2022.1.x are fully compatible.

If the Storefront API version update includes breaking changes, then Hydrogen and hydrogen-react may also include breaking changes. Because the API version is updated every three months, breaking changes could occur every three months.

Learn more about API release schedules at Shopify.

Contributing to Hydrogen

Read our contributing guide

Other handy links

Learn more about Hydrogen.

hydrogen's People

Contributors

aswamy avatar benjaminsehl avatar benwolfram avatar blittle avatar bradmurchison avatar cartogram avatar davecyen avatar dependabot[bot] avatar frandiox avatar frehner avatar gfscott avatar github-actions[bot] avatar graygilmore avatar isaacroldan avatar jacob-ebey avatar jplhomer avatar juanpprieto avatar lordofthecactus avatar mcvinci avatar michenly avatar pepicrft avatar quintonc avatar rafaelstz avatar remcolakens avatar ryanflorence avatar scottdixon avatar shopify-github-actions-access[bot] avatar vincentezw avatar wizardlyhel avatar zwyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydrogen's Issues

Mobile & Desktop navs as dynamic component???

Allbirds didn't just want CSS to hide their navigations … can a dynamic component work? Is there a reason we shouldn't do that? If so — let's explain the perf or accessibility reasons.

Styling

What CSS / Styling strategies can we support? To what quality level? What tradeoffs might come as a result of supporting strategies that Remix doesn't support today?

Must have:

#30 (comment)

Should have:

#30 (comment)

[BUG] Duplicated HTML `id` due to Hydrogen `<Image />`

Describe the bug

In our designs on Product Details Page, we have a series of image thumbnails with one image that's "selected" and displayed large. We are using the Hydrogen <Image /> component which has the default behavior of setting the HTML id to the underlying id of the image. The result is that we have two <img>s on the page with the same id.

To Reproduce

  1. Render a Hydrogen page with two <Image /> components, each that renders the same image
  2. Inspect the rendered DOM
  3. Notice that there are two <img>s that share the same id

Expected behaviour

I would not expect the Hydrogen <Image /> to set an id. If it did, I'd expect the underlying behavior to guarantee uniqueness via useId or the like.

Screenshots

image

image

Additional context
Add any other context about the problem here. eg.

Hydrogen 1.2.0

Script component

Whether or not we leverage it, the impact Partytown can provide (or Zaraz or whatever) for improving the performance impact of third party pixels is a huge point for performance of 2.0

Allow empty alt text on the Image component

Describe the bug
The Image component currently throws warnings when there is no alt text. Sometimes, for presentational images, there should not be alt text. Should an explicit empty string passed as a prop avoid the warning? cc @WillsonSmith

Ability to purchase with Apple|Google|PayPal

Description

We need to add the ability to purchase product(s) with Apple Pay.
In Shopify storefronts with Liquid, there are two use cases for the Apple Pay button:

  • On the product page
    • When clicked, it opens the Apple Pay flow for purchasing just the product from the product page
  • On the cart page
    • When clicked, it open the Apple Pay flow for purchasing the entire cart

Requirements

  • The button should only be visible when the merchant has Apple Pay enabled and the buyer is using a supported device for Apple Pay
  • When clicked, the Apple Pay checkout flow should be initiated
    • On the product page: for purchasing just that product
    • On the cart page: for purchasing the entire cart
  • The button should be rendered by the DynamicCheckoutButton component when appropriate

Notes

  • The DynamicCheckoutButton component has a really rough first pass on displaying the ApplePay button (see code here. We'll likely want to extract this code into its own component ApplePayButton and iterate on it from there.

Guide: Connecting Multiple Admins

Similar to Connecting Multiple Domains — but in the context of multiple Shopify stores to a single framework, and a single repo.

[BUG] Cart doesn't use default Hydrogen localisation

Describe the bug
The CartProvider localisation defaults to US instead of using the project default from Hydrogen config. Only when on the default site, i.e. not /nz, etc.

To Reproduce

  1. Start demo store
  2. Change defaultCountryCode in Hydrogen config to anything but US
  3. See that this isn't reflected in the cart prices

Expected behaviour
Cart country (currency) should be same as that defined in hydrogen.config.ts.

  • Hydrogen version (1.3.1)
  • Node version (16.15.1)

[BUG] Product card badge not displaying

Describe the bug


In the current demo store the product badges are not being displayed on the product cards globally. The badge does display of a split second until the product image is loaded.

To Reproduce


  1. Open the demo store
  2. See a sale product card
  3. See the badge display (adjust throttle if needed)

Image

Image

Expected behavior

Badge should display over the product image

Image

SEO

Ask @wizardlyhel for information on SEO requirements and ideal SEO performance behaviour

404 Page

Should this at all be a magic route? Should there be additional helpers for 404s?

#19 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.