Skip to content

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 smnandre requested a review from kbond November 11, 2024 04:50
@smnandre smnandre unassigned kbond and Kocal Nov 11, 2024
@smnandre smnandre requested a review from Kocal November 11, 2024 04:50
@smnandre
Copy link
Member Author

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

Will fix later

@smnandre
Copy link
Member Author

Cannot reproduce locally :(

@smnandre smnandre force-pushed the twig/template-class-cache branch from 0acc77c to 8623c61 Compare November 11, 2024 08:28
@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 force-pushed the twig/template-class-cache branch from a25e440 to 75a2997 Compare November 14, 2024 17:38
@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