Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 211 forks source link

Unused adyenComponent causes LCP score to be higher on checkout #2194

Closed maurizio-kitroyale closed 1 year ago

maurizio-kitroyale commented 1 year ago

Describe the bug Largest Contentful Paint (LCP) is higher on checkout because Adyen_Payment/js/adyen.min.js is loaded but unused

To Reproduce Steps to reproduce the behavior:

  1. Add a product to basket
  2. Navigate to checkout
  3. Audit the checkout pages using a tool such as Lighthouse
  4. Notice the unused Adyen JS is flagged as an issue

Expected behavior Web Core Vitals passed

Magento version Any

Plugin version At least from version 7.0.0, but it could be happening in earlier versions too

Additional context In adyen-payment-service.js Adyen_Payment/js/adyen is imported as adyenComponent but never used, removing the dependency seems to resolve the issue without affecting the integration.

candemiralp commented 1 year ago

Hello @maurizio-kitroyale,

Thanks for raising this issue. However, there is no issue actually. The file you are referring to is Adyen Web Components library. That library instantiates all of the payment method components on the checkout. This JS file is really important for the plugin and actively being used while mounting any payment method to the checkout page, validating user data and creating encrypted payment state data.

Best Regards, Can