Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LiveComponent] Only consider Live components in InterceptChildComponentRenderSubscriber #1097

Merged
merged 1 commit into from Sep 7, 2023

Conversation

sneakyvv
Copy link
Contributor

@sneakyvv sneakyvv commented Sep 6, 2023

Q A
Bug fix? yes
New feature? no
Tickets
License MIT

This PR is related to the change of #1093.

Problem

The component stack now also contains embedded Components until they are fully rendered, which is good. But, that also means that with this setup

{# someTemplate #}

<twig:aLiveComponent>
    <twig:aTwigComponent>
        <twig:anotherLiveComponent>
            {# ... #}
        </twig:anotherLiveComponent>
    </twig:aTwigComponent>
</twig:aLiveComponent>

when re-rendering the anotherLiveComponent the InterceptChildComponentRenderSubscriber would look at the parent component's childrenFingerprints to determine if it can short-circuit the rendering process for anotherLiveComponent and return an empty html element causing the FE to not do a callback to re-render it. However since that parent is a non-live component it will never short-circuit.

Solution

Only take live components into account.

@weaverryan
Copy link
Member

Thanks Bart!

@weaverryan weaverryan merged commit 8d5a9f1 into symfony:2.x Sep 7, 2023
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants