As Drupal Core now supports rebuilding the Twig registry has improved debugging and template reloading functionality as part of a local services.yml file, I would endorse removing this feature from Zen. One, it's fairly redundant. Two, less code to port and maintain :-)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kmonty created an issue. See original summary.

kmonty’s picture

star-szr’s picture

There is no Twig registry, and the theme registry that stores which templates are in use still exists in D8. So IMO this is still a useful feature to have, but I'm curious if you are actually able to do this with only a setting.

kmonty’s picture

I could be misinterpreting this, but there is the Twig auto-reload in services.yml (still fairly new to D8, so quite possible I don't understand exactly what this does!).

    # Twig auto-reload:
    #
    # Automatically recompile Twig templates whenever the source code changes.
    # If you don't provide a value for auto_reload, it will be determined
    # based on the value of debug.
    #
    # Not recommended in production environments
    # @default null

Devel also appears to have gotten rid of this feature for the 8.x release. Again, that doesn't necessarily mean Zen needs to abandon it, but it's an interesting data point.

kmonty’s picture

I should also note, this might not be a necessary MVP feature for an functional alpha D8 release of Zen, should John + the community wish to keep it.

kmonty’s picture

Title: Remove Zen Registery Rebuild from 8.x-7.x Zen » Should Zen Remove "Registery Rebuild" Functionality from 8.x-7.x Zen?
Issue summary: View changes

Updating issue info to reflect that this is more of suggestion.

star-szr’s picture

Twig auto-reload != Drupal theme registry rebuild on each page load. If you add a new template override, Twig auto-reload won't know about it until you rebuild the theme registry. So IMO this is still a potentially useful feature during theme development.

Edit: More info on Twig auto reload here: http://twig.sensiolabs.org/doc/api.html#environment-options and https://www.drupal.org/node/1903374#twig-auto-reload

star-szr’s picture

Title: Should Zen Remove "Registery Rebuild" Functionality from 8.x-7.x Zen? » Should Zen Remove "Registry Rebuild" Functionality from 8.x-7.x Zen?

:)

JohnAlbin’s picture

Title: Should Zen Remove "Registry Rebuild" Functionality from 8.x-7.x Zen? » Port "Registry Rebuild" Functionality from Drupal 7 version
Status: Active » Needs work

I have a half-working version. It rebuilds the theme registry clears the Twig cache if the setting is set, but it doesn't warn you that it is doing it. Nor does it actually rebuild the theme registry.

  • JohnAlbin committed a54a42d on 8.x-7.x
    Issue #2637804 by JohnAlbin: Port "Registry Rebuild" Functionality from...
rodrigoaguilera’s picture

Component: PHP/JS code » Component markup (CSS/Sass/HTML/Twig)
Status: Needs work » Needs review
FileSize
1.29 KB

Here is a patch to solve the call to the url() undefined function

rodrigoaguilera’s picture

Component: Component markup (CSS/Sass/HTML/Twig) » PHP code
rodrigoaguilera’s picture

I forgot a ->toString()