Skip to content

Conversation

smnandre
Copy link
Member

Replaces the ComponentAttributesFactory with direct usage of the EscaperRuntime from Twig

Inject EscaperRuntime in ComponentAttributes

  • Replaced ComponentAttributesFactory with Twig\Environment and EscaperRuntime in AddLiveAttributesSubscriber, LiveComponentHydrator, and ChildComponentPartialRenderer, ensuring ComponentAttributes is instantiated with the necessary EscaperRuntime.
  • Updated the ComponentAttributes constructor to require EscaperRuntime directly, removing the deprecated HtmlAttributeEscaperInterface.

Remove ComponentAttributeFactory

  • Removed all references to ComponentAttributesFactory and its related logic across the codebase
  • Adjusted unit and integration tests to reflect the removal of ComponentAttributesFactory

Dependency Updates

  • Updated symfony/ux-twig-component dependency in composer.json to version ^2.25.1

Documentation Updates

  • Added a new entry in the CHANGELOG.md for version 2.25.1

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label May 19, 2025
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

Very few comments, otherwise it looks nice to me 🤩

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels May 19, 2025
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Simplicity FTW 🚀
just minor comments to fix before merge

@smnandre
Copy link
Member Author

(remaining fabbot failures unrelated / false positives)

@smnandre
Copy link
Member Author

LiveComponent dev / 8.4 failures caused by TypeInfo deprecation / unrelated to this PR

Capture d’écran 2025-05-19 à 13 19 14

@fabpot fabpot force-pushed the component-attribute-escaper branch from eef2738 to 13755d9 Compare May 19, 2025 11:23
@fabpot
Copy link
Member

fabpot commented May 19, 2025

Thank you @smnandre.

@fabpot fabpot merged commit c2f7738 into symfony:2.x May 19, 2025
9 of 10 checks passed
@norkunas
Copy link
Contributor

Is it expected that data-action="keydown->tree-view#handleKeydown" is now rendered as data-action="keydown->tree-view#handleKeydown" ? many of our tests are affected :)

@Kocal
Copy link
Member

Kocal commented May 20, 2025

@norkunas may be fixed by #2757, but we don't know how you create the ComponentAttributes instance, feel free to open a new issue if needed :)

@norkunas
Copy link
Contributor

Thanks

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

Successfully merging this pull request may close these issues.

6 participants