[HttpKernel] Deprecate the hinclude fragment renderer#64071
[HttpKernel] Deprecate the hinclude fragment renderer#64071javiereguiluz wants to merge 8 commits intosymfony:8.1symfony/symfony:8.1from javiereguiluz:deprecate_hincludejaviereguiluz/symfony:deprecate_hincludeCopy head branch name to clipboard
Conversation
|
please check failures ;) |
af221ad to
05c1575
Compare
| TwigBridge | ||
| ---------- | ||
|
|
||
| * Deprecate the `render_hinclude()` Twig function; use `render_esi()` or `render()`, or [Symfony UX Turbo](https://ux.symfony.com/turbo), instead |
There was a problem hiding this comment.
this deprecation does not seem to be implemented in a way where Twig will report deprecations when linting templates.
There was a problem hiding this comment.
You are right. The problem is that render_hinclude() is not a registered function name at all; it is matched by the wildcard render_* registered in HttpKernelExtension::getFunctions(). We cannot add name-dependent deprecation notices in wildcards ... so I added some code to register render_hinclude explicitly. Thanks.
| ->tag('kernel.fragment_renderer', ['alias' => 'inline']) | ||
|
|
||
| ->set('fragment.renderer.hinclude', HIncludeFragmentRenderer::class) | ||
| ->deprecate('symfony/framework-bundle', '8.1', 'The "%service_id%" service is deprecated and will be removed in 9.0; use the "fragment.renderer.esi" or "fragment.renderer.inline" service, or Symfony UX Turbo, instead.') |
There was a problem hiding this comment.
this service is always wired(see TwigBundle's ExtensionPass), isn't it? which means this deprecation will always be triggered IIUC
can you confirm?
maybe deprecating the class is enough?
There was a problem hiding this comment.
OK, I did that. Thanks.
4aded60 to
a574032
Compare
This PR deprecates the hinclude fragment renderer and all its related code. The feature was originally built around the hinclude.js library, which is no longer maintained, and the use case it solves (composing a page from independently-fetched fragments on the client side) is much better served today by ESI, inline rendering, or Symfony UX Turbo.