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

feat(headless): refresh commerce recommendations server-side #4617

Merged
merged 40 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
187fc0b
recs server-side working
y-lakhdar Oct 31, 2024
d571439
recognize search action promises
y-lakhdar Nov 1, 2024
4dc2717
add typeguard
y-lakhdar Nov 1, 2024
2e5f794
prevent multiple recommendations with the same slot
y-lakhdar Nov 1, 2024
de43049
clean
y-lakhdar Nov 3, 2024
9254b93
draft
y-lakhdar Nov 14, 2024
f2d1fa1
working draft
y-lakhdar Nov 15, 2024
bc63a92
test
y-lakhdar Nov 15, 2024
8d170d2
Merge branch 'master' of github.com:coveo/ui-kit into ssr-recs
y-lakhdar Nov 15, 2024
e60bfe5
update sample
y-lakhdar Nov 15, 2024
be888c8
recommendation hydration working
y-lakhdar Nov 15, 2024
c4ff2b9
clean build function
y-lakhdar Nov 15, 2024
2783740
clean exports
y-lakhdar Nov 15, 2024
8a6f9d8
filter invalid and duplicate recommendations
y-lakhdar Nov 16, 2024
025b34f
refacto
y-lakhdar Nov 16, 2024
07d1ec8
simplify build factory
y-lakhdar Nov 17, 2024
9b049fd
adjust factory params and throw error on bad engine definition
y-lakhdar Nov 17, 2024
84e5c53
do not ask props for disabled controllers
y-lakhdar Nov 17, 2024
018c0be
remove comments
y-lakhdar Nov 17, 2024
a7200d8
update warning message
y-lakhdar Nov 17, 2024
785951f
fix export
y-lakhdar Nov 17, 2024
f342da5
clean PR
y-lakhdar Nov 18, 2024
677fd45
clean controller build condition
y-lakhdar Nov 18, 2024
87d0792
create commerce build result type
y-lakhdar Nov 18, 2024
16c2b5e
remove unnecessary error
y-lakhdar Nov 18, 2024
dbffb51
revert EngineDefinitionControllersPropsOption
y-lakhdar Nov 18, 2024
961c28e
update UT
y-lakhdar Nov 18, 2024
c58b3ae
Add recs to sample
alexprudhomme Nov 18, 2024
81ba114
Merge branch 'master' into ssr-recs
alexprudhomme Nov 18, 2024
b8e6e16
no core engine
alexprudhomme Nov 18, 2024
3f93d51
add todo
alexprudhomme Nov 18, 2024
93b3967
Merge branch 'master' into ssr-recs
alexprudhomme Nov 22, 2024
a73f175
fix build
alexprudhomme Nov 22, 2024
feb0b81
docs(headless): navigator context annotations (#4712)
jpmarceau Nov 25, 2024
1959079
extract product-button-with-image
alexprudhomme Nov 26, 2024
41cb3aa
Update packages/headless/src/app/commerce-ssr-engine/factories/build-…
alexprudhomme Nov 26, 2024
0cbd535
simpler unavailableInSolutionType
alexprudhomme Nov 26, 2024
7674f10
Merge branch 'master' into ssr-recs
alexprudhomme Nov 26, 2024
9eeba4a
cleaner filter
alexprudhomme Nov 26, 2024
c34adf1
fix tests
alexprudhomme Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Headless react SSR utils', () => {
listingEngineDefinition,
searchEngineDefinition,
standaloneEngineDefinition,
recommendationEngineDefinition,
...rest
} = defineCommerceEngine({configuration: sampleConfig});
const {
Expand Down
11 changes: 11 additions & 0 deletions packages/headless-react/src/ssr-commerce/commerce-engine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ export function defineCommerceEngine<
>;
type ListingContext = ContextStateType<SolutionType.listing>;
type SearchContext = ContextStateType<SolutionType.search>;
type RecommendationContext = ContextStateType<SolutionType.recommendation>;
type StandaloneContext = ContextStateType<SolutionType.standalone>;

const {
listingEngineDefinition,
searchEngineDefinition,
standaloneEngineDefinition,
recommendationEngineDefinition,
} = defineBaseCommerceEngine({...options});
return {
useEngine: buildEngineHook(singletonContext),
Expand Down Expand Up @@ -84,5 +86,14 @@ export function defineCommerceEngine<
singletonContext as StandaloneContext
),
},
recommendationEngineDefinition: {
...recommendationEngineDefinition,
StaticStateProvider: buildStaticStateProvider(
singletonContext as RecommendationContext
),
HydratedStateProvider: buildHydratedStateProvider(
singletonContext as RecommendationContext
),
},
};
}
Loading
Loading