[Stimulus] Fasten lazy loading + add debug lazy:loading and lazy:loaded #2463
Conversation
📊 Packages dist files size differenceℹ️ No difference in dist packagesFiles. |
I will try to find some time to rebuild a Symfony + Encore app, but by reading your changes it looks fine to me (feel free to reping me if necessary) |
|
@MatTheCat ? 👼 |
|
I'm testing |
|
Well... I've just realized, but to use Stimulus in a Symfony App with Webpack Encore, we use the https://github.com/symfony/stimulus-bridge ... which is not in this repository (and so not modified by this PR) 😅 |
|
Well.... let me tell you i have no intention of coding in the Bridge hahaha (i'll have a look but the lazy loading is done differently if i remember correctly) |
|
I’ve got nothing to test then? 🤔 |
0e5abca to
3b8e1ce
Compare
|
Thanks Simon. |
This PR..
improves the controller lazy loading by tuning algorithm (early exit, remove await, ...)
introduces two new debug events in the console to ease DX with lazy controllers
my-controller#lazy:loadingwhen the lazy controller is detected in the DOMmy-controller#lazy:loadedafter the file has been downloaded and importedI would really like some feedback / tests IRL (especially with Webpack i'm not used to)