Skip to content
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

[Storefront Preview] SCAPI cache breaker for older v2 PWA Kit (@W-15214446@) #1740

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

vmarta
Copy link
Contributor

@vmarta vmarta commented Apr 9, 2024

Porting the changes from #1701. Unfortunately, while the solution/concept is still the same, the implementation had to be different.

In the older V2 PWA Kit:

  • The StorefrontPreview component does not have access to the commerce api clients because they're not in the same package
  • The Proxy mechanism has already been used. So we need to add the cache breaker using the existing mechanism (see willSendRequest)

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

Changes

  • (change1)

How to Test-Drive This PR

https://runtime.commercecloud.com/mobify/blitz/will/preview?path=/global/en-GB/product/25695327M?color%3DJJI15XX%26size%3D9SM%26pid%3D701644153083M

  1. Note that the product price should be the regular price
  2. In the Preview form, enter tester=yes as the custom qualifier
  3. Click on the Preview button
  4. The price is immediately updated with the discounted promo price.

Note: to verify that the environment is actually using a bundle for the older PWA Kit, you can add an item to the cart, and that should result in an OCAPI call (not SCAPI).

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@vmarta vmarta marked this pull request as ready for review April 9, 2024 18:09
@vmarta vmarta requested a review from a team as a code owner April 9, 2024 18:09
@vmarta vmarta requested review from adamraya and bendvc April 9, 2024 18:09
@vmarta vmarta merged commit c716372 into release-2.8.x Apr 9, 2024
29 checks passed
@vmarta vmarta deleted the 2.8.x/scapi-cache-breaker-2 branch April 9, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants