SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
283 stars 130 forks source link

[commerce-sdk-react] Consume parameter keys (@W-15676839@) #1823

Closed vmarta closed 3 months ago

vmarta commented 3 months ago

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:

Todos:

Types of Changes

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
  • Adding a new peer dependency to package.json

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/158

You 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