Livewire 4.x now ships Alpine.js v3.17.4
Contributed by calebporzio
Part of the livewire v4.4.7 release
Livewire's 4.x branch now ships with Alpine.js v3.17.4 across the board. Pull request #10731 bumps the alpinejs core package and all ten bundled @alpinejs/* plugins from ^3.17.3 to ^3.17.4, and refreshes package-lock.json against the published npm registry artifacts. No Livewire source code was touched — this is a pure dependency chore — but it is the kind of chore that matters: every Livewire component you render is powered by the Alpine build bundled inside livewire.js, so keeping that dependency current is how upstream Alpine fixes reach your app. The change is fully verified: npm ci, the production build, and the JavaScript test suite all pass, with 110 tests passing and one skipped.
What changed in #10731
The diff is small and mechanical. In package.json, the eleven Alpine-related constraints each moved up one patch level:
- "alpinejs": "^3.17.3",
+ "alpinejs": "^3.17.4",
The same bump applies to all ten official plugins: @alpinejs/anchor, @alpinejs/collapse, @alpinejs/csp, @alpinejs/focus, @alpinejs/intersect, @alpinejs/mask, @alpinejs/morph, @alpinejs/persist, @alpinejs/resize, and @alpinejs/sort.
In package-lock.json, all eleven entries were re-resolved to v3.17.4, each now pointing at the official registry.npmjs.org tarball URL with a fresh SHA-512 integrity hash. The pull request description confirms every lock entry was verified against the published artifacts — a small hygiene detail that guarantees deterministic installs for contributors and CI.
Why the bundled Alpine version matters
Livewire deliberately pins and bundles its own copy of Alpine plus the official plugins. That is why directives like x-intersect, x-sort, x-collapse, and x-anchor work out of the box in any Livewire component, and why Livewire can coordinate its morphing behavior with Alpine's rendering. When you load Livewire's script, you are loading a specific, tested combination of Livewire + Alpine + plugins.
Bumping to 3.17.4 means the bundle picks up whatever upstream fixes the Alpine 3.17.4 patch release contains. Since 3.17.4 is a patch release over 3.17.3, no breaking changes or API shifts are expected — check the Alpine.js changelog for the specific fixes included.
Upgrade impact for most apps: nothing to do
If your layout loads Livewire the standard way — via @livewireScripts or Livewire's automatic script injection — this change reaches you through Composer alone:
composer update livewire/livewire
After upgrading from v3.8.10 to the 4.x release containing this PR, every page will serve Alpine 3.17.4 inside the bundle. There are no PHP, Blade, or JavaScript changes to make, and no configuration to touch. You can confirm what you are running from the browser console on any page with Livewire components:
Alpine.version // "3.17.4"
Upgrade impact if you bundle Alpine yourself
Some teams import Alpine from npm — for example, to register custom directives or plugins in their own Vite or webpack build — while still loading Livewire. If that is your setup, align your own constraints with Livewire's to avoid two different Alpine patch versions in one app. In your package.json:
"dependencies": {
"alpinejs": "^3.17.4",
"@alpinejs/persist": "^3.17.4",
"@alpinejs/intersect": "^3.17.4"
}
And the usual caution still applies: load Alpine exactly once. If you import and start Alpine yourself, make sure your layout loads your bundle rather than also injecting Livewire's bundled copy, otherwise directives can register twice and handlers can fire in unexpected ways. The ideal setup looks like this:
import Alpine from 'alpinejs'
import persist from '@alpinejs/persist'
window.Alpine = Alpine
Alpine.plugin(persist)
Alpine.start()
Verification
The PR was validated with a clean npm ci, a production build, and the full JavaScript suite: 110 tests passed with one skipped, matching expectations. Because the change is a constraint bump plus a lockfile refresh rather than a code change, the only behavioral surface is whatever upstream Alpine 3.17.4 itself changed — which is exactly what a well-scoped dependency chore should look like.
Takeaways
- Livewire 4.x now bundles
alpinejsand all ten official@alpinejs/*plugins at^3.17.4, up from^3.17.3. package-lock.jsonwas refreshed with official registry URLs and integrity hashes, keeping installs reproducible.- Using
@livewireScripts? Justcomposer update livewire/livewire— no app code changes required. - Bundling your own Alpine? Bump
alpinejsand your plugins to^3.17.4to stay in sync, and make sure Alpine is only started once. - Verified by clean install, production build, and 110 passing JavaScript tests.