@faststore/core 4.5.1-dev.3 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-test.log +82 -79
- package/CHANGELOG.md +17 -9
- package/cypress/integration/seo.test.js +5 -35
- package/next-seo.config.ts +0 -3
- package/package.json +6 -6
- package/src/components/product/ProductGrid/ProductGrid.tsx +1 -0
- package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +4 -1
- package/src/components/templates/SearchPage/SearchWrapper.tsx +15 -5
- package/src/components/ui/ProductGallery/GalleryPageHeightLock.tsx +238 -0
- package/src/components/ui/ProductGallery/ProductGallery.tsx +69 -24
- package/src/sdk/ui/useScrollRestoration.tsx +616 -32
- package/src/styles/global/index.scss +12 -0
- package/test/components/skeletons/ProductGridSkeleton.browser.test.tsx +32 -0
- package/test/components/templates/SearchPage/SearchWrapper.browser.test.tsx +137 -0
- package/test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx +230 -0
- package/test/sdk/ui/useScrollRestoration.browser.test.ts +798 -0
package/.turbo/turbo-test.log
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.7 [39m[90m/home/runner/work/faststore/faststore/packages/core[39m
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Not implemented: navigation to another Document
|
|
9
|
+
Not implemented: navigation to another Document
|
|
9
10
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
10
11
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=8199d03debb0a6751ec53d8ee8987b78d0292acb
|
|
11
12
|
[90m at node:internal/deps/undici/undici:16416:13[39m
|
|
@@ -35,12 +36,16 @@
|
|
|
35
36
|
Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
36
37
|
npx update-browserslist-db@latest
|
|
37
38
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
39
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 1024[2mms[22m[39m
|
|
38
40
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
39
41
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
40
42
|
|
|
41
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
42
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m
|
|
43
|
-
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m
|
|
43
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 161[2mms[22m[39m
|
|
44
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 2109[2mms[22m[39m
|
|
45
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 511[2mms[22m[39m
|
|
46
|
+
[33m[2m✓[22m[39m requires selecting a contract before Confirm is enabled, then switches (REQ-03) [33m 334[2mms[22m[39m
|
|
47
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
48
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 32[2mms[22m[39m
|
|
44
49
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mposts the password and redirects to the requested return path
|
|
45
50
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
46
51
|
|
|
@@ -270,16 +275,13 @@ act(() => {
|
|
|
270
275
|
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
|
271
276
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
272
277
|
|
|
273
|
-
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
274
|
-
[33m[2m✓[22m[39m renders the password protection form [33m
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
[33m[2m✓[22m[39m opens the contract switcher and returns to the menu on back [33m 558[2mms[22m[39m
|
|
281
|
-
[33m[2m✓[22m[39m resets to the menu when the drawer closes [33m 347[2mms[22m[39m
|
|
282
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 58[2mms[22m[39m
|
|
278
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 1545[2mms[22m[39m
|
|
279
|
+
[33m[2m✓[22m[39m renders the password protection form [33m 594[2mms[22m[39m
|
|
280
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
281
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[33m 1942[2mms[22m[39m
|
|
282
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 936[2mms[22m[39m
|
|
283
|
+
[33m[2m✓[22m[39m opens the contract switcher and returns to the menu on back [33m 452[2mms[22m[39m
|
|
284
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 55[2mms[22m[39m
|
|
283
285
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
284
286
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
285
287
|
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:121:27[90m)[39m
|
|
@@ -287,9 +289,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
287
289
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
288
290
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
289
291
|
|
|
290
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
291
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
292
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
292
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
293
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
294
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
295
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
293
296
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
294
297
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
295
298
|
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:121:27[90m)[39m
|
|
@@ -297,7 +300,8 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
297
300
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
298
301
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
299
302
|
|
|
300
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
303
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
304
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 265[2mms[22m[39m
|
|
301
305
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
302
306
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
303
307
|
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:121:27[90m)[39m
|
|
@@ -305,12 +309,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
305
309
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
306
310
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
307
311
|
|
|
308
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
309
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
310
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
311
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
312
|
-
[32m✓[39m [30m[
|
|
313
|
-
[32m✓[39m [30m[
|
|
312
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
313
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 248[2mms[22m[39m
|
|
314
|
+
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
315
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
316
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
317
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
318
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
314
319
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
315
320
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
316
321
|
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:121:27[90m)[39m
|
|
@@ -318,12 +323,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
318
323
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
319
324
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
320
325
|
|
|
321
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
322
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
323
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
324
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
325
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
326
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
326
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
327
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
328
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
329
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 206[2mms[22m[39m
|
|
330
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
327
331
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
328
332
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
329
333
|
|
|
@@ -387,23 +391,24 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
387
391
|
at Suspense
|
|
388
392
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
|
|
389
393
|
|
|
390
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
391
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
392
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m
|
|
393
|
-
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
394
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m
|
|
394
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 71[2mms[22m[39m
|
|
395
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
396
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 58[2mms[22m[39m
|
|
397
|
+
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
398
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
399
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[33m 419[2mms[22m[39m
|
|
395
400
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
396
401
|
[22m[39mSet password request failed: Bad Request
|
|
397
402
|
|
|
398
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
399
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/
|
|
400
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
403
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
404
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
401
405
|
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
402
406
|
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
403
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m
|
|
404
|
-
[33m[2m✓[22m[39m navigates with the search term on blur [33m
|
|
405
|
-
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m
|
|
407
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m 804[2mms[22m[39m
|
|
408
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 359[2mms[22m[39m
|
|
409
|
+
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 358[2mms[22m[39m
|
|
406
410
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 42[2mms[22m[39m
|
|
411
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 56[2mms[22m[39m
|
|
407
412
|
[90mstderr[2m | test/pages/api/graphql.test.ts[2m > [22m[2m/api/graphql error status propagation[2m > [22m[2mpropagates the upstream 400 from a wrapped BadRequestError instead of 500
|
|
408
413
|
[22m[39mGraphql execution returned with error: [
|
|
409
414
|
{
|
|
@@ -450,49 +455,47 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
450
455
|
{ message: [32m'bad'[39m, status: [33m400[39m, type: [32m'BadRequestError'[39m }
|
|
451
456
|
]
|
|
452
457
|
|
|
453
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
454
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
455
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
456
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
457
|
-
|
|
458
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
459
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 59[2mms[22m[39m
|
|
460
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 131[2mms[22m[39m
|
|
461
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 799[2mms[22m[39m
|
|
462
|
+
[33m[2m✓[22m[39m should return a valid merged GraphQL schema [33m 301[2mms[22m[39m
|
|
463
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 71[2mms[22m[39m
|
|
458
464
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
459
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 1015[2mms[22m[39m
|
|
460
|
-
[33m[2m✓[22m[39m should return a valid merged GraphQL schema [33m 342[2mms[22m[39m
|
|
461
|
-
[33m[2m✓[22m[39m should handle options and execute [33m 440[2mms[22m[39m
|
|
462
465
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
463
|
-
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
464
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
465
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
466
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 21[2mms[22m[39m
|
|
466
467
|
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 107[2mms[22m[39m
|
|
467
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
468
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
469
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
470
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
471
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
472
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
473
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
474
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
468
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
469
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
470
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
471
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
472
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
473
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
474
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/hasEnabledRecommendationShelf.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
475
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
476
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
477
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 144[2mms[22m[39m
|
|
475
478
|
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
476
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
477
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
478
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
479
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
479
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
480
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
481
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
482
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
480
483
|
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
481
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
482
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
483
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
484
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
485
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
486
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
487
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
488
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
489
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
490
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
491
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
484
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
485
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 191[2mms[22m[39m
|
|
486
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
487
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
488
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/RecommendationShelf/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
489
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
490
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
491
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 49[2mms[22m[39m
|
|
492
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
493
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
494
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
492
495
|
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
493
496
|
|
|
494
|
-
[2m Test Files [22m [1m[
|
|
495
|
-
[2m Tests [22m [1m[
|
|
496
|
-
[2m Start at [22m
|
|
497
|
-
[2m Duration [22m
|
|
497
|
+
[2m Test Files [22m [1m[32m77 passed[39m[22m[90m (77)[39m
|
|
498
|
+
[2m Tests [22m [1m[32m626 passed[39m[22m[90m (626)[39m
|
|
499
|
+
[2m Start at [22m 14:30:25
|
|
500
|
+
[2m Duration [22m 37.93s[2m (transform 8.83s, setup 0ms, collect 30.97s, tests 11.57s, environment 49.14s, prepare 1.21s)[22m
|
|
498
501
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [4.5.1
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- **core:**
|
|
11
|
-
- **core:**
|
|
12
|
-
- **core:**
|
|
13
|
-
- **core:**
|
|
14
|
-
- **
|
|
6
|
+
## [4.5.1](https://github.com/vtex/faststore/compare/v4.5.1-dev.2...v4.5.1) (2026-08-11)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **core:** address scroll restoration review feedback ([a5fe6a3](https://github.com/vtex/faststore/commit/a5fe6a35c54e6095f81c7995a815ce6ef3b4dd4e))
|
|
11
|
+
- **core:** align beforePopState callback with NextHistoryState ([10719e5](https://github.com/vtex/faststore/commit/10719e5eca199385d9fe18bdd6d7da290716a1d5))
|
|
12
|
+
- **core:** compare window to undefined directly for Sonar ([bf05a54](https://github.com/vtex/faststore/commit/bf05a54bb014d120b7bdc95ff7c01a4e9b35b485))
|
|
13
|
+
- **core:** harden scroll restore path matching and hydration-safe heights ([34efa6b](https://github.com/vtex/faststore/commit/34efa6bda7549895a4531277c2fe55bd6bbe98a7))
|
|
14
|
+
- **core:** hash gallery height keys to avoid truncation collisions ([9e98043](https://github.com/vtex/faststore/commit/9e980438d74e457fa33aa77900438339463a078c))
|
|
15
|
+
- **core:** prevent IS redirect hang and improve scroll restoration ([5f30778](https://github.com/vtex/faststore/commit/5f30778161eec2e4381b3fe971479dd7cbe53b08))
|
|
16
|
+
- **core:** reset infinite scroll on forward listing navigations ([249226a](https://github.com/vtex/faststore/commit/249226a3acbe4cb26d687cf962125b2593d5949e))
|
|
17
|
+
- **core:** resolve Sonar new-code smells for scroll restoration ([59b41ed](https://github.com/vtex/faststore/commit/59b41ed1d2a30ba693726b19895a0279eb1ba464))
|
|
18
|
+
- **core:** restore PLP infinite-scroll pages on back navigation ([92b2efa](https://github.com/vtex/faststore/commit/92b2efa1d4d0895a10b5a0e71a4d9bf37cae1686))
|
|
19
|
+
- **core:** resync gallery height lock when children change ([5058089](https://github.com/vtex/faststore/commit/50580898d97baf800b97c8a876f7967529859c61))
|
|
20
|
+
- **core:** satisfy Sonar on gallery height key hash ([3a6ce47](https://github.com/vtex/faststore/commit/3a6ce47485c26be75d6d76906df3af64c9e34fd6))
|
|
21
|
+
- **core:** type scroll restore paint timer for DOM/Node setTimeout ([940c903](https://github.com/vtex/faststore/commit/940c90376f8d2eb77665e73a6fb0ea53c9786c8e))
|
|
22
|
+
- **core:** use replaceAll for infinite-scroll session key ([4f52048](https://github.com/vtex/faststore/commit/4f520482a9ba9661782fcf25a286b8f2e6c6b922))
|
|
15
23
|
|
|
16
24
|
## [4.5.1-dev.2](https://github.com/vtex/faststore/compare/v4.5.1-dev.1...v4.5.1-dev.2) (2026-08-04)
|
|
17
25
|
|
|
@@ -47,7 +47,7 @@ describe('Home Page Seo', () => {
|
|
|
47
47
|
})
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
it('has OpenGraph
|
|
50
|
+
it('has OpenGraph tags', () => {
|
|
51
51
|
cy.visit(pages.home, options)
|
|
52
52
|
cy.waitForHydration()
|
|
53
53
|
|
|
@@ -68,12 +68,6 @@ describe('Home Page Seo', () => {
|
|
|
68
68
|
.should(($el) => {
|
|
69
69
|
expect($el.attr('content')).to.be.a('string')
|
|
70
70
|
})
|
|
71
|
-
|
|
72
|
-
cy.get('meta[name="twitter:card"]')
|
|
73
|
-
.should('exist')
|
|
74
|
-
.should(($el) => {
|
|
75
|
-
expect($el.attr('content')).to.eq('summary_large_image')
|
|
76
|
-
})
|
|
77
71
|
})
|
|
78
72
|
})
|
|
79
73
|
|
|
@@ -123,7 +117,7 @@ describe('Product Page Seo', () => {
|
|
|
123
117
|
})
|
|
124
118
|
})
|
|
125
119
|
|
|
126
|
-
it('has OpenGraph
|
|
120
|
+
it('has OpenGraph tags', () => {
|
|
127
121
|
cy.visit(pages.pdp, options)
|
|
128
122
|
cy.waitForHydration()
|
|
129
123
|
|
|
@@ -162,12 +156,6 @@ describe('Product Page Seo', () => {
|
|
|
162
156
|
.should(($el) => {
|
|
163
157
|
expect($el.attr('content')).to.be.a('string')
|
|
164
158
|
})
|
|
165
|
-
|
|
166
|
-
cy.get('meta[name="twitter:card"]')
|
|
167
|
-
.should('exist')
|
|
168
|
-
.should(($el) => {
|
|
169
|
-
expect($el.attr('content')).to.eq('summary_large_image')
|
|
170
|
-
})
|
|
171
159
|
})
|
|
172
160
|
})
|
|
173
161
|
|
|
@@ -213,7 +201,7 @@ describe('Collection Page Seo', () => {
|
|
|
213
201
|
})
|
|
214
202
|
})
|
|
215
203
|
|
|
216
|
-
it('has OpenGraph
|
|
204
|
+
it('has OpenGraph tags', () => {
|
|
217
205
|
cy.visit(pages.collection, options)
|
|
218
206
|
cy.waitForHydration()
|
|
219
207
|
|
|
@@ -234,12 +222,6 @@ describe('Collection Page Seo', () => {
|
|
|
234
222
|
.should(($el) => {
|
|
235
223
|
expect($el.attr('content')).to.be.a('string')
|
|
236
224
|
})
|
|
237
|
-
|
|
238
|
-
cy.get('meta[name="twitter:card"]')
|
|
239
|
-
.should('exist')
|
|
240
|
-
.should(($el) => {
|
|
241
|
-
expect($el.attr('content')).to.eq('summary_large_image')
|
|
242
|
-
})
|
|
243
225
|
})
|
|
244
226
|
})
|
|
245
227
|
|
|
@@ -274,7 +256,7 @@ describe('Filtered Collection Page Seo', () => {
|
|
|
274
256
|
})
|
|
275
257
|
})
|
|
276
258
|
|
|
277
|
-
it('has OpenGraph
|
|
259
|
+
it('has OpenGraph tags', () => {
|
|
278
260
|
cy.visit(pages.collection_filtered, options)
|
|
279
261
|
cy.waitForHydration()
|
|
280
262
|
|
|
@@ -295,12 +277,6 @@ describe('Filtered Collection Page Seo', () => {
|
|
|
295
277
|
.should(($el) => {
|
|
296
278
|
expect($el.attr('content')).to.be.a('string')
|
|
297
279
|
})
|
|
298
|
-
|
|
299
|
-
cy.get('meta[name="twitter:card"]')
|
|
300
|
-
.should('exist')
|
|
301
|
-
.should(($el) => {
|
|
302
|
-
expect($el.attr('content')).to.eq('summary_large_image')
|
|
303
|
-
})
|
|
304
280
|
})
|
|
305
281
|
})
|
|
306
282
|
|
|
@@ -319,7 +295,7 @@ describe('Search Page Seo', () => {
|
|
|
319
295
|
cy.get('link[rel="canonical"]').should('not.exist')
|
|
320
296
|
})
|
|
321
297
|
|
|
322
|
-
it('has OpenGraph
|
|
298
|
+
it('has OpenGraph tags', () => {
|
|
323
299
|
cy.visit(pages.search, options)
|
|
324
300
|
cy.waitForHydration()
|
|
325
301
|
|
|
@@ -340,11 +316,5 @@ describe('Search Page Seo', () => {
|
|
|
340
316
|
.should(($el) => {
|
|
341
317
|
expect($el.attr('content')).to.be.a('string')
|
|
342
318
|
})
|
|
343
|
-
|
|
344
|
-
cy.get('meta[name="twitter:card"]')
|
|
345
|
-
.should('exist')
|
|
346
|
-
.should(($el) => {
|
|
347
|
-
expect($el.attr('content')).to.eq('summary_large_image')
|
|
348
|
-
})
|
|
349
319
|
})
|
|
350
320
|
})
|
package/next-seo.config.ts
CHANGED
|
@@ -8,9 +8,6 @@ const config: DefaultSeoProps = {
|
|
|
8
8
|
norobots: storeConfig.experimental.noRobots,
|
|
9
9
|
dangerouslySetAllPagesToNoFollow: storeConfig.experimental.nofollow,
|
|
10
10
|
dangerouslySetAllPagesToNoIndex: storeConfig.experimental.noindex,
|
|
11
|
-
twitter: {
|
|
12
|
-
cardType: 'summary_large_image',
|
|
13
|
-
},
|
|
14
11
|
additionalMetaTags: [
|
|
15
12
|
{
|
|
16
13
|
name: 'generated-at',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "4.5.1
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"style-loader": "^3.3.1",
|
|
72
72
|
"swr": "^2.2.5",
|
|
73
73
|
"use-sync-external-store": "^1.6.0",
|
|
74
|
-
"@faststore/
|
|
75
|
-
"@faststore/
|
|
76
|
-
"@faststore/
|
|
77
|
-
"@faststore/sdk": "4.5.1
|
|
78
|
-
"@faststore/
|
|
74
|
+
"@faststore/lighthouse": "4.5.1",
|
|
75
|
+
"@faststore/ui": "4.5.1",
|
|
76
|
+
"@faststore/diagnostics": "4.5.1",
|
|
77
|
+
"@faststore/sdk": "4.5.1",
|
|
78
|
+
"@faststore/api": "4.5.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@cypress/code-coverage": "^3.12.1",
|
|
@@ -7,16 +7,19 @@ import ProductCardSkeleton from '../ProductCardSkeleton'
|
|
|
7
7
|
interface ProductGridSkeletonProps {
|
|
8
8
|
loading?: boolean
|
|
9
9
|
aspectRatio?: number
|
|
10
|
+
/** How many placeholder cards to render — defaults to the global ITEMS_PER_PAGE. */
|
|
11
|
+
count?: number
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
function ProductGridSkeleton({
|
|
13
15
|
children,
|
|
14
16
|
aspectRatio,
|
|
15
17
|
loading = true,
|
|
18
|
+
count = ITEMS_PER_PAGE,
|
|
16
19
|
}: PropsWithChildren<ProductGridSkeletonProps>) {
|
|
17
20
|
return loading ? (
|
|
18
21
|
<ul data-fs-product-grid>
|
|
19
|
-
{Array.from({ length:
|
|
22
|
+
{Array.from({ length: count }, (_, index) => (
|
|
20
23
|
<li key={String(index)}>
|
|
21
24
|
<ProductCardSkeleton aspectRatio={aspectRatio} bordered />
|
|
22
25
|
</li>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react'
|
|
1
2
|
import { useSearch } from '@faststore/sdk'
|
|
2
3
|
import { useRouter } from 'next/router'
|
|
3
4
|
|
|
@@ -40,6 +41,19 @@ export default function SearchWrapper({
|
|
|
40
41
|
selectedFacets,
|
|
41
42
|
})
|
|
42
43
|
|
|
44
|
+
const redirectUrl = pageProductGalleryData?.redirect?.url
|
|
45
|
+
const lastRedirectedUrl = useRef<string | null>(null)
|
|
46
|
+
|
|
47
|
+
// Intelligent Search redirects must run in an effect — calling router.replace
|
|
48
|
+
// during render re-fires on every state update (e.g. scrollRestoration's
|
|
49
|
+
// resetInfiniteScroll) and loops until the tab hangs.
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!redirectUrl || lastRedirectedUrl.current === redirectUrl) return
|
|
52
|
+
|
|
53
|
+
lastRedirectedUrl.current = redirectUrl
|
|
54
|
+
void router.replace(redirectUrl)
|
|
55
|
+
}, [redirectUrl, router])
|
|
56
|
+
|
|
43
57
|
const emptySearchProps = storeConfig.experimental.enableSearchSSR
|
|
44
58
|
? {
|
|
45
59
|
title: storeConfig.seo.search.bodyH1 ?? 'Showing results for:',
|
|
@@ -58,11 +72,7 @@ export default function SearchWrapper({
|
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
// Redirect when there are registered Intelligent Search redirects on VTEX Admin
|
|
61
|
-
if (
|
|
62
|
-
router.replace(pageProductGalleryData?.redirect?.url, null, {
|
|
63
|
-
shallow: true,
|
|
64
|
-
})
|
|
65
|
-
|
|
75
|
+
if (redirectUrl) {
|
|
66
76
|
return (
|
|
67
77
|
<PageProvider context={{ globalSettings }}>
|
|
68
78
|
<RenderSections globalSections={globalSections}>
|