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

[Twig] Cache template class resolution #2364

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

smnandre
Copy link
Member

Cache template class during rendering.

Non negligeable impact on pages with many components.

Capture d’écran 2024-11-11 à 01 59 30

@smnandre
Copy link
Member Author

Arf.... again LiveComponent hidden contract .. :(

Will fix later

@smnandre
Copy link
Member Author

Cannot reproduce locally :(

@smnandre
Copy link
Member Author

Weird. I think is it related to property accessor but it’s weird this différence between local and CI.

@Kocal
Copy link
Member

Kocal commented Nov 11, 2024

Locally, is your src/LiveComponent/vendor/symfony/ux-twig-component points to src/TwigComponent?

@smnandre
Copy link
Member Author

Ok i confirm... the Live test helper does not simulate real conditions. But i think we can deal with it :)

This was the change responsible for failures 🤷

+       if (!$componentMetadata->isAnonymous()) {
            // set data that wasn't set in mount on the component directly
            foreach ($data as $property => $value) {
                if ($this->propertyAccessor->isWritable($component, $property)) {
                    $this->propertyAccessor->setValue($component, $property, $value);
                    unset($data[$property]);
                }
            }
+        }

@smnandre
Copy link
Member Author

Fabbot wrong, we can move on with this one :)

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 14, 2024
@smnandre smnandre merged commit 89c7fa9 into symfony:2.x Nov 14, 2024
1 check was pending
@Kocal Kocal deleted the twig/template-class-cache branch November 14, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Status: Reviewed Has been reviewed by a maintainer TwigComponent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants