Summary
@decocms/apps-start ships VTEX and Shopify ports today (per the package README and folder layout). There is no Magento port, even though deco-cx/apps has a mature Magento integration that powers multiple production sites.
This blocks migration of Magento-based Fresh storefronts to TanStack Start: deco-migrate deletes the legacy magento/ folder's imports but the new src/setup/commerce-loaders.ts has nothing to map them to, so cart / user / wishlist / PDP / PLP loaders break post-migration.
Source to port
deco-cx/apps, folder magento/ — 60 TypeScript files, structurally identical to apps/vtex/ (mod.ts, manifest.gen.ts, loaders/, actions/, hooks/, middleware.ts, utils/clientGraphql, utils/client, utils/transform.ts, utils/cache.ts).
Key entry points to port (≈54 generic files):
mod.ts — App definition with configureMagento + middleware
loaders/cart.ts, loaders/user.ts, loaders/wishlist.ts, loaders/proxy.ts
loaders/product/detailsPage.ts, loaders/product/listingPage.ts, loaders/product/list.ts
loaders/routes/*
actions/{cart,newsletter,product,wishlist}/*
hooks/{useCart,useUser,useWishlist}.ts (refactor to react-query like vtex/hooks/)
utils/clientGraphql/*, utils/client/*, utils/{transform,cache,graphql,cart}.ts
Required adaptations (Deno → Node)
$fresh/server.ts imports → TanStack/React equivalents
deco/* imports → @decocms/start/* and @decocms/apps-start/commerce
- Drop
.ts extension from relative imports
- Replace Deno
std/cache LRU with npm:lru-cache (mirror pattern in apps-start/vtex/utils/fetchCache.ts)
- Wrap loaders/actions in
createServerFn
- Cookies via
@decocms/apps-start/commerce helpers
CRITICAL: preserve ExtensionOf pattern
The existing Magento app accepts extensions?: ExtensionOf<T>[] on key loaders (loaders/extensions/cart, loaders/extensions/product/{detailsPage,listingPage,list}). This is how sites plug in third-party features (Livelo points, Amasty reviews, etc.) without forking the app.
Please port this pattern intact. The first consumer (granadobr-tanstack) will keep Granado-specific extensions (Livelo + Amasty) in src/apps/magento-granado/ locally — that only works if the generic Magento loaders accept and apply extensions[].
Context
Sites blocked on this:
- granadobr-tanstack (Granado, Brazilian cosmetics) — repo: deco-sites/granadobr-tanstack
- Future Magento migrations across the deco fleet
Companion framework issue: decocms/deco-start — Platform magento missing from migrate's enum.
Happy to send a PR — let me know the preferred patch granularity (one big PR vs split per area).
Summary
@decocms/apps-startships VTEX and Shopify ports today (per the package README and folder layout). There is no Magento port, even thoughdeco-cx/appshas a mature Magento integration that powers multiple production sites.This blocks migration of Magento-based Fresh storefronts to TanStack Start:
deco-migratedeletes the legacymagento/folder's imports but the newsrc/setup/commerce-loaders.tshas nothing to map them to, so cart / user / wishlist / PDP / PLP loaders break post-migration.Source to port
deco-cx/apps, foldermagento/— 60 TypeScript files, structurally identical toapps/vtex/(mod.ts, manifest.gen.ts, loaders/, actions/, hooks/, middleware.ts, utils/clientGraphql, utils/client, utils/transform.ts, utils/cache.ts).Key entry points to port (≈54 generic files):
mod.ts— App definition withconfigureMagento+ middlewareloaders/cart.ts,loaders/user.ts,loaders/wishlist.ts,loaders/proxy.tsloaders/product/detailsPage.ts,loaders/product/listingPage.ts,loaders/product/list.tsloaders/routes/*actions/{cart,newsletter,product,wishlist}/*hooks/{useCart,useUser,useWishlist}.ts(refactor to react-query likevtex/hooks/)utils/clientGraphql/*,utils/client/*,utils/{transform,cache,graphql,cart}.tsRequired adaptations (Deno → Node)
$fresh/server.tsimports → TanStack/React equivalentsdeco/*imports →@decocms/start/*and@decocms/apps-start/commerce.tsextension from relative importsstd/cacheLRU withnpm:lru-cache(mirror pattern inapps-start/vtex/utils/fetchCache.ts)createServerFn@decocms/apps-start/commercehelpersCRITICAL: preserve
ExtensionOfpatternThe existing Magento app accepts
extensions?: ExtensionOf<T>[]on key loaders (loaders/extensions/cart,loaders/extensions/product/{detailsPage,listingPage,list}). This is how sites plug in third-party features (Livelo points, Amasty reviews, etc.) without forking the app.Please port this pattern intact. The first consumer (granadobr-tanstack) will keep Granado-specific extensions (Livelo + Amasty) in
src/apps/magento-granado/locally — that only works if the generic Magento loaders accept and applyextensions[].Context
Sites blocked on this:
Companion framework issue:
decocms/deco-start— Platformmagentomissing from migrate's enum.Happy to send a PR — let me know the preferred patch granularity (one big PR vs split per area).