Repository navigation
feat(apps-shopify): sync with deco-cx/apps shopify (i18n, cart recovery, listAllCategories) - #626
Merged
Merged
Conversation
…ry, listAllCategories) Brings @decocms/apps-shopify up to date with deco-cx/apps shopify/ as of 7147febe (2026-10-05): - i18n (#1371): optional languageCode/countryCode on PDP, PLP, ProductList, RelatedProducts, shop and cart, sent through @incontext - parseProductSlug: only a 10-16 digit tail counts as a variant id - PLP: collection handle from the last path segment, breadcrumb @id - cart: replace a NOT_FOUND cart instead of failing; buyerIdentity and userErrors on the cart queries - metafields: list reference images comma-joined, raw value fallback - listAllCategories loader (#1639) - no-store on cart/user loaders (#1601) - Storefront API 2025-04 -> 2026-04 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JonasJesus42
approved these changes
Oct 6, 2026
|
🎉 This PR is included in version 7.73.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
@decocms/apps-shopifywas ported fromapps-starton 2026-07-07 and has not followeddeco-cx/appsshopify/since. This PR brings it up to date withdeco-cx/apps@7147febe(2026-10-05). It matters for the Zee.Dog international stores, which need per-market prices and languages.What changed (with the upstream PR it comes from)
languageCode/countryCodeprops on PDP, PLP, ProductList, RelatedProducts and shop.getCart/createCarttake an optional third arg with the same fields. All of them reach Shopify through@inContext.parseProductSlug: only a 10–16 digit tail counts as a variant id. Before,t-shirt-2was read as handlet-shirtwith variant2./{lang}/collections/<handle>works. The breadcrumb gets@id= collection id.NOT_FOUNDfor, a new cart is created instead of failing.buyerIdentity { countryCode email }is added to the Cart fragment anduserErrorstoCreateCart.,and empty ones are dropped. If there are no images, the rawvalueis used. Before, this was a JSON array string that could containnulls.onlineStoreUrlis added to the Collection fragment.shopify/loaders/categories/listAllCategoriesloader, also exported aslistAllCategoriesLoader.cache = "no-store"on the cart and user loaders.2025-04→2026-04.Supporting change: the GraphQL client now throws
ShopifyGraphQLError, which keeps theerrorsarray (includingextensions.code). The message is the same as before.Intentional differences from upstream
PT/BRdefault. Upstream defaults tolanguageCode: "PT"andcountryCode: "BR". Here, leaving the props out omits the@inContextvariables, so Shopify falls back to the store's primary market. That is the current behavior, so existing sites see no change. Adding a BR default would quietly switch non-BR stores to BRL prices.loaders/config,actions/order/draftOrderCalculate,adminAccessToken). Upstream #1675 marks themdefaultVisibility: "private", and the blocks runtime has no equivalent yet. Porting them now would expose an action backed by the admin token through invoke. This should be a separate PR once visibility is supported.loaders/proxy(skipped inSKIP_RESOLVE_TYPES),handlers/sitemap(covered by@decocms/blocks/sdk/sitemap),hooks/*(site-level), and the cart cookie encoding fix (utils/cookiesalready encodes and decodes).Tests
bun run typecheck✅ ·bun run test✅ (44 tests, 8 new) ·biome lint✅parseProductSlug, how metafield reference values are resolved,getCartreplacing a stale cart while passing the language/country through, andgetCartrethrowing errors other than NOT_FOUND.knipreportsvitest/tscas unlisted, which is the same onmainand not caused by this PR.apps-shopify, even though the rootbiome.jsonsays spaces. The diff contains only real changes.🤖 Generated with Claude Code
Summary by cubic
Brings
@decocms/apps-shopifyup to date with thedeco-cx/appsshopify package (as of 2026-10-05) for the Zee.Dog international stores, which need per-market prices and languages. Adds optional language and country context to the product, shop, and cart loaders, recovers from stale carts, and adds a categories loader; all 44 tests, typecheck, and lint pass.Key changes
languageCode/countryCodeprops to PDP, PLP, ProductList, RelatedProducts, shop, and the cart loaders.getCartcreates a new cart when the cookie references one Shopify returnsNOT_FOUNDfor, instead of failing.parseProductSlugonly counts a 10–16 digit numeric tail as a variant id, so handles liket-shirt-2stay intact.@id.shopify/loaders/categories/listAllCategoriesloader, exported aslistAllCategoriesLoader.cache = "no-store".2025-04to2026-04; the GraphQL client now throwsShopifyGraphQLError, preserving theerrorsarray includingextensions.code.Intentional differences from upstream
@inContextvariables, so Shopify falls back to the store's primary market; noPT/BRdefault that would switch non-BR stores to BRL prices.loaders/config,actions/order/draftOrderCalculate,adminAccessToken) are not ported; they need private-visibility support the blocks runtime lacks.loaders/proxy,handlers/sitemap,hooks/*, and the cart cookie encoding fix (already handled).Written for commit 188e487. Summary will update on new commits.