Releases: Shopify/hydrogen-v1
@shopify/[email protected]
[email protected]
[email protected]
[email protected]
@shopify/[email protected]
@shopify/[email protected]
Minor Changes
-
#1697
85aab092
Thanks @blittle! - RemovedefaultLocale
from the Hydrogen Config and instead adddefaultCountryCode
anddefaultLanguageCode
. Both of which are also now available by theuseShop()
hook:export default defineConfig({ shopify: { - defaultLocale: 'EN-US', + defaultCountryCode: 'US', + defaultLanguageCode: 'EN', storeDomain: 'hydrogen-preview.myshopify.com', storefrontToken: '3b580e70970c4528da70c98e097c2fa0', storefrontApiVersion: '2022-07', }, }
-
#1662
4262b319
Thanks @wizardlyhel! - Fix server analytics route- Fix ServerAnalyticsRoute so that it does complete all async work
- Move Performance and Shopify analytic reporting to client side
- Make sure
ShopifyAnalytics
make its own query for shop id and currency - Remove query for shop id and currency from
DefaultSeo
component - Make Performance and Shopify server analytics connector do nothing
Deprecated components
Remove the following components from
hydrogen.config.js
PerformanceMetricsServerAnalyticsConnector
ShopifyServerAnalyticsConnector
@shopify/[email protected]
Patch Changes
-
#1663
66200d6b
Thanks @jplhomer! - Default to 'US' CountryCode if locale cannot be parsed correctly -
#1690
afde8989
Thanks @frehner! - Add scale to the filename part of the url inshopifyImageLoader()
-
#1676
0149cbf6
Thanks @frandiox! - Avoid writing to Node response if it has been closed early. -
#1674
8068d3ce
Thanks @frandiox! - Throw error when<Link>
component is used outside of<Router>
component. -
#1680
acf5223f
Thanks @blittle! - Fix basepath to not apply to external URLs in the<Link
component. Also default the attributerel="noreferrer noopener
for external URLs. -
#1670
8b26f7a6
Thanks @frandiox! - Optimize client boundaries only during build by default.
[email protected]
@shopify/[email protected]
Minor Changes
-
#1615
20bfc438
Thanks @frehner! -<CartEstimatedCost/>
has been renamed to<CartCost/>
to match a recent update to the Storefront API, in whichcart.estimatedCost
is being deprecated in favor ofcart.cost
.Additionally,
cart.cost.compareAtAmount
was renamed tocart.cost.compareAtAmountPerQuantity
. -
#1619
b0c13696
Thanks @blittle! - We have reworked how localization works in Hydrogen. By default theuseLocalization()
hook returns the default locale defined within your Hydrogen configuration file. The<LocalizationProvider>
component now takescountryCode
andlanguageCode
as optional props. Any props given to<LocalizationProvider>
will also be used by theuseLocalization
hook.Breaking Change
The
useCountry
hook has been removed. Instead use theuseLocalization
hook.- import {useCountry, gql} from '@shopify/hydrogen'; + import {useLocalization, gql} from '@shopify/hydrogen'; export function MyComponent() { - const [country] = useCountry(); + const {country} = useLocalization(); return ( /* Your JSX */ ); }
The
Link
component now respects thebasePath
property defined within it's parentFileRoutes
component. For example, given<FileRoutes basePath="/cn">
, a route within that renders<Link to="/products">
will actually produce an anchor tag prefixed with/cn
:<a href="/cn/products">
. You can override thebasePath
with abasePath
prop on theLink
component. -
#1646
1103fb57
Thanks @benjaminsehl! - Updates default SEO titleTemplate for the Homepage
Patch Changes
-
#1569
e5896a3e
Thanks @wizardlyhel! - Clean up full page cache work withwaitUntil
-
#1643
3b849606
Thanks @frandiox! - Do not cache client components in browser when using TypeScript. -
#1605
2eb2c461
Thanks @frandiox! - Fix hydration issues withuseId
. -
#1613
c45ebd3c
Thanks @frehner! - The<ShopPayButton/>
and<CartShopPayButton/>
now take in awidth
prop to help customize how wide the<shop-pay-button>
custom element is, by using the newly added CSS custom property (variable)--shop-pay-button-width
. -
#1651
a19be2b2
Thanks @blittle! - Fixes to the cart:- Fix bug when providing a lower-case country code to the
LocalizationProvider
- Make sure that the Cart always logs API errors
- Fix bug when providing a lower-case country code to the
-
#1649
df0e01ff
Thanks @blittle! - Add ax-powered-by: Shopify-Hydrogen
header which can be disabled with the Hydrogen config property:poweredByHeader: false
-
#1566
cfe7385e
Thanks @wizardlyhel! - Add storefont id to cart provider query -
#1551
3d20e92d
Thanks @jplhomer! - In-Memory caching is now enabled by default in production for Node.js runtimes. -
#1604
f3827d31
Thanks @cartogram! - Adds newload-config
entry point that exposes aloadConfig()
function that will return the configuration object and the path to the found configuration file for a given Hydrogen project root.Example:
import {loadConfig} from '@shopify/hydrogen/load-config'; const {configuration, configurationPath} = await loadConfig({ root: 'path/to/hydrogen-app', });
-
#1622
d339239d
Thanks @frandiox! - Fix module resolution after HMR in some scenarios. -
#1608
b834dfdc
Thanks @jplhomer! - Add type exports forHydrogenRouteProps
,HydrogenApiRoute
, andHydrogenApiRouteOptions
. -
#1603
e1bb5810
Thanks @frandiox! - Do not trigger prefetch whento
prop is missing in theLink
component.
[email protected]
Patch Changes
- #1607
97dfa170
Thanks @cartogram! - Store copy of demostore files before publishing for use in hydrogen project creation in admin.