-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Storefront Preview] Avoid stale SCAPI responses (@W-15214446@) (#1701)
* Attempt to inject cache breaker globally * Break cache only when in storefront preview mode * Refactor so the changes live in commerce-sdk-react only * Further refactoring * Identify Storefront Preview mode later (to be more accurate) * Remove ts-ignore * Move and isolate changes to the StorefrontPreview component * Detect when the API clients are updated * Add useEffect dependency * Refactor setting the cache breaker for readability * Proxy all SCAPI requests * Add test * Resolve typescript errors * Some test refactoring * Fix leaking of window.STOREFRONT_PREVIEW * Add another test * Add another assertion * Update CHANGELOG.md * Some test refactoring * A bit more refactoring * Remove unnecessary test * Clean up import * Use `Date.now()` to be clearer * Use `Date.now()` to be cleare * Fix test mock
- Loading branch information
Showing
6 changed files
with
111 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
packages/commerce-sdk-react/src/hooks/useCommerceApi.test.tsx
This file was deleted.
Oops, something went wrong.