npm install
on a site using this package without the --legacy-peer-deps
flag:@reach/router
as a dependency. @reach/router
is incompatible with Gatsby 4. Gatsby 4 includes a fork, @gatsbyjs/reach-router
, and an alias so that @reach/router
can still be imported in code.@reach/router
from your site's dependencies. If you do, and you are importing @react/router
in Jest tests, you will need to add an alias to your jest.config.js
file:dependencies
to peerDependencies
so that consumers of this package can upgrade Gatsby without any intervention from Chord. This will require you to do more than just bump this version in the package.json
.package.json
to drop @chordcommerce/gatsby-theme-performance
and any of the listed peerDependencies
in the theme's peerDependencies
from your dependencies
block. We will be reinstalling them in the next section.npm install/yarn add
command that you can copy and run manually.https://example.com/products/t-shirt
, however only routes with the en-US
localization were being rendered, for example: https://example.com/en-US/products/t-shirt
. It is recommended that you upgrade to this version and then re-crawl your site via the Google Search Console.@chordcommerce/chord-js-performance
to v.1.6.0
.This update adds the currency property when one of these events is triggered Cart Viewed
, Product Removed
, Product Added
, Product Updated
.modifyLineItem
to the useCart
hook providing more flexibility to modifying line items such as updating quantity
and customAttributes
.shopifyId
to a string from an integer. This is specifically needed so that Contentful's GraphQL API can return this ID, as it often larger than the Integer type defined in the GraphQL specification.v1.5.0
.v1.5.0
v1.5.0
)segmentConfig
set in gatsby-config.js
.v1.2.0
)gatsby-config.js
file, as follow:manualLoad
is an advanced feature. It is set to true
by default in our Gatsby starters so that Segment's Consent Manager can work properly. Alternatively, you can use it if you are calling analytics.load({writeKey})
manually elsewhere in your code.false
if you do not use, or have removed, the Consent Manager implementation (see below)./src/components/Segment/ConsentManager/index.jsx
. analytics.js
add-on with support for consent management. At its core, the Consent Manager empowers visitors to control and customize their tracking preferences on the website. They can opt out entirely of being tracked, or selectively opt out of tools in which they don’t want their information stored.GATSBY_SEGMENT_SHOULD_REQUIRE_CONSENT
new environment variable to true
in your .env
file.Consent Manager
to work, you must setup Segment integrations in your target Segment workspace.Consent Manager
component by visiting the URL below. It should not return an empty array if you have properly configured them. yarn dev
). When/if that happens, edit your /src/components/Segment/ConsentManager/index.jsx
and move the {children}
coming from the wrapRootElement before the <ConsentManager />
yarn build && yarn serve
), or use your Netlify/Gatsby Cloud review apps and verify the results.addToCart
now accepts a customAttributes
argument. These attributes will be sent to Shopify when the product is added to the cart.getVariantAvailableQuantity
introduced in the previous version of the SDK has been superseded with getVariantAvailability
. This method will now return not only the variant quantity, but also backorderable information. As follow:availableForSale
Indicates if the product variant is available for sale currentlyNotInStock
Return true if the inventory quantity is <= 0 and overselling is allowed.quantityAvailable
The total sellable quantity of the variant for online sales channels.unauthenticated_read_product_inventory
scope to read variant inventory (same as previous version of the SDK)getVariantAvailableQuantity
to fetch the availability of a given variant:unauthenticated_read_product_inventory
scope to read variant inventory:@chordcommerce/gatsby-theme-performance
. It is now the responsibility of the starter code to enable it. You can find an implementation example in the following pull request.GATSBY_CHECKOUT_DOMAIN
as new environment variable. The effect of this change is that the returned webUrl
property of the Shopify createCheckout
mutation will be under the checkoutDomain
instead of the default one (GATSBY_SHOPIFY_SUBDOMAIN
). We're hoping a side-effect of this is generate proper order attributions.useCatalog
query, and subsequently used to populate our client-side Redux product catalog, have been removed. Those images were included in the first place for legacy reasons (Autonomy-based projects) but not necessary anymore.useProductMainImage
hook now only returns the image title. If you'd like to get the product image, for example in your LineItem
component, simply grab it from the cart:engines
requirements from package.json.addReferralIdentifier
: referrals are handled by third-party apps in Shopify, not natively, so the theme doesn't support them.finalizeCheckout
: Shopify checkout never returns the customer to the Gatsby site, so there is no need to call finalizeCheckout
or display an order confirmation page.modifyCart
: was used exclusively to apply a referral identifier to the cart, which is not applicable (see above).GATSBY_CHORD_TENANT_ID
and GATSBY_CHORD_STORE_ID
are now required environment variables. Chord will provide the values for these variables.GATSBY_ACS_BRAND_NAME
is now a deprecated environment variable. It can be removed with no effect.useAnalytics
hook: Breaking changes have been introduced to tracking methods returned by useAnalytics
, in order to support the new Segment tracking plan mentioned above.analytics
client exported from @arfabrands/gatsby-theme-shopify
has been removed. All tracking calls should use the useAnalytics
hook. This change means that this use of analytics
is no longer available:useAnalytics
hook returns different methods. These existing methods have been renamed and accept different arguments:useAnalytics
hook returns a number of new methods. Here are all the methods that are now available for use in site code: