You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the bridge generates a virtual module which uses import() with the webpackMode comment to make them eager or lazy.
But the way this @symfony/controllers module is consumed in the main entrypoint means that all the controllers are loaded on all pages to be registered. This makes the lazy-loading useless as you would load all chunks on all pages.
I agree indeed. That's something that was discussed but not implemented before the release. We should have a deeper look, and probably ship a behaviour to easily leverage that from the assets/controllers.json file.
Currently, the bridge generates a virtual module which uses
import()
with thewebpackMode
comment to make them eager or lazy.But the way this
@symfony/controllers
module is consumed in the main entrypoint means that all the controllers are loaded on all pages to be registered. This makes the lazy-loading useless as you would load all chunks on all pages.I discovered https://github.com/danieldiekmeier/stimulus-controller-resolver which allows to actually lazy-load some modules only if they are used in the page. It might make sense to use that.
The text was updated successfully, but these errors were encountered: