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

docs(headless commerce SSR): basics for commerce SSR + Remix sample #4708

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

fbeaudoincoveo
Copy link
Contributor

Copy link

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 241.4 241.4 0
commerce 346 346 0
search 413 413 0
insight 403.8 403.8 0
recommendation 253.6 253.6 0
ssr 406.5 406.5 0
ssr-commerce 361.1 361.1 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

uniqueId: productId,
} = catalogItem;

const viewed = useRef(false);
Copy link
Contributor Author

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

navigatorContext={navigatorContext}
>
<h2>
{params.listingId
Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,36 @@
export type ExternalCatalogItem = {
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@louis-bompart louis-bompart left a 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/root.tsx Outdated Show resolved Hide resolved
navigatorContext={navigatorContext}
>
<h2>
{params.listingId
Copy link
Collaborator

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/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@alexprudhomme alexprudhomme left a 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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "headless-commerce-ssr-remix",
"name": "@coveo/headless-commerce-ssr-remix",

standaloneSearchBox: defineStandaloneSearchBox({
options: {redirectionUrl: '/search'},
}),
instantProducts: defineInstantProducts({options: {}}),
Copy link
Contributor

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 = {
Copy link
Contributor

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.

@@ -0,0 +1,17 @@
{
Copy link
Contributor

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

Base automatically changed from ssr-recs to master November 26, 2024 20:15
@github-actions github-actions bot requested a review from a team as a code owner November 26, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants