-
Notifications
You must be signed in to change notification settings - Fork 34
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
docs(headless commerce SSR): basics for commerce SSR + Remix sample #4708
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
packages/samples/headless-commerce-ssr-remix/app/components/add-to-cart-button.tsx
Show resolved
Hide resolved
uniqueId: productId, | ||
} = catalogItem; | ||
|
||
const viewed = useRef(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To log the view event only once
packages/samples/headless-commerce-ssr-remix/app/entry.server.tsx
Outdated
Show resolved
Hide resolved
navigatorContext={navigatorContext} | ||
> | ||
<h2> | ||
{params.listingId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: I find it kind of annoying that there's no way to set a display name for PLPs in the CMH. It feels silly to have to do something like that to set the page title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in CMH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @Spuffynism
@@ -0,0 +1,36 @@ | |||
export type ExternalCatalogItem = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of this "API" is completely silly, but the idea is to show clearly that the main product information shown on a PDP should typically come from some external service, not from a Coveo query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in the current next sample and I don't think it is necessary imo. This is different from the cart since it has 0 relation to coveo except for it to potentially use the same productId. I think we should remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep it but can we add some comments ? Similar to here ?
https://github.com/coveo/ui-kit/blob/master/packages/samples/headless-ssr-commerce/actions/external-cart-api.ts
packages/samples/headless-commerce-ssr-remix/client/external-context-api.ts
Show resolved
Hide resolved
packages/samples/headless-commerce-ssr-remix/app/entry.server.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some nitpik
packages/samples/headless-commerce-ssr-remix/app/entry.server.tsx
Outdated
Show resolved
Hide resolved
packages/samples/headless-commerce-ssr-remix/app/routes/listings.$listingId.tsx
Show resolved
Hide resolved
navigatorContext={navigatorContext} | ||
> | ||
<h2> | ||
{params.listingId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in CMH?
packages/samples/headless-commerce-ssr-remix/app/routes/listings.$listingId.tsx
Outdated
Show resolved
Hide resolved
packages/samples/headless-commerce-ssr-remix/app/entry.client.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am bringing a lot of changes to the next sample in my PRs so we need to keep this mind and make sure they are perfectly aligned
#4709
@@ -0,0 +1,34 @@ | |||
{ | |||
"name": "headless-commerce-ssr-remix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name": "headless-commerce-ssr-remix", | |
"name": "@coveo/headless-commerce-ssr-remix", |
standaloneSearchBox: defineStandaloneSearchBox({ | ||
options: {redirectionUrl: '/search'}, | ||
}), | ||
instantProducts: defineInstantProducts({options: {}}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the props here once this gets merged. It was a mistake in the implementation. props for instantProducts should not be mandatary.
#4700
@@ -0,0 +1,36 @@ | |||
export type ExternalCatalogItem = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in the current next sample and I don't think it is necessary imo. This is different from the cart since it has 0 relation to coveo except for it to potentially use the same productId. I think we should remove this.
packages/samples/headless-commerce-ssr-remix/app/routes/listings.$listingId.tsx
Show resolved
Hide resolved
@@ -0,0 +1,17 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt this supposed to be "project.json" ? and not "projects.json". Not sure if it matters
https://coveord.atlassian.net/browse/KIT-3704