Accudio / async-alpine

Async Alpine brings advanced code splitting and lazy-loading to Alpine.js components!
https://async-alpine.dev
Apache License 2.0
152 stars 12 forks source link

Fix: race condition in nested components #40

Closed helio3197 closed 6 months ago

helio3197 commented 7 months ago

Fix race condition in nested components. Skip Alpine.init call on elements with an ancestor with x-ignore.

39

allensquare commented 7 months ago

This logic makes sense to me. I did some testing around this and seems to work well with nesting, also appears to fix my use case, thank you!

@Accudio thoughts on this solution? It appears inline with what you were suggesting.

Accudio commented 7 months ago

@helio3197 @allensquare This is pretty much like I was thinking, thank you for the contribution! I've got a busy week but will review and test this at the weekend.

howdu commented 6 months ago

This fixed an issue I was having with nested components, but are you aware it also broke Filament's modal? https://github.com/filamentphp/filament/releases/tag/v3.2.37

Accudio commented 6 months ago

Thanks for flagging @howdu.

@danharrin would you or another member of the Filament team be able to file an issue with your modal implementation and a test case and I can take a look into this?

I believe the behaviour in 1.2.2 is the most correct, reliable and consistent and am surprised it caused a breaking change, but there may be something I missed or it's implementation-based.

danharrin commented 6 months ago

Hi @Accudio, I would like to, but currently I don't really have time to dig into it, and locking the dependency was the easiest way for us to move forward.

@howdu if you're looking to use the functionality of this release, you can make a reproduction for us if you want, copy the rendered code from our modal Blade component in and put an async component inside.