Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From #15062:
Simply removing Async Alpine from tables did not fix the problem, and using Async Alpine v1 seems completely incompatible with Livewire > v3.5.12. We had to revert #15062. Livewire has remained locked to this version since then.
While locking Livewire hasn't caused too many complaints for us to far, there have been several comments and issues about it. I imagine this problem will get worse over time as more dependencies bump their minimum Livewire version. It looks like Flux has already done this, and Flux is due to be included in the new Laravel starter kit. When the new starter kits are released, people using them and installing Filament at the same time will probably end up with a broken version of Filament before Livewire was locked. The same issue may be encountered by people using Flux without the starter kit. I would like it if Flux and Filament can both be installed in the same Laravel project and still work.
We need to take other action to unlock the Livewire version. This is the first attempt at doing so. This PR upgrades Async Alpine to v2. We were not planning to do this before Filament v4 as there are breaking changes in the package, so Filament plugins would break if they are not using the new Async Alpine syntax:
ax-load
attributes need renaming tox-load
ax-load-src
attributes need renaming tox-load-src
x-ignore
attributes need removing from Async Alpine component root elementsOne method of action that we could take is using the Blade compiler to perform these replacements at render time. A regex would be required to identify this attributes, which could be inaccurate depending on the content of the view - Alpine.js attribute values could contain many unpredictable characters and mess with identification.
This PR introduces JavaScript to identify attributes that need to be upgraded, and do so on page render and when the mutation observer detects changes to the DOM. I hope that this allows plugins to continue to use the Async Alpine v1 syntax while fixing its incompatibility with Livewire.