diff --git a/.oxlintrc.json b/.oxlintrc.json index 238d6805d1..240d22f3e2 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -158,6 +158,9 @@ "packages/hydrogen/src/core/shopify-scripts/utils/tracking-values.ts", "packages/hydrogen/src/core/cart/actions.ts", "packages/hydrogen/src/core/cart/queries.ts", + "packages/hydrogen/src/core/localization/get-localization.ts", + "packages/hydrogen/src/core/localization/queries.ts", + "packages/hydrogen/src/core/localization/server-handlers.ts", "packages/hydrogen/src/core/predictive-search/queries.ts", "packages/hydrogen/src/core/predictive-search/search.ts", "packages/hydrogen/src/core/collection/reconciler.ts", diff --git a/docs/plans/country-currency-selector-prd.md b/docs/plans/country-currency-selector-prd.md new file mode 100644 index 0000000000..14a22bcbf0 --- /dev/null +++ b/docs/plans/country-currency-selector-prd.md @@ -0,0 +1,596 @@ +# PRD: Country/Currency Selector — `localization` Utility + Skill + +| | | +|---|---| +| **Status** | Draft | +| **Owner** | Andrew Nguyen | +| **Target** | `@shopify/hydrogen` (preview architecture) | +| **Deliverables** | `core/localization` module, React/Vue bindings, `country-selector` skill, consumer integrations | + +--- + +## 1. Summary + +Storefront developers on every Hydrogen stack today hand-roll the same ~5 files to let buyers +switch country (and therefore currency) and language: a static country list, a +`getLocaleFromRequest` utility, a resource route, a form/selector component, and a form-handling +action that updates the cart and redirects. This PRD proposes a first-class **`localization` +domain module** in `@shopify/hydrogen` that absorbs that boilerplate behind a small, portable, +progressively enhance-able API — plus an agent **skill** that teaches AI coding agents to wire it +into any framework correctly (markup, a11y, URL strategy, and server wiring). + +The design intentionally mirrors the proven Liquid/Horizon mental model +(`{% form 'localization' %}` → POST → redirect) so it works with zero JavaScript, then layers +client-side enhancement on top. + +--- + +## 2. Background + +### 2.1 Prior art reviewed + +| Source | What it does | What we take / reject | +|---|---|---| +| **Horizon Liquid theme** (`snippets/localization-form.liquid`) | Native `