-
#922
b5eaddc1
Thanks @frehner! - Fragments and their related types have been removed:- ExternalVideoFragment and ExternalVideoFragmentFragment
- Model3DFragment and Model3DFragmentFragment
- ImageFragment and ImageFragmentFragment
- MoneyFragment and MoneyFragmentFragment
- UnitPriceFragment and UnitPriceFragmentFragment
- VideoFragment and VideoFragmentFragment
- MetafieldFragment and MetafieldFragmentFragment
- Seo fragments and types:
- DefaultPageSeoFragment and DefaultPageSeoFragmentFragment
- HomeSeoFragment and HomeSeoFragmentFragment
- ProductSeoFragment and ProductSeoFragmentFragment
- CollectionSeoFragment and CollectionSeoFragmentFragment
- PageSeoFragment and PageSeoFragmentFragment
- MediaFile fragments and types:
- MediaFileFragment and MediaFileFragmentFragment
- MediaFileFragment_ExternalVideo_Fragment
- MediaFileFragment_MediaImage_Fragment
- MediaFileFragment_Model3d_Fragment
- MediaFileFragment_Video_Fragment
- ProductFragment and ProductFragmentFragment
These fragments have been removed to reduce the chances of over-fetching (in other words, querying for fields you don't use) in your GraphQL queries. Please refer to the Storefront API documentation for information and guides.
-
#912
de0e0d6a
Thanks @blittle! - Change the country selector to lazy load available countries. The motivation to do so is that a lot of countries come with the Demo Store template. The problem is 1) the graphql query to fetch them all is relatively slow and 2) all of them get serialized to the browser in each RSC response.This change removes
availableCountries
from theLocalizationProvider
. As a result, theuseAvailableCountries
hook is also gone. Instead, the available countries are loaded on demand from an API route.Migratation steps:
Create an API route to retrieve available countries:
export async function api(request, {queryShop}) { const { data: { localization: {availableCountries}, }, } = await queryShop({ query: QUERY, }); return availableCountries.sort((a, b) => a.name.localeCompare(b.name)); } const QUERY = ` query Localization { localization { availableCountries { isoCode name currency { isoCode } } } } `;
Then within your client code, query the API route with a
useEffect
hook:const [countries, setCountries] = useState([]); useEffect(() => { fetch('/api/countries') .then((resp) => resp.json()) .then((c) => setCountries(c)) .catch((e) => setError(e)) .finally(() => setLoading(false)); }, []);
See an example on how this could be done inside the Demo Store template country selector
-
#698
6f30b9a1
Thanks @jplhomer! - Basic end-to-end tests have been added to the default Hydrogen template. You can run tests in development:yarn test
Or in continuous-integration (CI) environments:
yarn test:ci
-
#932
507c5cbf
Thanks @jplhomer! - Adds CSS Modules support. Hydrogen now includes a Vite plugin that collects styles for each CSS Module and exports them to aStyleTag
component. To use CSS Modules in your Hydrogen app, you must render the style tag in the component along with your styles:import * as styles from './styles.module.css'; export default MyComponent() { return ( <div className={styles.wrapper}> // A style is rendered inline <styles.StyleTag /> <p>Hello</p> </div> ); }
Explore an example implementation of CSS Modules in GitHub.
-
#846
58c823b5
Thanks @blittle! - ## New<Route>
ComponentThe
<Route>
component is available for routes not defined by the file system. The<Route>
component must be used within the<Router>
component.// app.server.jsx function App({routes, ...serverProps}) { return ( <Suspense fallback={<LoadingFallback />}> <ShopifyProvider shopifyConfig={shopifyConfig}> <CartProvider> <DefaultSeo /> <Router serverProps={serverProps}> <Route path="/custom" page={<CustomRoute />} /> </Router> </CartProvider> </ShopifyProvider> </Suspense> ); } function CustomRoute() { return <h1>Custom route</h1>; }
<Route>
accepts two props:Property Type Required Description path
string
Yes The URL path where the route exists. The path can contain variables. For example, /products/:handle
.page
A rendered Server Component reference
Yes A reference to a React Server Component that's rendered when the route is active. You can have multiple
<Route>
and<FileRoutes>
components in your app. Hydrogen will only render one route for each request — whichever it finds first. This means the<Router>
component no longer takesfallback
as a prop. It also doesn't needserverProps
. Instead, to render a 404 "Not Found" page, add<Route path="*" page={<NotFound />} />
to your app. Make sure it's the last<Route>
defined inside your app:function App({routes, ...serverProps}) { return ( <ShopifyProvider shopifyConfig={shopifyConfig}> <CartProvider> <DefaultSeo /> - <Router - fallback={<NotFound response={serverProps.response} />} - serverProps={serverProps} - > + <Router> <FileRoutes routes={routes} /> + <Route path="*" page={<NotFound />} /> </Router> </CartProvider> </ShopifyProvider> ); }
The
<FileRoutes>
component now accepts two additional optional props:Property Type Required Default Value Description basePath
string
No "/"
A path that's prepended to all file routes. dirPrefix
string
No "./routes"
The portion of the file route path that shouldn't be a part of the URL. You need to modify
dirPrefix
if you want to import routes from a location other thansrc/routes
.You can modify
basePath
if you want to prefix all file routes. For example, you can prefix all file routes with a locale:<Router> <FileRoutes basePath={`/${locale}`} routes={routes} /> <Route path="*" page={<NotFound />} /> </Router>
You can use the
useRouteParams()
hook to retrieve the parameters of an active route. The hook is available in both server and client components:// products/[handle].server.jsx import {useRouteParams} from '@shopify/hydrogen'; export default function Product() { const {handle} = useRouteParams(); // ... }
// ProductDetails.client.jsx import {useRouteParams} from '@shopify/hydrogen/client'; export default function ProductDetails() { const {handle} = useRouteParams(); // ... }
-
#842
626e58ee
Thanks @wizardlyhel! - Removed theRawhtml
component.Upgrade your project by replacing references to the
RawHtml
component to follow React'sdangerouslySetInnerHTML
:Change all
RawHtml
component<RawHtml string="<p>Hello world</p>" />
to jsx equivalent
<div dangerouslySetInnerHTML={{__html: '<p>Hello world</p>'}} />
- #870
4c0fcd8f
Thanks @frandiox! - Remove useQuery hook from client exports to avoid leaking server logic to the browser.
-
#965
cdad13ed
Thanks @blittle! - Fix server redirects to work properly with RSC responses. For example, the redirect component within the Demo Store template needs to change:export default function Redirect({response}) { - response.redirect('/products/snowboard'); - return <div>This page is redirected</div>; + return response.redirect('/products/snowboard'); }
This server component is rendered two ways:
- When an app directly loads the redirect route, the server will render a 300 redirect with the proper location header.
- The app is already loaded, but the user navigates to the redirected route. We cannot 300 respond in this scenario, instead
response.redirect(...)
returns a component which will redirect on the client.
- #904
1b46f8d0
Thanks @wizardlyhel! - Log query key when provided in string
-
#758
0bee3af0
Thanks @frandiox! - Upgrade to React experimental version0.0.0-experimental-2bf7c02f0-20220314
.To upgrade your Hydrogen app, change the pinned version of
react
andreact-dom
in yourpackage.json
file to this version, or run:yarn add @shopify/hydrogen [email protected] [email protected]
- #895
1017b541
Thanks @frandiox! - Improve error thrown in development when entry point fails on load.
- #871
4cb07c73
Thanks @scottdixon! - Hydrogen docs: Update ProductProvider example query
-
#878
587aa3e6
Thanks @frandiox! - Fix preloading queries in workers to prevent waterfall requests.Breaking change:
fetchBuilder
no longer accepts aRequest
argument. Instead, it now accepts aurl: string
andoptions: FetchInit
:-fetchBuilder(new Request('https://my.endpoint.com', {headers: {foo: 'bar'}})); +fetchBuilder('https://my.endpoint.com', {headers: {foo: 'bar}});
- #923
993be985
Thanks @frandiox! - Provide a Logger option to use GraphQL and disable by default. Improve logging of unused query properties.
8271be8
Thanks @michenly! - Export Seo components Fragement and use them in the Demo Store template.
-
#827
745e8c0
Thanks @michenly! - Move any staticFragment
properties on components to the entry point@shopify/hydrogen/fragments
. The migration diff are as follows:- import {ExternalVideoFragment} from '@shopify/hydrogen'; + import {ExternalVideoFragment} from '@shopify/hydrogen/fragments'; - import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen'; + import type {ExternalVideoFragmentFragment} from '@shopify/hydrogen/fragments';
- import {ImageFragment} from '@shopify/hydrogen'; + import {ImageFragment} from '@shopify/hydrogen/fragments'; - import type {ImageFragmentFragment} from '@shopify/hydrogen'; + import type {ImageFragmentFragment} from '@shopify/hydrogen/fragments';
- import {MediaFileFragment} from '@shopify/hydrogen'; + import {MediaFileFragment} from '@shopify/hydrogen/fragments'; - import type {MediaFileFragmentFragment} from '@shopify/hydrogen'; + import type {MediaFileFragmentFragment} from '@shopify/hydrogen/fragments';
- import {MetafieldFragment} from '@shopify/hydrogen'; + import {MetafieldFragment} from '@shopify/hydrogen/fragments'; - import type {MetafieldFragmentFragment} from '@shopify/hydrogen'; + import type {MetafieldFragmentFragment} from '@shopify/hydrogen/fragments';
- import {Model3DFragment} from '@shopify/hydrogen'; + import {Model3DFragment} from '@shopify/hydrogen/fragments'; - import type {Model3DFragmentFragment} from '@shopify/hydrogen'; + import type {Model3DFragmentFragment} from '@shopify/hydrogen/fragments';
- import {MoneyFragment} from '@shopify/hydrogen'; + import {MoneyFragment} from '@shopify/hydrogen/fragments'; - import type {MoneyFragmentFragment} from '@shopify/hydrogen'; + import type {MoneyFragmentFragment} from '@shopify/hydrogen/fragments';
- import {ProductProviderFragment} from '@shopify/hydrogen'; + import {ProductProviderFragment} from '@shopify/hydrogen/fragments'; - import type {ProductProviderFragmentFragment} from '@shopify/hydrogen'; + import type {ProductProviderFragmentFragment} from '@shopify/hydrogen/fragments';
- import {UnitPriceFragment} from '@shopify/hydrogen'; + import {UnitPriceFragment} from '@shopify/hydrogen/fragments'; - import type {UnitPriceFragmentFragment} from '@shopify/hydrogen'; + import type {UnitPriceFragmentFragment} from '@shopify/hydrogen/fragments';
- import {VideoFragment} from '@shopify/hydrogen'; + import {VideoFragment} from '@shopify/hydrogen/fragments'; - import type {VideoFragmentFragment} from '@shopify/hydrogen'; + import type {VideoFragmentFragment} from '@shopify/hydrogen/fragments';
- #455
81ac653
Thanks @johncraigcole! - Updated the ExternalVideo component to use the newembedUrl
Storefront API (introduced in 2022-04) on ExternalVideo.
-
#809
47f23f9
Thanks @frehner! - Upgrade default Storefront API to version '2022-04'. Some components have been updated to use the 2022-04 features and types as well.One important change is that the
2022-04
Storefront API no longer encodes object IDs: see more details here. Because of this, Hydrogen will no longer decode IDs, either, which will cause issues if you are using a previous version of the Storefront API with Hydrogen components.
-
#780
122a5c5
Thanks @jplhomer! - AddsqueryShop
helper to API routes. This makes it easy to query the Storefront API, similar to howuseShopQuery
is available in server components:// my-api.server.js export default function api(request, {queryShop}) { return await queryShop({ query: `query ShopName { shop { name } }`, }); }
queryShop
accepts a single argument object with the following properties:Property Type Required query
string | ASTNode
Yes variables
Record<string, any>
No locale
string
(defaults todefaultLocale
)No Important: In order to use
queryShop
, you should passshopifyConfig
torenderHydrogen
insideApp.server.jsx
:-export default renderHydrogen(App, {routes}); +export default renderHydrogen(App, {shopifyConfig, routes});
-
#712
6368968
Thanks @blittle! - Routing in Hydrogen has been updated according to Custom Routes proposal. Specifically, a newRouter
component has been added, andDefaultRoutes
has been renamed toFileRoutes
, along with other minor changes. Custom route components are not implemented yet.Follow these steps to upgrade your
App.server.jsx
file:- Rename the parameter
pages
toroutes
when callingrenderHydrogen
. - Rename the
DefaultRoutes
component toFileRoutes
. - Add the new
Router
component as a parent ofFileRoutes
and passfallback
andserverProps
props (previously inDefaultRoutes
). - Rename
src/pages
directory tosrc/routes
and update the glob import inApp.server.jsx
toimport.meta.globEager('./routes/**/*.server.[jt](s|sx)')
.
import renderHydrogen from '@shopify/hydrogen/entry-server'; import {Router, FileRoutes, ShopifyProvider} from '@shopify/hydrogen'; import {Suspense} from 'react'; import shopifyConfig from '../shopify.config'; import DefaultSeo from './components/DefaultSeo.server'; import NotFound from './components/NotFound.server'; import LoadingFallback from './components/LoadingFallback'; import CartProvider from './components/CartProvider.client'; function App({routes, ...serverProps}) { return ( <Suspense fallback={<LoadingFallback />}> <ShopifyProvider shopifyConfig={shopifyConfig}> <CartProvider> <DefaultSeo /> <Router fallback={<NotFound />} serverProps={serverProps}> <FileRoutes routes={routes} /> </Router> </CartProvider> </ShopifyProvider> </Suspense> ); } const routes = import.meta.globEager('./routes/**/*.server.[jt](s|sx)'); export default renderHydrogen(App, {shopifyConfig, routes});
- Rename the parameter
- #850
74b14e4
Thanks @blittle! - Ignore when boomerang doesn't load. This often happens when a adblocker is present on the client. There is no longer an uncaught promise exception in the console.
- #803
7528bf4
Thanks @frandiox! - Avoid accessing undefined global __flight as a side effect of another unknown error.
-
#825
1215fdb
Thanks @michenly! -@shopify/hydrogen
will no longer export the following types- MediaFileProps
- VideoProps
- ImageProps
- ExternalVideoProps
- RawHtmlProps
- AddToCartButtonProps
- ModelViewerProps
- MoneyProps
- BuyNowButtonProps
- BuyNowButtonPropsWeControl
- ShopPayButtonProps
Any Component props type should be typed instead with
React.ComponentProps<typeof MyComponent>
.
- #792
8aad0b5
Thanks @frandiox! - Attributes from<html>
and<body>
elements inindex.html
are now included in the SSR response.
- #786
d1ecaf7
Thanks @frehner! - Updated graphql-codegen, which updates the Typescript types available for each Storefront API object
- #849
e64fa17
Thanks @blittle! - Fix server the server to only log once for the full time it takes to stream render a page
- #813
b1b959c
Thanks @frandiox! - Remove Router client-only logic from server bundle and avoid extra waterfall requests during Hydration. Extract part of the client bundle into separate modules that can be loaded in parallel.
- #761
1142647
Thanks @frehner! - Fix issue with components that take in theas
prop not validating other props when a component is passed toas
.
- #774
052f148
Thanks @frandiox! - Fix internal url usage in platforms like Vercel, which already provides protocol and host inrequest.url
.
- #775
d5b7ee1
Thanks @cartogram! - In cases where theinitialVariantId
is missing on the<ProductProvider />
, theselectedVariantId
in the returnedobject
fromuseProduct()
will now use the first available variant or the first variant (if non are available).
- #773
b6a053e
Thanks @frandiox! - Fix server bundle name in cases where CSS or images are imported in server components.
- #764
5e55da4
Thanks @wizardlyhel! - Preload queries breaking fetch on Cloudfare #764
-
#763
ea2857a
Thanks @frehner! - Client-side apps now have React'sStrictMode
component wrapping the whole app, with an option to disable it. If you do turn it off, it is recommended that you still include theStrictMode
component at as high of a level as possible in your React tree.See also React 17's docs on
StrictMode
, and React 18's updates toStrictMode
.
0.11.0 - 2022-02-24
- New React hook
useScriptLoader
is available to more easily load external scripts - Add
totalQuantity
to the returned object fromuseCart()
- Export
ProductPrice
andProductMetafield
standalone components - Added
useUrl
hook that allows the consumer to get the current url in server or client component - Added logging option
showCacheApiStatus
andcacheControlHeader
by @wizardlyhel in #472 - Pass HYDROGEN_ASSET_BASE_URL into config to set base URL for compiled assets
- Introduce Hydrogen the
<Link>
component anduseNavigate
hook for routing - Add a default virtual entry-client in
/@shopify/hydrogen/entry-client
that can be used inindex.html
- Enable early hydration when streaming
- Add variantId prop to
<ProductMetafield />
component #730 - Add query timing logging option
showQueryTiming
#699 - Add variantId prop to
<ProductPrice />
component - Add
preload
option touseQuery
anduseShopQuery
#700
<Model3D>
has been renamed to<ModelViewer>
<Product />
and<CartLine />
aliases have been removed; use the original components<ProductProvider />
and<CartLineProvider />
instead. Their nested component aliases, such as<Product.Image />
, have also been removed; in this example you should use<ProductImage />
.- Merge
/src/entry-server.jsx
entry point intoApp.server.jsx
- The following components had their prop name renamed. Refer to the documentation or #627 for more details.
<ExternalVideo />
: renamed video prop to data<Video />
: renamed video prop to data<Image>
: renamed image prop to data<MediaFile>
: renamed media prop to data<ModelViewer>
: renamed model prop to data<Metafield>
: renamed metafield prop to data<Money>
: renamed money prop to data<UnitPrice>
: renamed unitPrice prop to data, unitPriceMeasurement prop to measurement<ProductProvider>
: renamed product prop to data<CartProvider>
: renamed cart prop to data
- Helmet component has been renamed to Head
- Remove the
<SelectedVariantBuyNowButton />
component in favour of using<BuyNowButton variantId={product.selectedVariant.id} />
<SelectedVariantAddToCartButton />
has been removed; the<AddToCartButton />
will now use the selectedVariant by default.- Remove the
<SelectedVariantImage />
component in favour of using<Image data={product.selectedVariant.image} />
- Remove the
<SelectedVariantMetafield />
component in favour of using<ProductMetafield variantId={product.selectedVariant.id} />
- Remove the
<SelectedVariantShopPayButton />
component in favour of using<ShopPayButton variantId={product.selectedVariant.id} />
- Remove the
<SelectedVariantPrice/>
and<SelectedVariantUnitPrice/>
component in favour of using<ProductPrice variantId={product.selectedVariant.id} />
- Change
/react
RSC path to/__rsc
<ShopifyProvider>
can again be used in server components- Use hashes as client component ids instead of absolute paths
- Transition away from deprecated currency selector in favor of country selector
- Simplify Helmet usage and make it compatible with RSC
- The
Seo.client
component has been moved fromsrc/components
to@shopify/hydrogen
. The props of theSeo.client
component also changed to always take intype
anddata
. Refer to theSeo
component reference for more details. #539 - Standardize cache control header into caching strategies by @wizardlyhel in #629
- Target future release to use '2022-01' API Version
- Correct Typescript issue where
as
was a default prop for all components when it should not be - Update types and docs for
useCart()
hook and<CartProvider>
- Track page load performance
- The following money components no longer allow the function-as-a-child (also known as "render props") pattern; see #589
<Money>
UseuseMoney()
for customization<CartLinePrice>
UseuseMoney()
for customization<ProductPrice>
UseuseMoney()
for customization<SelectedVariantPrice>
UseuseMoney()
for customization<Metafield>
UseuseParsedMetafields()
for customization<ProductMetafield>
UseuseParsedMetafields()
for customization<SelectedVariantMetafield>
UseuseParsedMetafields()
for customization<UnitPrice>
UseuseMoney()
for customization<CartLines>
UseuseCart()
for customization
<Metafield>
now rendersratings
as a<span>
with text instead of stars;multi_line_text_field
inside of a<span>
instead of a<div>
- Use
featureImage
instead of images(first:1) on product query - Update
react-helmet-async
to 1.2.3 and remove our custom types
- Fix index routes. See #562
- Fix missing server state on SSR pass
- Fix mobile navigation in example that scrolls the body underneath when shown by @Francismori7 in #582
- Add charset to content type in HTML responses
- Fix header shift when cart is opened by @Francismori7 in #600
- Fix bug where search param is not being pass along during RSC streaming call #623
- Allow custom entry-client filenames
- Clear browser fetch cache by @wizardlyhel in #591
- Cannot redefine property error when updating client components
ShopPayButton
supports quantities greater than 1. Also fixed issues with IDs in Storefront API version 2022-01- Render error in
Gallery.client.jsx
component when product resource has an external video or no images. - Ensure youtube external videos are embed compatible urls
- Prevent client components from being cached during development
- Backticks in HTML break RSC hydration.
- and components. These components used the “function-as-a-child” pattern which doesn’t allow the
children
prop to be serialized, preventing them from being rendered within Server components.
Migration
The functionality provided by these components can be replicated using the useCartLine()
hook instead.
Example
// Before
function SomeComponent() {
return (
<>
<CartLineSelectedOptions as="ul" className="text-xs space-y-1">
{({name, value}) => (
<>
{name}: {value}
</>
)}
</CartLineSelectedOptions>
<CartLineAttributes as="ul" className="text-sm space-y-1">
{({key, value}) => (
<>
{key}: {value}
</>
)}
</CartLineAttributes>
</>
);
}
// After
function SomeComponent() {
const {merchandise} = useCartLine();
return (
<>
<ul className="text-xs space-y-1">
{merchandise.selectedOptions.map(({name, value}) => (
<li key={name}>
{name}: {value}
</li>
))}
</ul>
</>
);
}
- Remove
fetch
workaround - Remove the following hooks. (All the same functionality can be retrieved through the
useCart()
hook)useCartAttributesUpdateCallback
useCartBuyerIdentityUpdateCallback
useCartCheckoutUrl
useCartCreateCallback
useCartDiscountCodesUpdateCallback
useCartLinesAddCallback
useCartLinesRemoveCallback
useCartLinesTotalQuantity
useCartLinesUpdateCallback
useCartNoteUpdateCallback
- Remove React Router on the client
- Remove
handleEvent
in favor ofhandleRequest
- Remove
assetHandler
parameter in the newhandleRequest
<SelectedVariantAddToCartButton />
has been removed; the<AddToCartButton />
will now use the selectedVariant by default.- Remove the
<SelectedVariantImage />
component in favour of using<Image data={product.selectedVariant.image} />
- Remove the
<SelectedVariantMetafield />
component in favour of using<ProductMetafield variantId={product.selectedVariant.id} />
- Remove the
<SelectedVariantBuyNowButton />
component in favour of using<BuyNowButton variantId={product.selectedVariant.id} />
- Remove the
<SelectedVariantShopPayButton />
component in favour of using<ShopPayButton variantId={product.selectedVariant.id} />
0.10.1 - 2022-01-26
- Hot reload for newly added page files
0.10.0 - 2022-01-25
- Warn instead of error when a page server component is missing valid exports
- Adopt upstream version of React Server Components. See #498 for breaking changes
- Bump to latest version of React experimental to include upstream context bugfix
- Improve API routes by allowing strings and JS objects to be returned.
- The 'locale' option in shopify.config.js had been renamed to 'defaultLocale'
- Rename
graphqlApiVersion
tostorefrontApiVersion
inshopify.config.js
- Make sure that API routes hot reload properly
0.9.1 - 2022-01-20
- Transitive dependency bump.
0.9.0 - 2022-01-20
- API routes 🎉
- Move to undici instead of node-fetch
0.8.3 - 2022-01-13
- Add optional
locale
param touseShopQuery
to be used asAccept-Language
in the store Storefront API query - Optional purge query cache per build
- Replace log abbreviations with full text.
0.8.2 - 2022-01-07
- Warn when requests take longer than 3000ms instead of erroring
useQuery
returns an error if the query's fetch was unsuccessfuluseShopQuery
will give error hints to look atshopify.config.js
when the Storefront API responds with a 403
- Load logger only once.
- Do not attempt to decode product IDs, as they are no longer base64-encoded in
unstable
0.8.1 - 2022-01-04
- Detect bot user agents and give bots a non-streamed response.
- Add global
Oxygen.env
for server-only environment variables. - Logging abstraction with default timing information
- Upgrade to latest React 18 experimental version
- Cart decrease button removes at zero quantity
0.8.0 - 2021-12-07
- Export
CartLineSelectedOptions
properly - Fix suspense utility function
0.7.1 - 2021-12-02
- Allow
useShopQuery
to be skippable if no query is passed - Remove usage of
react-query
(Not a breaking change)
- Avoid repeating the same identifier for default and named exports
- Remove sourcemap warnings
0.7.0 - 2021-11-22
- Add file reference metafield support
- Allow custom Model3D poster
- Support synchronous server redirects
- Binding of waitUntil in playground/server-components-worker
- Default to
retry: false
inuseQuery
- Warn and ignore reserved properties in server state
- Run graphiql middleware before vite, fixing graphiql
0.6.4 - 2021-11-11
- Let Vite handle public assets in development
- New lines in hydration request break JSON.parse
- Normalize POSIX separators to support windows #201
- Scroll to top on app first load
- Update variantID to variantId #78
0.6.3 - 2021-11-10
- Add trailing slash to user components glob
0.6.2 - 2021-11-10
- Remove CartProvider from BuyNowButton
- Reading property of null for component props
- Transform deeply-imported client components
- Duplicated files and contexts in browser
0.6.1 - 2021-11-08
- Transitive dependency bump.
- Do not set headers after they are sent to client
0.6.0 - 2021-11-05
- Disable the quantity adjust button when the cart is not idle
- Use country server state in cart for the inContext directive
- Use Image url field instead of deprecated originalSrc field
- Switch to unstable API
- Update interaction prompt and interaction promp style attributes for Model3d
- Make sure all errors show an error dialog when hydrogen is in dev mode
- MediaFile component warning on non-Model3D types
- Remove console logs for caching
- Lowercased SVG tags in RSC
- Make the URL search property available via hooks
- Ensure delayed callback is fired for cache purposes in Workers runtimes.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Update the ServerStateProvider context
- Add tabIndex to ShopPayButton
- Update LocalizationProvider query, context, and exports
- Introduct full-page and sub-request caching API.
- Update Model3D props and add binding to model-viewer events
- Add
passthoughProps.disabled
toAddToCartButton
- Do not show undefined currency symbol in production
- Add external image support to Image component
- Make
CartProvider
a client-only concern. #631 - Use
Accept: application/hydrogen
as a header when makingfetch
calls against a Hydrogen page. Useful for Custom Responses.
- Lock model-viewer.js version to 1.8
- Use the Intl.NumberFormat parts for determining the amount value returned by the useMoney hook
- Optimize React related dependencies at server start to avoid page reloads
- Do not throw when
storeDomain
contains protocol.
- Export utilities in client bundle
parseCookies
will split only on first =- Make BuyNowButton a client component since it uses useEffect
- Preserve original aspect ratio for product images
- Invoke CartProvider callbacks before performing the GraphQL mutations
- Fix the accessible label in the AddToCartButton component when an item is added to cart
- Cart fetch to return stringified error
- Remove sourcemap warnings
- Demo Store template GalleryPreview unique key warning
- Mitigation for upcoming breaking minor Vite update
- Added support for images and collections in the ProductProvider component
- Added more GraphQL fragments for building block components (Metafield, UnitPrice) and updated exports of these fragments
useQuery
now behaves exactly like react-query's hook of the same name
- Handle products with selling plans
- SSR issue when running Vite 2.6
- Occasional
ProductProviderFragment
error when booting Hydrogen dev server #571
- New GraphQL fragments for Variants, SellingPlans, and SellingPlanGroups
- Updated types for the
useProductOptions
hook
Dynamic require of "stream" is not supported
error in browser logs
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.