Fixing INP performance with x-defer alpine.js plugin

Solve INP Core Web Vitals scores with x-defer

The update of Core Web Vitals that introduced Interaction to Next Paint was a harmful one for Alpine.js users that have many Alpine Components on a page that require heavy computations. We solved this with a new deferring mechanism that delays the initialization of Alpine components on a page. Introducing x-defer, a new plugin introduced in Hyvä Theme 1.3.7.

Read the documentation here: Hyvä Docs: The Alpine.js x-defer plugin

Drop-in snippet to use on any Alpine.js enabled site:

Customize the selectors in deferSelectors to your needs, and the snippet below is ready to go. You can even paste it into a CMS on a live site.

Share

Related Posts

Get Hyvä for your store

Build your ideal setup in just a few clicks, on your terms.

Step of 2 Your store Your setup

This domain will be linked to your Hyvä licenses.

Please enter a valid domain (e.g. mystore.com)

Recommended
Hyvä Commerce

Everything you need to build your store, your way.

Hyvä Commerce €3,000/year
Hyvä Theme, Checkout and UI in one complete setup
Fast and flexible content management with Hyvä CMS
Improved admin experience, built for speed and ease
Tools for performance, scalability and control
Upgrade to Hyvä Enterprise for full Adobe Commerce support (includes Hyvä Commerce) /year
Learn more
Hyvä Commerce Recommended
Build your own
Build your own
Hyvä Theme
Hyvä Theme Included with all Hyvä products.
Free
Hyvä UI
Hyvä UI

Copy. Paste. Done. Enhance your design and coding workflow with a library of modern, reusable components that make building beautiful, consistent pages effortless.

€250
Hyvä Checkout
Hyvä Checkout

Faster checkout. Happier customers. Reduce friction and boost conversions with a lightning-fast, fully customisable checkout that's easy to integrate.

€1,000
Choose your Update & Support plan
Hyvä Enterprise
Hyvä Enterprise

Full Adobe Commerce support, including Hyvä Commerce. Unlock Adobe Sensei capabilities, content staging, B2B functionality, loyalty features and more.

€7,500/year
Choose your Update & Support plan
Total: