@faststore/core 4.7.0-dev.2 → 4.7.0-dev.4
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-generate.log +3 -3
- package/.turbo/turbo-test.log +90 -90
- package/CHANGELOG.md +16 -0
- package/cms/faststore/components/cms_component__recommendationshelf.jsonc +1 -7
- package/cms/faststore/schema.json +1 -7
- package/discovery.config.default.js +5 -0
- package/package.json +6 -6
- package/src/Layout.tsx +3 -3
- package/src/components/sections/RecommendationShelf/README.md +25 -15
- package/src/components/sections/RecommendationShelf/RecommendationShelf.tsx +0 -2
- package/src/components/sections/RecommendationShelf/RecommendationShelf.types.ts +0 -7
- package/src/sdk/analytics/hooks/useStartRecommendationSession.ts +18 -13
- package/src/sdk/recommendations/useRecommendationShelf.ts +17 -15
- package/test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx +11 -32
- package/test/sdk/analytics/useStartRecommendationSession.test.ts +27 -58
- package/test/sdk/recommendations/useRecommendationShelf.browser.test.tsx +32 -34
- package/test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx +110 -0
- package/src/sdk/analytics/utils/hasEnabledRecommendationShelf.ts +0 -49
- package/test/sdk/analytics/hasEnabledRecommendationShelf.test.ts +0 -88
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.7.0-dev.
|
|
2
|
+
> @faststore/core@4.7.0-dev.3 generate /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> pnpm run gen-types && pnpm run cache-graphql
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@4.7.0-dev.
|
|
6
|
+
> @faststore/core@4.7.0-dev.3 gen-types /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> node ../cli/bin/run generate-types .
|
|
8
8
|
|
|
9
9
|
[33m[STARTED][39m Parse Configuration
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
[32m[COMPLETED][39m Generate to /home/runner/work/faststore/faststore/packages/core/@generated/
|
|
20
20
|
[32m[COMPLETED][39m Generate outputs
|
|
21
21
|
|
|
22
|
-
> @faststore/core@4.7.0-dev.
|
|
22
|
+
> @faststore/core@4.7.0-dev.3 cache-graphql /home/runner/work/faststore/faststore/packages/core
|
|
23
23
|
> node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
|
|
24
24
|
|
|
25
25
|
[Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.7.0-dev.
|
|
2
|
+
> @faststore/core@4.7.0-dev.3 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/faststore/faststore/packages/core[39m
|
|
7
7
|
|
|
8
|
-
Not implemented: navigation to another Document
|
|
9
|
-
Not implemented: navigation to another Document
|
|
10
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 943[2mms[22m[39m
|
|
11
8
|
Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
12
9
|
npx update-browserslist-db@latest
|
|
13
10
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[33m[2m✓[22m[39m
|
|
18
|
-
|
|
19
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
Not implemented: navigation to another Document
|
|
12
|
+
Not implemented: navigation to another Document
|
|
13
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 3129[2mms[22m[39m
|
|
14
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 876[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m requires selecting a contract before Confirm is enabled, then switches (REQ-03) [33m 533[2mms[22m[39m
|
|
16
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 1002[2mms[22m[39m
|
|
17
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/cards/MyAccountListCards.browser.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[33m 2391[2mms[22m[39m
|
|
18
|
+
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 1007[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m paginates when there are more than 25 cards [33m 358[2mms[22m[39m
|
|
20
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
21
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 162[2mms[22m[39m
|
|
22
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 128[2mms[22m[39m
|
|
22
23
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
23
24
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
|
|
24
25
|
[90m at node:internal/deps/undici/undici:16416:13[39m
|
|
@@ -48,9 +49,7 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
|
48
49
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
49
50
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
50
51
|
|
|
51
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
52
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 223[2mms[22m[39m
|
|
53
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
52
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m7 tests[22m[2m)[22m[32m 255[2mms[22m[39m
|
|
54
53
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mposts the password and redirects to the requested return path
|
|
55
54
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
56
55
|
|
|
@@ -280,11 +279,13 @@ act(() => {
|
|
|
280
279
|
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
|
|
281
280
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
282
281
|
|
|
283
|
-
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
284
|
-
[33m[2m✓[22m[39m renders the password protection form [33m
|
|
285
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
286
|
-
|
|
287
|
-
[33m[2m✓[22m[39m
|
|
282
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 1530[2mms[22m[39m
|
|
283
|
+
[33m[2m✓[22m[39m renders the password protection form [33m 544[2mms[22m[39m
|
|
284
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[33m 1630[2mms[22m[39m
|
|
285
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 917[2mms[22m[39m
|
|
286
|
+
[33m[2m✓[22m[39m opens the contract switcher and returns to the menu on back [33m 372[2mms[22m[39m
|
|
287
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
288
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 56[2mms[22m[39m
|
|
288
289
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
289
290
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
290
291
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -293,10 +294,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
293
294
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
294
295
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
295
296
|
|
|
296
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
297
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
298
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
299
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/
|
|
297
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
298
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 41[2mms[22m[39m
|
|
299
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
300
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 132[2mms[22m[39m
|
|
301
|
+
[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
|
|
300
302
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
301
303
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
302
304
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -305,9 +307,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
305
307
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
306
308
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
307
309
|
|
|
308
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
309
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
310
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[
|
|
310
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
311
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
312
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[33m 301[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 275[2mms[22m[39m
|
|
311
314
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
312
315
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
313
316
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -316,10 +319,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
316
319
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
317
320
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
318
321
|
|
|
319
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 240[2mms[22m[39m
|
|
320
322
|
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
321
323
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
322
324
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
325
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
326
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
323
327
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
324
328
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
325
329
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -328,14 +332,12 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
328
332
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
329
333
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
330
334
|
|
|
331
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
332
|
-
[32m✓[39m [30m[
|
|
333
|
-
[32m✓[39m [30m[
|
|
334
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
335
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
336
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
337
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
338
|
-
[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
|
|
335
|
+
[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
|
|
336
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
337
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
338
|
+
[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
|
|
339
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 151[2mms[22m[39m
|
|
340
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
339
341
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
340
342
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
341
343
|
|
|
@@ -399,18 +401,18 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
399
401
|
at Suspense
|
|
400
402
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
|
|
401
403
|
|
|
402
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
403
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m
|
|
404
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
404
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 74[2mms[22m[39m
|
|
405
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 59[2mms[22m[39m
|
|
406
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
405
407
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mredirects to /pvt/account/403 when the query fails with 401/403
|
|
406
408
|
[22m[39m{ extensions: { status: [33m401[39m } }
|
|
407
409
|
|
|
408
410
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mrenders the error state (no redirect) when the query fails with a non-auth status
|
|
409
411
|
[22m[39m{ extensions: { status: [33m502[39m } }
|
|
410
412
|
|
|
411
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
412
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
413
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
413
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
414
|
+
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
415
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
414
416
|
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[33m 380[2mms[22m[39m
|
|
415
417
|
[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
|
|
416
418
|
[22m[39mGraphql execution returned with error: [
|
|
@@ -504,65 +506,63 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
504
506
|
at file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/@vitest+runner@4.0.18/node_modules/[4m@vitest/runner[24m/dist/index.js:1653:37
|
|
505
507
|
at Traces.$ (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/[4mvitest[24m/dist/chunks/traces.CCmnQaNT.js:142:27)
|
|
506
508
|
|
|
507
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m
|
|
509
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
508
510
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
509
511
|
[22m[39mSet password request failed: Bad Request
|
|
510
512
|
|
|
511
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
512
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m
|
|
513
|
-
[33m[2m✓[22m[39m navigates with the search term on blur [33m
|
|
513
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
514
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m 806[2mms[22m[39m
|
|
515
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 360[2mms[22m[39m
|
|
514
516
|
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 359[2mms[22m[39m
|
|
515
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
516
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
517
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
518
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
519
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m
|
|
520
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
521
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
522
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
523
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
524
|
-
|
|
525
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
526
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
527
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
528
|
-
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
529
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m
|
|
517
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
518
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
519
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
520
|
+
[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
|
|
521
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
522
|
+
[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
|
|
523
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 136[2mms[22m[39m
|
|
524
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 37[2mms[22m[39m
|
|
525
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
526
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 820[2mms[22m[39m
|
|
527
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
528
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 117[2mms[22m[39m
|
|
529
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 57[2mms[22m[39m
|
|
530
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
531
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
532
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
533
|
+
[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
|
|
534
|
+
[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
|
|
530
535
|
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
531
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
532
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
533
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
534
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
535
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
536
|
-
[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
|
|
537
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
538
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 119[2mms[22m[39m
|
|
539
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/hasEnabledRecommendationShelf.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
540
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
536
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
537
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
538
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
539
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 126[2mms[22m[39m
|
|
540
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
541
541
|
[32m✓[39m [30m[43m node [49m[39m test/server/rootSpan.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
542
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
543
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
542
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
543
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
544
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
544
545
|
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 63[2mms[22m[39m
|
|
545
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
546
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
547
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
548
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
549
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
550
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
546
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
547
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
548
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
549
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
550
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
551
551
|
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
552
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
553
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
554
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
552
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 191[2mms[22m[39m
|
|
553
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
555
554
|
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
555
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
556
556
|
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
557
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
557
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
558
558
|
[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
|
|
559
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
560
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
561
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
562
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
559
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
560
|
+
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
561
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
562
|
+
[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
|
|
563
563
|
|
|
564
564
|
[2m Test Files [22m [1m[32m87 passed[39m[22m[90m (87)[39m
|
|
565
|
-
[2m Tests [22m [1m[
|
|
566
|
-
[2m Start at [22m
|
|
567
|
-
[2m Duration [22m
|
|
565
|
+
[2m Tests [22m [1m[32m695 passed[39m[22m[90m (695)[39m
|
|
566
|
+
[2m Start at [22m 21:11:21
|
|
567
|
+
[2m Duration [22m 43.29s[2m (transform 10.74s, setup 0ms, import 37.56s, tests 15.12s, environment 54.08s)[22m
|
|
568
568
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.7.0-dev.4](https://github.com/vtex/faststore/compare/v4.7.0-dev.3...v4.7.0-dev.4) (2026-08-25)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **core:** address Sonar and session fallback timing ([c0ad09f](https://github.com/vtex/faststore/commit/c0ad09f4903627ce39b233013af40ab2505b5871))
|
|
11
|
+
- **core:** make session enable flag assignment Sonar-clear ([2fdfe96](https://github.com/vtex/faststore/commit/2fdfe96d6dccb22c33fb9f7f250f5531ef6f6f47))
|
|
12
|
+
- **core:** start shelf session fallback in parallel with userId lookup ([6f5afa5](https://github.com/vtex/faststore/commit/6f5afa587a554ab9a4289c01aa6c6eb57e027680))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **core:** gate recommendation session by feature flag with shelf fallback ([901b345](https://github.com/vtex/faststore/commit/901b3456943de25f028d6443f5f62b9de1db6ad3))
|
|
17
|
+
|
|
18
|
+
# [4.7.0-dev.3](https://github.com/vtex/faststore/compare/v4.7.0-dev.2...v4.7.0-dev.3) (2026-08-25)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @faststore/core
|
|
21
|
+
|
|
6
22
|
# [4.7.0-dev.2](https://github.com/vtex/faststore/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2026-08-24)
|
|
7
23
|
|
|
8
24
|
### Bug Fixes
|
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
"$componentKey": "RecommendationShelf",
|
|
4
4
|
"$componentTitle": "Recommendation Shelf",
|
|
5
5
|
"title": "Recommendation Shelf",
|
|
6
|
-
"description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.
|
|
6
|
+
"description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"required": ["campaignVrn"],
|
|
9
9
|
"properties": {
|
|
10
|
-
"enableRecommendations": {
|
|
11
|
-
"title": "Enable recommendations?",
|
|
12
|
-
"description": "When enabled, starts the VTEX Recommendations personalization session (once per browser session) and fetches personalized products for this shelf. Off by default so stores that do not use Recommendations never hit the Recommendations API.",
|
|
13
|
-
"type": "boolean",
|
|
14
|
-
"default": false
|
|
15
|
-
},
|
|
16
10
|
"title": {
|
|
17
11
|
"title": "Title",
|
|
18
12
|
"description": "Override the shelf title. If not set, the campaign title will be used.",
|
|
@@ -3872,16 +3872,10 @@
|
|
|
3872
3872
|
"$componentKey": "RecommendationShelf",
|
|
3873
3873
|
"$componentTitle": "Recommendation Shelf",
|
|
3874
3874
|
"title": "Recommendation Shelf",
|
|
3875
|
-
"description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.
|
|
3875
|
+
"description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.",
|
|
3876
3876
|
"type": "object",
|
|
3877
3877
|
"required": ["campaignVrn"],
|
|
3878
3878
|
"properties": {
|
|
3879
|
-
"enableRecommendations": {
|
|
3880
|
-
"title": "Enable recommendations?",
|
|
3881
|
-
"description": "When enabled, starts the VTEX Recommendations personalization session (once per browser session) and fetches personalized products for this shelf. Off by default so stores that do not use Recommendations never hit the Recommendations API.",
|
|
3882
|
-
"type": "boolean",
|
|
3883
|
-
"default": false
|
|
3884
|
-
},
|
|
3885
3879
|
"title": {
|
|
3886
3880
|
"title": "Title",
|
|
3887
3881
|
"description": "Override the shelf title. If not set, the campaign title will be used.",
|
|
@@ -202,6 +202,11 @@ module.exports = {
|
|
|
202
202
|
},
|
|
203
203
|
refreshToken: false,
|
|
204
204
|
scrollRestoration: false,
|
|
205
|
+
// Opt-in flag for VTEX Recommendations. When enabled, Layout starts the
|
|
206
|
+
// personalization session on every page. When disabled (default), the
|
|
207
|
+
// session starts only as a RecommendationShelf fallback when userId is
|
|
208
|
+
// missing.
|
|
209
|
+
enableRecommendations: false,
|
|
205
210
|
/** Package names to transpile (e.g. ['@vtex/components']). Use a non-empty list to enable Next.js transpilation. */
|
|
206
211
|
transpilePackages: [],
|
|
207
212
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "4.7.0-dev.
|
|
3
|
+
"version": "4.7.0-dev.4",
|
|
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/
|
|
78
|
-
"@faststore/ui": "4.7.0-dev.
|
|
74
|
+
"@faststore/diagnostics": "4.7.0-dev.4",
|
|
75
|
+
"@faststore/lighthouse": "4.7.0-dev.4",
|
|
76
|
+
"@faststore/sdk": "4.7.0-dev.4",
|
|
77
|
+
"@faststore/api": "4.7.0-dev.4",
|
|
78
|
+
"@faststore/ui": "4.7.0-dev.4"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@cypress/code-coverage": "^3.12.1",
|
package/src/Layout.tsx
CHANGED
|
@@ -7,9 +7,9 @@ function Layout({ children }: PropsWithChildren) {
|
|
|
7
7
|
const props = isValidElement(children) ? children.props : undefined
|
|
8
8
|
usePageViewEvent(props)
|
|
9
9
|
|
|
10
|
-
// Starts the personalization session once per browser session
|
|
11
|
-
//
|
|
12
|
-
useStartRecommendationSession(
|
|
10
|
+
// Starts the personalization session once per browser session on every page
|
|
11
|
+
// when `experimental.enableRecommendations` is true.
|
|
12
|
+
useStartRecommendationSession()
|
|
13
13
|
|
|
14
14
|
return <>{children}</>
|
|
15
15
|
}
|
|
@@ -4,7 +4,7 @@ CMS section that renders a carousel of personalized product recommendations from
|
|
|
4
4
|
|
|
5
5
|
- **Data source:** VTEX Recommendations BFF, exposed by `@faststore/api` through the `recommendations` GraphQL query.
|
|
6
6
|
- **Registration:** global CMS component (`$componentKey: "RecommendationShelf"`), available on any page via CMS.
|
|
7
|
-
- **
|
|
7
|
+
- **Session opt-in:** personalization session starts via the `experimental.enableRecommendations` discovery feature flag (Layout, every page). When the flag is off, any mounted Recommendation Shelf starts the session as a fallback if `userId` is missing.
|
|
8
8
|
|
|
9
9
|
## Contents
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ CMS section that renders a carousel of personalized product recommendations from
|
|
|
22
22
|
|
|
23
23
|
The shelf renders products only when the following conditions are met:
|
|
24
24
|
|
|
25
|
-
1. **
|
|
25
|
+
1. **Personalization session.** Prefer enabling `experimental.enableRecommendations` in `discovery.config` so `Layout` starts the session on every page. If the flag is off, any mounted Recommendation Shelf starts the session as a fallback when `userId` is missing (cookie + in-memory lock still limit this to one attempt per browser session).
|
|
26
26
|
|
|
27
27
|
2. **Active VTEX Recommendations campaign.** Provide a valid campaign **VRN**. Example: `vrn:recommendations:my-account:rec-persona-v2:abc123`.
|
|
28
28
|
|
|
@@ -32,7 +32,19 @@ The shelf renders products only when the following conditions are met:
|
|
|
32
32
|
|
|
33
33
|
## Setup
|
|
34
34
|
|
|
35
|
-
### 1.
|
|
35
|
+
### 1. Opt into the personalization session (recommended)
|
|
36
|
+
|
|
37
|
+
In the store's `discovery.config.js` (or local override), set:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
experimental: {
|
|
41
|
+
enableRecommendations: true,
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Default is `false`. With the flag on, `Layout` calls `startRecommendationSession` on every page without inspecting CMS data. With the flag off, placing a Recommendation Shelf on a page still starts the session when `userId` is missing.
|
|
46
|
+
|
|
47
|
+
### 2. Obtain the campaign VRN
|
|
36
48
|
|
|
37
49
|
In the VTEX Recommendations admin, create or select a campaign and copy its **VRN**. The expected format is:
|
|
38
50
|
|
|
@@ -42,9 +54,9 @@ vrn:recommendations:<account>:<campaign-type>:<campaign-id>
|
|
|
42
54
|
|
|
43
55
|
Supported `<campaign-type>` values are listed under [Campaign types (VRN) and context](#campaign-types-vrn-and-context).
|
|
44
56
|
|
|
45
|
-
###
|
|
57
|
+
### 3. Add Recommendation Shelf via CMS
|
|
46
58
|
|
|
47
|
-
Add **Recommendation Shelf** to the target page (home, PDP, PLP, cart, and so on)
|
|
59
|
+
Add **Recommendation Shelf** to the target page (home, PDP, PLP, cart, and so on) and configure at least **Campaign VRN** (required).
|
|
48
60
|
|
|
49
61
|
## CMS configuration
|
|
50
62
|
|
|
@@ -52,7 +64,6 @@ Schema: `cms/faststore/components/cms_component__recommendationshelf.jsonc`.
|
|
|
52
64
|
|
|
53
65
|
| CMS property | Key | Type | Required | Default | Description |
|
|
54
66
|
| --- | --- | --- | --- | --- | --- |
|
|
55
|
-
| Enable recommendations? | `enableRecommendations` | boolean | No | `false` | Opt-in that starts the personalization session (via Layout) and allows this shelf to fetch recommendations. |
|
|
56
67
|
| Title | `title` | string | No | — | Overrides the shelf title. Falls back to the campaign title. If both are empty, the heading is not rendered. |
|
|
57
68
|
| Campaign VRN | `campaignVrn` | string | **Yes** | — | Recommendation campaign VRN. Validated by regex (see campaign types below). |
|
|
58
69
|
| Items context | `itemsContext` | `PDP` \| `CART` | No | `PDP` | Source of products used as request context. Applies only to context-based campaigns. |
|
|
@@ -92,9 +103,9 @@ Context-based campaigns (cross-sell, similar items, visual similarity, next inte
|
|
|
92
103
|
|
|
93
104
|
All recommendation work runs client-side after hydration:
|
|
94
105
|
|
|
95
|
-
1. **Session start (
|
|
106
|
+
1. **Session start (feature flag + shelf fallback)** — `Layout` calls `useStartRecommendationSession()` once. The hook starts the session when `experimental.enableRecommendations` is `true` (no CMS lookup). When the flag is `false`, `useRecommendationShelf()` (used by every RecommendationShelf) calls the same hook as a fallback while `userId` is missing (`undefined` or `null`), in parallel with cookie retry. Cookie (`vtex-rec-user-start-session`) + in-memory lock ensure at most one attempt per browser session. If `userId` is already available, the shelf does not start the session.
|
|
96
107
|
2. **User id resolution** — `useRecommendationUserId()` reads the `vtex-rec-user-id` cookie, retrying until a value is available or the retry budget is exhausted.
|
|
97
|
-
3. **Request arguments** —
|
|
108
|
+
3. **Request arguments** — `getRecommendationArguments()` builds `{ userId, campaignVrn, products }` or returns `null` when the VRN is invalid, the user id is missing, or a context-based campaign has no context products.
|
|
98
109
|
4. **Fetch** — `useRecommendations()` runs `ClientRecommendationsQuery` and returns `products`, `correlationId`, and `campaign`.
|
|
99
110
|
5. **Render** — shows `ProductShelfSkeleton` while loading; returns `null` on error or empty results; otherwise renders the carousel and optional heading.
|
|
100
111
|
6. **Tracking** — when correlation and campaign identifiers are present, the shelf emits `data-af-*` attributes for Activity Flow. PDP product views use `product:*` meta tags from `pages/[slug]/p.tsx`.
|
|
@@ -107,6 +118,7 @@ Related files:
|
|
|
107
118
|
- Shelf: `src/components/sections/RecommendationShelf/`
|
|
108
119
|
- Hook: `src/sdk/analytics/hooks/useStartRecommendationSession.ts`
|
|
109
120
|
- Layout: `src/Layout.tsx`
|
|
121
|
+
- Flag: `discovery.config.default.js` → `experimental.enableRecommendations`
|
|
110
122
|
|
|
111
123
|
## Code-level overrides
|
|
112
124
|
|
|
@@ -116,7 +128,6 @@ In addition to CMS props, the component accepts code-level overrides (not expose
|
|
|
116
128
|
import { RecommendationShelf } from 'src/components/sections/RecommendationShelf'
|
|
117
129
|
|
|
118
130
|
<RecommendationShelf
|
|
119
|
-
enableRecommendations
|
|
120
131
|
campaignVrn="vrn:recommendations:my-account:rec-cross-v2:abc123"
|
|
121
132
|
itemsContext="PDP"
|
|
122
133
|
ProductCard={MyCustomCard}
|
|
@@ -143,7 +154,7 @@ As a global component, the shelf can be placed on any CMS page. Suggested placem
|
|
|
143
154
|
- **Cart:** cross-sell with `itemsContext: CART`.
|
|
144
155
|
- **PLP:** context-agnostic campaigns.
|
|
145
156
|
|
|
146
|
-
|
|
157
|
+
Prefer enabling `experimental.enableRecommendations` so the session is ready on every page. Stores without the flag and without a Recommendation Shelf never call `startRecommendationSession`.
|
|
147
158
|
|
|
148
159
|
## Privacy and cache
|
|
149
160
|
|
|
@@ -155,11 +166,10 @@ The personalization session runs only when at least one shelf has **Enable recom
|
|
|
155
166
|
|
|
156
167
|
**The shelf does not render.** Check, in order:
|
|
157
168
|
|
|
158
|
-
1. Is
|
|
159
|
-
2. Is `
|
|
160
|
-
3.
|
|
161
|
-
4.
|
|
162
|
-
5. Did the campaign return products? An empty response renders nothing by design.
|
|
169
|
+
1. Is `campaignVrn` valid and is the campaign active?
|
|
170
|
+
2. Is the `vtex-rec-user-id` cookie available? Without a user id, the shelf does not fetch. With the discovery flag off, confirm the shelf fallback started the session (`vtex-rec-user-start-session`).
|
|
171
|
+
3. For context-based campaigns, is product context available (`PDP` on a product page, or a non-empty cart for `CART`)?
|
|
172
|
+
4. Did the campaign return products? An empty response renders nothing by design.
|
|
163
173
|
|
|
164
174
|
**Skeleton never resolves.** Inspect the console and the GraphQL `recommendations` response for pending or failing requests.
|
|
165
175
|
|
|
@@ -21,7 +21,6 @@ export function RecommendationShelf<
|
|
|
21
21
|
>({
|
|
22
22
|
title,
|
|
23
23
|
campaignVrn,
|
|
24
|
-
enableRecommendations = false,
|
|
25
24
|
itemsContext = 'PDP',
|
|
26
25
|
ProductCard,
|
|
27
26
|
mapProductToProductCard,
|
|
@@ -56,7 +55,6 @@ export function RecommendationShelf<
|
|
|
56
55
|
const { items, isLoading, error, campaign, correlationId } =
|
|
57
56
|
useRecommendationShelf({
|
|
58
57
|
campaignVrn,
|
|
59
|
-
enableRecommendations,
|
|
60
58
|
itemsContext,
|
|
61
59
|
})
|
|
62
60
|
|
|
@@ -25,13 +25,6 @@ export type RecommendationShelfProps<
|
|
|
25
25
|
> = {
|
|
26
26
|
readonly title?: string
|
|
27
27
|
readonly campaignVrn: string
|
|
28
|
-
/**
|
|
29
|
-
* Opt-in for VTEX Recommendations on this shelf. When `true`, Layout starts
|
|
30
|
-
* the personalization session (`useStartRecommendationSession`) and this
|
|
31
|
-
* shelf fetches recommendations. When `false` (default), neither happens.
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
readonly enableRecommendations?: boolean
|
|
35
28
|
/**
|
|
36
29
|
* Where to read the products used as context for the recommendation request:
|
|
37
30
|
* - `'PDP'`: the current product detail page product.
|