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

Drop-ins Initialization #31

Merged
merged 16 commits into from
Jan 26, 2024
Merged

Drop-ins Initialization #31

merged 16 commits into from
Jan 26, 2024

Conversation

Copy link

aem-code-sync bot commented Jan 26, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 17:46 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 17:50 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 17:53 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 17:54 Inactive
@fnhipster fnhipster changed the title Vendors Drop-ins Initialization Jan 26, 2024
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 18:04 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 18:05 Inactive
@hlxsites hlxsites deleted a comment from aem-code-sync bot Jan 26, 2024
Copy link

aem-code-sync bot commented Jan 26, 2024

@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 18:29 Inactive

export default async function initializeDropins() {
// Set Commerce Mesh endpoint
mesh.setEndpoint(await getConfigValue('commerce-core-endpoint'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Calling the import mesh can be confusing - as it's unrelated to actual API Mesh.

Copy link
Collaborator Author

@fnhipster fnhipster Jan 26, 2024

Choose a reason for hiding this comment

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

Fixed

Comment on lines 20 to 23
initializers.register(product.initialize, {});
initializers.register(cart.initialize, {});
initializers.register(checkout.initialize, {});
initializers.register(orderConfirmation.initialize, {});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this going to initialize all DropIns on all routes? I wouldn't expect PDP to be initialized on checkout, for example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sirugh I've been bouncing back and forth with that. You are right, Maybe This is where you can initialize a global drop-in like Auth and Cart but the rest is initialized in their block.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 18:47 Inactive
});

checkoutRenderer.render(Checkout, {
return provider.render(Checkout, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this meant to be standard practice for all drop-in rendering?

Copy link
Collaborator Author

@fnhipster fnhipster Jan 26, 2024

Choose a reason for hiding this comment

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

Yes, if it has getInitialData it will wait for it to be resolved before rendering the page. If not, it will just render :)

@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 18:49 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 19:16 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 19:23 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 19:26 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 19:33 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to dropins-initialization January 26, 2024 19:33 Inactive
@fnhipster fnhipster merged commit 10e6da0 into checkout-dropin Jan 26, 2024
2 checks passed
Copy link
Collaborator

@sirugh sirugh left a comment

Choose a reason for hiding this comment

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

Tested locally with aem up and looks good.

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.

2 participants