Closed james2doyle closed 3 months ago
Fine to merge from my end! I don't have a testing instance available, either, but the code looks sound and I'm assuming the changes are manually tested :)
I checked it locally with a patch first and then deployed the patch to test it. Unfortunately their was no information in the Livewire repo about what happened to the restart method
On Sat, Jul 6, 2024, 8:29 AM Philipp Daun @.***> wrote:
Fine to merge from my end! I don't have a testing instance available, either, but the code looks sound and I'm assuming the changes are manually tested :)
— Reply to this email directly, view it on GitHub https://github.com/swup/livewire-plugin/pull/3#issuecomment-2211797974, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK37GEBTCPERYUFFPDC663ZLAEM3AVCNFSM6AAAAABKNZPPRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRG44TOOJXGQ . You are receiving this because you authored the thread.Message ID: @.***>
@james2doyle your patch has been released in version 2.0.1. Thank you for contributing! 👏
Great! Thanks for the speedy attention!
On Sat, Jul 6, 2024, 11:48 a.m. Rasso Hilber @.***> wrote:
@james2doyle https://github.com/james2doyle your patch has been released in version 2.0.1 https://github.com/swup/livewire-plugin/releases/tag/2.0.1
— Reply to this email directly, view it on GitHub https://github.com/swup/livewire-plugin/pull/3#issuecomment-2211853829, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK37GAFCFCP3TOZAG4VKE3ZLA3WBAVCNFSM6AAAAABKNZPPRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRHA2TGOBSHE . You are receiving this because you were mentioned.Message ID: @.***>
Just tested this release (2.0.1) live on the site I'm developing, and it works perfectly!
Description
Seems like
Livewire.restart()
has been removed on newer versions of Livewire.Some context: https://github.com/livewire/livewire/issues/2334#issuecomment-759901196
So the fix is to only call that function if it exists. Otherwise, we call the restart or refresh methods on the components themselves. Since there seems to be two different ways to restart components, each one is tried if it exists.
Checks
Tested with Livewire 3.4 and Swup 4.6.1.
master
branchnpm run lint
)npm run test
)Additional information
I think this can be tagged as 2.1.0 because it is backwards compatible with the previous version and only calls the new code if the old one is missing.