Merge pull request 'fix(ecommerce): forzar renderizado dinamico en home y layout raiz' (#35) from fix/etapa2-subfase2-home-force-dynamic into main
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (push) Successful in 1m6s
Build and Push Frontend / Construir y Subir Imagen (push) Successful in 16m48s

This commit was merged in pull request #35.
This commit is contained in:
devops committed 2026-08-25 04:54:22 +00:00
commit e7533b402d
2 files changed
+14

No files matched your search

+7
View File
@@ -6,6 +6,13 @@ import { Navbar } from "@/components/layout/navbar";
import { WishlistDrawer } from "@/components/wishlist/wishlist-drawer"; import { WishlistDrawer } from "@/components/wishlist/wishlist-drawer";
import { getCategories, getProducts } from "@/lib/headless/client"; import { getCategories, getProducts } from "@/lib/headless/client";
// El Navbar (categorias/colecciones/predictive search) vive en este layout
// compartido -- si alguna pagina futura queda estatica, este fetch se
// congelaria con datos de build time (mock) igual que le paso al home
// (ver app/page.tsx). Forzarlo aca protege el nav en cualquier ruta, no
// solo en las que hoy ya son dinamicas por otro motivo (searchParams, etc.).
export const dynamic = "force-dynamic";
export const metadata: Metadata = { export const metadata: Metadata = {
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://shop.cruzcloud.net"), metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://shop.cruzcloud.net"),
title: { default: "ARI Shopping | Juguetes, regalos y variedades", template: "%s | ARI Shopping" }, title: { default: "ARI Shopping | Juguetes, regalos y variedades", template: "%s | ARI Shopping" },
+7
View File
@@ -7,6 +7,13 @@ import { ProductCarousel } from "@/components/product/product-carousel";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { getCategories, getProducts } from "@/lib/headless/client"; import { getCategories, getProducts } from "@/lib/headless/client";
// Sin esto, Next.js prerenderiza "/" en build time dentro del Dockerfile,
// donde HEADLESS_PROVIDER/MEDUSA_* todavia no existen (solo se inyectan en
// runtime via el Deployment) -- cae al provider mock y ese HTML queda
// cacheado 1 año (visto en vivo: x-nextjs-prerender:1, s-maxage=31536000),
// violando el flujo Admin -> revalidate del ADR 0005 justo en el home.
export const dynamic = "force-dynamic";
export default async function HomePage() { export default async function HomePage() {
const [products, categories] = await Promise.all([getProducts(), getCategories()]); const [products, categories] = await Promise.all([getProducts(), getCategories()]);
const treasures = products.filter((product) => product.isNew || product.featured).slice(0, 8); const treasures = products.filter((product) => product.isNew || product.featured).slice(0, 8);