docs(preview): explain worker-based no-JS accessibility fallback
davoodmehraban89 committed
Oct 15, 2026 at 08:38 UTC
42eb4490fa720c3d6aaf1e97653b745ee4d71e82
1 file changed
+14
commerce/README.md
+14
@@ -92,3 +92,17 @@ The preview must not be represented as an operating store. A public static UI de
92
- Until backend credentials are configured, no legitimate add-to-cart, checkout, customer registration, stock verification or payment is available. The preview explicitly signals that fact.
93
- Every pull-request change to `commerce/` is checked by GitHub Actions using `npm test` and `npm run build`; Cloudflare Pages builds the development branch for its public static preview without changing `main`.
94
- If the site does not open for a visitor, first compare the canonical URL with the latest successful deployment URL in Cloudflare Pages and collect the exact browser error, network (Wi-Fi/mobile data) and country. A successful Cloudflare deployment alone does not guarantee reachability from every network.
95
+
96
+
97
+## White-screen-safe accessible preview
98
+
99
+The URL `https://medusa-commerce-access.davoodmehraban89.workers.dev/` is a **separate Cloudflare Worker** deployed from `commerce/edge/preview-worker.js`, independent of Vite and the `pages.dev` JavaScript bundles.
100
+
101
+- Returns fully rendered HTML and inline CSS on the first response; **no browser JavaScript, external fonts, image CDN, or API** is needed.
102
+- Country and language links are ordinary server-rendered HTTP GET navigation and work without JavaScript. Product sample cards are explicitly non-orderable. Search and category filtering are processed per request.
103
+- A static HTML-only page is the fallback for users whose browser shows blank output on the interactive React preview.
104
+- The worker returns 404 for unrelated paths and 405 for modifying HTTP methods. Nothing in this path accesses store data, payments, or other secrets.
105
+- The default client-side React demo remains separately available at `https://medusa-commerce-preview-dm.pages.dev/`.
106
+- **Limit:** a working outside-network check cannot prove the visitor's phone/carrier can reach `workers.dev`. If it also renders blank, collect the exact Safari/Chrome error, network type and VPN/DNS status; do not blindly assume a frontend-only problem.
107
+
108
+The accessible Worker implementation is tracked and versioned in `commerce/edge/preview-worker.js`. After modifying it, update the deployed Worker and independently verify locale/market combinations. Never pretend committing a source file alone automatically redeploys this particular Worker.