Skip to content

Lazy-load only the necessary controllers #3

Closed
@stof

Description

@stof

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions