Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
It is difficult to make improvements to the render system since practically all the modules and themes depend on the way it works.
Proposed resolution
Add new '#version' key to render arrays which would allow modules to opt-out for a newer version of render system than 8.0.0. This was proposed by multiple people at DrupalCon Barcelona but at that point, there was no real use case to implement this.
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedComment #3
cilefen CreditAttribution: cilefen commentedThis is an interesting idea. Could you add a little about the implementation?
Comment #4
lauriiiWe will have to decide whether we want to modify theme system also based on these version numbers.
Here's couple of ideas how this could be done:
Idea 1:
Define version while creating a render array:
That would apply render system version for the render array recursively. It should be possible to override the render array version on a children render array if so wanted. Problem with this is that render elements couldn't rely that strongly on different render system versions.
Idea 2:
Only support defining render system version on render elements:
This would be clearer since we wouldn't have to necessarily apply the version recursively.
Idea 3:
Define render system version per module
examples.info.yml
I have no clue if we could recognize which module the render array is coming from.
Idea 4:
Define theme system version per hook_theme implementation
Comment #5
lauriiiComment #9
markhalliwell