Skip to content

[LiveComponent] Add support for live components in reusable bundles #3095

@javiereguiluz

Description

@javiereguiluz

Symfony UX doesn't officially support defining Live Components in reusable bundles (see #3064). However, if you add the following config for your live component, it works inside a bundle:

    // config/services.php
    return static function (ContainerConfigurator $container) {
        // ...

        $services->set(ProductSearch::class)
            // ...
            ->tag('twig.component', [
                'live' => true,
                'route' => 'ux_live_component',
                'url_reference_type' => true,
            ])
            ->tag('controller.service_arguments');
    };

We don't want to promote this because it's a hack that could break at any moment because of Symfony UX changes. But, hopefully there's a way to make this work officially in some way to allow Live Components be distributable more easily in Symfony bundles.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    LiveComponentRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions