Skip to content

Add Astro Benny Pets storefront template - #710

Open
tuvit wants to merge 3 commits into
wix:mainfrom
tuvit:add-benny-pets-template
Open

tuvit wants to merge 3 commits into
wix:mainfrom
tuvit:add-benny-pets-template

Conversation

@tuvit

@tuvit tuvit commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What this adds

astro/benny-pets — a designed Wix Stores storefront. It sits alongside commerce as the
design-forward counterpart: a full visual treatment (loading wordmark, parallax gallery, scroll
reveals, testimonials) over a catalog that is entirely Wix-driven.

Every route is server-rendered, and the page ships no framework runtime — the animations, the
variant picker and the cart interactions are plain modules, so there is not one <astro-island> on
any page. First-party JS is ~8 kB.

Wix apps: Wix Stores (catalog, categories, prices, images, options/variants), Wix eCommerce
(cart, checkout), Wix Forms (the footer contact form).

Routes: /, /store, /store/[slug], /cart, 404, plus POST /api/cart/{add,update,remove},
POST /api/checkout, POST /api/contact.

Catalog pairing

  • siteTemplateId: 1fe095c6-5015-431d-a216-069181c126ce
  • Minted from a site seeded for this template: 12 products across 5 real categories (Food, Toys,
    Beds, Accessories, Health), every product with an image in Wix Media, two products with real
    option sets (S/M/L and S/M/L/XL) priced per variant, and a four-field contact form.
  • The only hardcoded resource GUID is CONTACT_FORM_ID in src/lib/constants.ts, which is the form
    that site provisions.

Demo: https://benny-site-tuvitk-0a06.wix-site-host.com

Review against AGENTS.md

Checked every file against the standard; what it changed:

  • Wix is the source of truth — removed a static product-fallback array, a hardcoded "More
    Products" list, six gallery cards with hardcoded names and prices, and a category filter that
    filtered on productType (PHYSICAL) and therefore matched nothing. Products, categories, prices,
    images and form fields now all come from Wix, with empty states when the catalog is empty.
  • Categories — the store's filter is built from categories.queryCategories() and filters by
    real category id, so a category the owner adds appears with no code change. (Note the query needs
    at least one filter — a bare find() is rejected as an empty condition.) The install's
    "All Products" root is dropped in favour of the filter's own All.
  • Prices — every price is the SDK's formattedAmount, requested via the CURRENCY field. No
    $ prefixes, no parseFloat money math. Cart totals come from estimateCurrentCartTotals().
  • VariantsgetProductBySlug with VARIANT_OPTION_CHOICE_NAMES; the product page keeps Add
    to Cart disabled until every option is chosen and updates the price to the chosen variant.
    POST /api/cart/add refuses (409) to add a multi-variant product without one, and resolves the
    sole variant server-side for single-variant products. Nothing ever adds variants[0] blindly.
  • Forms — fields, labels and required flags come from forms.getForm(); values are typed per
    field definition and submitted under each field's target.
  • Build@wix/astro + @wix/astro-wix-hosting-adapter; no cloud-provider-fetch-adapter, no
    isBuild-conditional adapter. No React integration (there are no .jsx/.tsx files). Caret
    ranges throughout. Unknown slugs 404. Caught errors are logged; users see generic messages.
  • Nothing site-specific committed — no wix.config.json, .env.local, .wix/ or lockfile.

Testing

  • Standalone buildnpm install && npm run build from a clean copy: passes.
  • Live site — ran the template against the provisioned site and exercised every flow: catalog,
    categories and formatted prices render server-side; the category filter narrows both the grid and
    the list (All 8+4 → Food 2+2 → Beds 0+1 → All 8+4); choosing "L" moves the price $55 → $75 and
    enables the buttons; quick-add works for single-variant products; the API returns 409 for a
    multi-variant add with no choice; the cart shows Size: M at the M price with a subtotal from the
    estimate call; checkout returns a working redirect-session URL; an unknown slug 404s.
  • Found and fixed during that run: getProduct() returns the product directly while
    getProductBySlug() wraps it in { product } — the sole-variant helper destructured the wrong
    shape, so quick-add 409'd on every product.

Bundle size — why the form schema comes over REST

forms.getForm() builds a 5.47 MB chunk (6.75 MB worker total), over the ~4 MB hosting limit:
@wix/forms' schema module is a namespace re-export of one very large generated module, so a single
call pulls all of it in. This template reads the same definitions from the form-schema REST endpoint
instead — worker total 6.75 MB -> 1.29 MB, largest chunk 5.47 MB -> 0.28 MB.

This is a deliberate deviation from the letter of AGENTS.md ("render fields from forms.getForm()")
that keeps its intent: labels, required flags and dropdown options still come from Wix, nothing is
hardcoded, and a field added in the dashboard still appears. Only the transport changed. @wix/forms
is still used for submissions, which is small. Verified on the live demo — the same four fields
render, with required on email.

Worth noting astro/registration builds the identical 5.46 MB chunk from the same call and would
benefit from the same change; happy to open a follow-up if you want it.

Per the add-template skill, the siteTemplateId pairing is untested until the registry publish:
the code ran against the site the template was minted from, but whether a site created from the
minted template provisions the same form GUID is only verifiable after that publish.

A designed Wix Stores storefront: catalog with real category filtering,
product pages with variant selection, cart, and checkout, plus a contact
form rendered from Wix Forms. Every route is server-rendered and the page
ships no framework runtime — the animations and cart interactions are
plain modules, so there are no islands to hydrate.

Paired with site template 1fe095c6-5015-431d-a216-069181c126ce.
@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

👷 Deploy request for wix-classes-subscriptions-nextjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 67b8cd3

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

👷 Deploy request for wix-cms-nextjs-template pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 67b8cd3

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

👷 Deploy request for wix-commerce-ticketing-nextjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 67b8cd3

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

👷 Deploy request for wix-appointments-subscriptions-nextjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 67b8cd3

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

👷 Deploy request for wix-headless-example pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 67b8cd3

tuvit and others added 2 commits August 26, 2026 12:03
`forms.getForm()` pulls a namespace re-export of one very large generated
module into the server bundle — ~4 MB for a single call. The built worker
was 6.75 MB with a 5.47 MB chunk, over the hosting size limit.

The form-schema REST endpoint returns the same definitions for ~0 KB:
worker total 6.75 MB -> 1.29 MB, largest chunk 5.47 MB -> 0.28 MB. The
fields still come from Wix (labels, required flags, dropdown options), so
nothing is hardcoded; only the transport changed. `@wix/forms` is still
used for `submissions`, which is small.

Note the REST shape differs from the SDK's: fields live under `fields`
rather than `formFields`, and carry `view` / `validation` instead of
`inputOptions` / `stringOptions`.
Reading the form schema over REST removed ~4MB from the server bundle, but the
`@wix/essentials` it introduced depends on react-i18next@16, which imports
react. Nothing here declares react — there are no islands — so Rollup fails to
resolve it and `npm install && npm run build` from a clean copy dies with
"Rollup failed to resolve import react from react-i18next/dist/es/Trans.js".
Declaring react/react-dom at the range @wix/astro already asks for fixes the
build; the peer only has to resolve, no component renders through it.

The SSR bundle is also minified now. Astro leaves the server build unminified
and `vite.build.minify` only reaches the client build, so the server output
shipped with full indentation and comments. That matters beyond page weight: the
deploy transport picks its path by server-bundle size, and past ~2.25MiB of
server code it switches to one that cannot authorize, which leaves site creation
hung mid-deploy. esbuild over the server chunks, with keepNames so stack traces
survive.

Server bundle, base64 as the transport measures it: 9.00MiB before the REST
change, 0.92MiB after these two — 2.1MB of headroom.

Verified by creating a site from the rebuilt template: the job reached COMPLETED
in 21s rather than failing on a 403, and the site serves / , /store with all 12
seeded products, /cart and a product page, with the REST-backed contact form
rendering its real fields.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants