knapsack-cloud/twig-renderer

Drupal 9 upgrade to Twig 2.0

Closed this issue · 6 comments

Given that Drupal 9 is upgrading to Twig to 2.0, will twig-renderer also need to be upgraded to Twig 2.0 syntax to update from old Twig_Function and Twig_Filter classes/interfaces to the new \Twig\TwigFunction and \Twig\TwigFilter respectively?

For reference: https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/preparing-for-use-of-twig-2-in-drupal-9#s-major-changes-include

I just figured out that Twig version is set in composer.json. So what is then best practice to upgrade that to Twig 2.0? or will it matter?

I would also be interested in how to get Pattern Lab upgraded to Twig 2.0

Hi Mario, as I mentioned on twitter you can use https://github.com/rogeriochaves/npm-force-resolutions to force PL to use twig renderer 2.0.0. Or just DM me on Drupal Twig (or Chaz has my contact info) and I'll be happy to walk you through it.

I am new to Knapsack, but I would also like to do this as well. I have a Composer/PHP version of PL (2.6) and I would like to replace it with patternlab-node (3.x)

I just wanted to mention that it looks like Twig 2 is supported since #64. I don't know if there are any deprecations that ought to be handled, but otherwise I guess this issue could be closed?

Twig 3 is now supported in this package.