-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
scripts/dropins.js
Outdated
|
||
export default async function initializeDropins() { | ||
// Set Commerce Mesh endpoint | ||
mesh.setEndpoint(await getConfigValue('commerce-core-endpoint')); |
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.
Calling the import mesh
can be confusing - as it's unrelated to actual API Mesh.
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.
Fixed
scripts/dropins.js
Outdated
initializers.register(product.initialize, {}); | ||
initializers.register(cart.initialize, {}); | ||
initializers.register(checkout.initialize, {}); | ||
initializers.register(orderConfirmation.initialize, {}); |
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.
Is this going to initialize all DropIns on all routes? I wouldn't expect PDP to be initialized on checkout, for example.
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.
@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.
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.
Fixed
}); | ||
|
||
checkoutRenderer.render(Checkout, { | ||
return provider.render(Checkout, { |
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.
Is this meant to be standard practice for all drop-in rendering?
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.
Yes, if it has getInitialData
it will wait for it to be resolved before rendering the page. If not, it will just render :)
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.
Tested locally with aem up
and looks good.
Description
Initializes DropIns
Pending
Test URLs