feat: replace mock.shop domain with mockdotshop.myshopify.com internally#3710
feat: replace mock.shop domain with mockdotshop.myshopify.com internally#3710fredericoo wants to merge 4 commits intomainfrom
Conversation
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
| }, | ||
| "mock-shop": { | ||
| "description": "Use mock.shop as the data source for the storefront.", | ||
| "description": "Use Mock Shop as the data source for the storefront.", |
There was a problem hiding this comment.
I opted to replace the literal domain mentioned here to the term "Mock Shop" instead.
We do not need to surface to users that it comes from mockdotshop.myshopify.com
The `mock.shop` domain is being deprecated. This migrates all default references to `mockdotshop.myshopify.com` while maintaining backwards compatibility for existing projects that still use `mock.shop` in their environment variables. Key decisions: - `isMockShop()` checks recognize both old and new domains during the transition period, so existing storefronts don't break - User-facing strings now display "Mock Shop" as a brand name rather than showing the raw domain - Magic string literals replaced with named constants (`MOCK_SHOP_DOMAIN`, `LEGACY_MOCK_SHOP_DOMAIN`) in both hydrogen-react and the CLI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `mock.shop` domain is an internal default, not a user-facing API contract. Both domains point to the same store, so existing projects with `mock.shop` in their `.env` still work at the API level — they just won't be detected as "mock shop" for cosmetic behaviors like the welcome page and warning suppression, which is a useful nudge to update. A clean cut is simpler than carrying a legacy constant that would need a second breaking change to remove later. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The success banner snapshot expected "Mock.shop" but we changed the storefront title to "Mock Shop" in onboarding/local.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fff1d61 to
cbe74e4
Compare
itsjustriley
left a comment
There was a problem hiding this comment.
The PR body says "isMockShop() recognizes both domains during the transition" but the code only recognizes mockdotshop.myshopify.com. Verified with tophat that setting PUBLIC_STORE_DOMAIN=mock.shop errors vs falling back. Just want to confirm what the desired behaviour is (I suspect we should just update the PR body to match the changeset).
sorry that was an old description. i had originally implemented it with support for mock.shop as well but i realised if users upgrade the package there WONT be any mentions to mock.shop to begin with will update pr desc |
Why
The
mock.shopdomain is being deprecated. Newly scaffolded Hydrogen projects need to default tomockdotshop.myshopify.comas the demo Storefront API endpoint.What
Replaces all default references to
mock.shopwithmockdotshop.myshopify.comacross the runtime libraries, CLI tooling, and test infrastructure. Existing projects usingmock.shopin their env vars will no longer work, but we assume users are not deliberately using mock.shop as a domain the lack of a linked store leads to our internal fallback, we do not default to mock.shop in user visible code anywhere)hydrogen-reactstorefront clientMOCK_SHOP_DOMAINconstantdev-shared,init,onboarding)hydrogenanalytics + virtual routesHow to Test
mockdotshop.myshopify.com(needs to add a log into a loader/action that calls the SFAPI)Post-Merge Steps
mock.shopdomain on timing