-
Notifications
You must be signed in to change notification settings - Fork 48
sync latest checkout library changes #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Tracking field additions - draftOrder and draftOrderTotals refactor - Address autocomplete options - fix country & region matching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request synchronizes the latest changes to the checkout library, primarily focusing on enabling address autocomplete for US addresses and cleaning up region data. The changes improve the checkout address form by restoring address autocomplete functionality, correcting country region data, and enhancing form field reset logic when countries or regions change.
Key Changes:
- Re-enabled US address autocomplete using the
AutoCompletecomponent with debounced input and selection handling - Corrected region data by replacing
"undefined"string values with actualundefinedvalues across multiple countries - Improved form reset logic to clear address fields when changing countries or regions
Reviewed Changes
Copilot reviewed 77 out of 78 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/components/checkout/address/address-form.tsx | Restored address autocomplete for US addresses and improved country/region change handling |
| packages/react/src/components/checkout/address/country-region-data.ts | Fixed region data by replacing string "undefined" with undefined values and removed invalid region |
| packages/react/src/types.ts | Consolidated type definitions and removed unused DraftOrderTotalsQuery |
| packages/react/src/lib/godaddy/queries.ts | Removed redundant query definitions (DraftOrderTotalsQuery, DraftOrderShippingQuery) |
| packages/react/src/lib/godaddy/godaddy.ts | Updated to use environment-based host selection and consolidated queries |
| packages/react/src/tracking/tracking-provider.tsx | Added support for custom tracking properties |
| Multiple localization files | Added missing translations for accessibility labels and error messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/react/src/components/checkout/address/address-form.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/address/utils/check-is-valid-address.ts
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/address/get-country-region.ts
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/address/utils/use-address-verification.ts
Outdated
Show resolved
Hide resolved
…finite zod defintions
Summary
This pull request makes several improvements to the checkout address form and its supporting data, mainly focusing on enabling address autocomplete for US addresses, cleaning up temporary code comments, and correcting region data for several countries. The most significant changes are grouped below by theme.
Checkout Address Form Improvements (
address-form.tsx):AutoCompletecomponent, which is now conditionally shown based on the session'senableAddressAutocompleteflag. This includes wiring upuseAddressMatches, debounced input, and handling selection events. [1] [2] [3] [4] [5] [6]AddressLine1,AdminArea1,AdminArea2, andPostalCodefields to empty strings, ensuring form consistency. Also resetsPostalCodewhen the region changes. [1] [2]tabIndex={0}andaria-requiredto relevant form fields. [1] [2] [3]Region Data Corrections (
country-region-data.ts):"undefined"string values withundefined(actual JavaScript value), improving type consistency and downstream usage. This affects Cook Islands, Falkland Islands, Faroe Islands, French Guiana, French Polynesia, French Southern and Antarctic Lands, Gibraltar, Guadeloupe, Guam, and others. [1] [2] [3] [4] [5]These changes collectively improve the user experience in the checkout flow, especially for US addresses, and ensure more accurate and consistent region data for global addresses.
Changeset
Test Plan