If we allow post-processing of fully rendered renderable arrays this interferes with plans for Twig drillability - #2008450: Provide for a drillable variable structure in Twig templates.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2009132-1.patch | 1.09 KB | thedavidmeister |
Comments
Comment #1
thedavidmeister commentedLet's just see what fails first.
Comment #2
tim.plunkettJust because core doesn't use it doesn't mean we can remove it.
Webform and CTools both use #post_render.
Comment #3
thedavidmeister commented@tim.plunkett - fair enough, I didn't even expect it to come back green for core.
What are the main use-cases for post_render in contrib at the moment?
Comment #4
fabianx commentedIn light of #2047263: Provide inline_template tag within Twig that inlines a template for usage with a render array for drillability with #post_render and #theme_wrappers support, I am for closing (won't fix) this one.
Comment #5
thedavidmeister commented@Fabianx is probably one of the best people to ask whether this is "ok" or not for drillability, so I'm happy to close this off.
Comment #6
jenlamptonI'd like to leave this on the table, actually.
We shouldn't need #pre_render and #post_render if we can do this right (though that may be in D9). I'd like to hear what the use cases are and see if we can solve those problems in other ways - now. If we can, we should kill these to make things less complicated :)
Comment #7
thedavidmeister commentedStill getting tumbleweed on the main use-cases for #post_render. I might ping @tim.plunkett in IRC later, or just look into ctools and webform myself and report back.
I have seen #post_render_cache discussed/proposed, to allow a combination of render caching and processing - #1991684: Node history markers (comment & node "new" indicator, "x new comments" links) forces render caching to be per user
We have had some related discussion to this across #2044105: Introduce #alters for \Drupal\Core\Render\Renderer::render() and #2052253: [META] Add #render property to drupal_render() and convert #type "#pre_render -> #markup" calls to use it
Comment #8
tim.plunkettNot sure when else ctools might be able to accomplish this...
Comment #9
fabianx commentedpost_render stays for now.