Description
The /cart route loader fetches the cart on every visit, but nothing renders it.
app/routes/cart/cart-page.tsx:151-157 returns cart: await cart.get(), while the component at app/routes/cart/cart-page.tsx:161 only destructures featuredProducts from useLoaderData. The cart it renders comes from useCart() (the zustand store), and no other route reads this loader's cart field.
That is one wasted Storefront API round trip per /cart navigation, blocking the loader response.
Found while reviewing Weaverse/aspen#43, which ports this cart architecture and inherits the same dead loader call.
Suggested fix
Drop cart from the loader return, or use it to seed the store instead of re-fetching client-side.
Description
The
/cartroute loader fetches the cart on every visit, but nothing renders it.app/routes/cart/cart-page.tsx:151-157returnscart: await cart.get(), while the component atapp/routes/cart/cart-page.tsx:161only destructuresfeaturedProductsfromuseLoaderData. The cart it renders comes fromuseCart()(the zustand store), and no other route reads this loader'scartfield.That is one wasted Storefront API round trip per
/cartnavigation, blocking the loader response.Found while reviewing Weaverse/aspen#43, which ports this cart architecture and inherits the same dead loader call.
Suggested fix
Drop
cartfrom the loader return, or use it to seed the store instead of re-fetching client-side.