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

[TwigComponent] Fix ux:icon & ux:map renders #2210

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

smnandre
Copy link
Member

Change implementation to avoid many dispatched events for nothing

Add a conflict in symfony/ux-map and symfony/ux-icons to synchronise the 3 packages to 2.21

Performance gain around 20%

@Kocal
Copy link
Member

Kocal commented Sep 26, 2024

Performance gain around 20%

Can you link the Blackfire profiles delta plz?

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Sep 27, 2024
@javiereguiluz javiereguiluz force-pushed the fix/remove-twig-listeners branch from ec7ccd7 to 24c1cb2 Compare September 27, 2024 13:45
@javiereguiluz
Copy link
Member

Thank you Simon.

@javiereguiluz javiereguiluz merged commit bc3d442 into symfony:2.x Sep 27, 2024
7 of 8 checks passed
@@ -108,6 +110,10 @@ class_exists(AbstractArgument::class) ? new AbstractArgument(\sprintf('Added in
$container->register('.ux.twig_component.twig.component_runtime', ComponentRuntime::class)
->setArguments([
new Reference('ux.twig_component.component_renderer'),
service_locator([
'ux:icon' => service('.ux_icons.twig_icon_runtime')->nullOnInvalid(),
'ux:map' => service('ux_map.twig_runtime')->nullOnInvalid(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chiming here a bit late: this doesn't work
a service locator must point to non-null references
when these are turned into nulls, XmlDumper explodes (and that's a symptom of this code, which is not "legal")

Also, from a design pov, this looks super hardcoded. How can one pass more things to the locator?

This should use a tagged locator instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer TwigComponent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants