This PR aims to refactor commerce-sdk-react code such that it no longer hardcodes the list of parameter keys. It will use the exported parameter keys from the underlying commerce-sdk-isomorphic instead.
For early review/feedback, I've made changes to only the ShopperProducts and ShopperBaskets:
removed our paramKeys.ts files
used the exported parameter keys (e.g. ShopperBaskets.paramKeys['getBasket'])
leave the tests as they are
Todos:
[x] The tests are currently failing because they're not aware of the new changes to the isomorphic lib yet. I plan to release a dev version of it.
[x] Work on the rest of the APIs.
[x] ShopperBaskets/
[x] ShopperContexts/
[x] ShopperCustomers/
[x] ShopperExperience/
[x] ShopperGiftCertificates/
[x] ShopperLogin/
[x] ShopperOrders/
[x] ShopperProducts/
[x] ShopperPromotions/
[x] ShopperSearch/
[x] ShopperSeo/
[x] ShopperStores/
Types of Changes
[ ] Bug fix (non-breaking change that fixes an issue)
[ ] New feature (non-breaking change that adds functionality)
[ ] Documentation update
[ ] Breaking change (could cause existing functionality to not work as expected)
[x] Other changes (non-breaking changes that does not fit any of the above)
Breaking changes include:
Removing a public function or component or prop
Adding a required argument to a function
Changing the data type of a function parameter or return value
This PR aims to refactor commerce-sdk-react code such that it no longer hardcodes the list of parameter keys. It will use the exported parameter keys from the underlying commerce-sdk-isomorphic instead.
For early review/feedback, I've made changes to only the ShopperProducts and ShopperBaskets:
ShopperBaskets.paramKeys['getBasket']
)Todos:
Types of Changes
Changes
How to Test-Drive This PR
If you want to test drive it now, you'll need to build and symlink the isomorphic lib. Follow the instruction here, since it's still mostly relevant: https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/158You no longer need to symlink the isomorphic lib. You can now run
npm ci
at the root, before you test-drive the PR.Since this PR is essentially a refactoring, we can test-drive it by smoke testing the retail-react-app site.
We can be confident in the code changes because of a few layers in place:
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization