Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpKernel] Deprecate the hinclude fragment renderer#64071

Open
javiereguiluz wants to merge 8 commits intosymfony:8.1symfony/symfony:8.1from
javiereguiluz:deprecate_hincludejaviereguiluz/symfony:deprecate_hincludeCopy head branch name to clipboard
Open

[HttpKernel] Deprecate the hinclude fragment renderer#64071
javiereguiluz wants to merge 8 commits intosymfony:8.1symfony/symfony:8.1from
javiereguiluz:deprecate_hincludejaviereguiluz/symfony:deprecate_hincludeCopy head branch name to clipboard

Conversation

@javiereguiluz
Copy link
Copy Markdown
Member

Q A
Branch? 8.1
Bug fix? no
New feature? no
Deprecations? yes
Issues -
License MIT

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.

@javiereguiluz javiereguiluz added this to the 8.1 milestone Apr 29, 2026
@carsonbot carsonbot changed the title Deprecate the hinclude fragment renderer Deprecate the hinclude fragment renderer Apr 29, 2026
@carsonbot carsonbot changed the title Deprecate the hinclude fragment renderer [HttpKernel] Deprecate the hinclude fragment renderer Apr 29, 2026
@nicolas-grekas
Copy link
Copy Markdown
Member

please check failures ;)

Comment thread UPGRADE-8.1.md
TwigBridge
----------

* Deprecate the `render_hinclude()` Twig function; use `render_esi()` or `render()`, or [Symfony UX Turbo](https://ux.symfony.com/turbo), instead
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this deprecation does not seem to be implemented in a way where Twig will report deprecations when linting templates.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK, I did that. Thanks.

Comment thread src/Symfony/Bridge/Twig/Extension/HttpKernelRuntime.php
@nicolas-grekas nicolas-grekas modified the milestones: 8.1, 8.2 May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.