Task

Use Twig instead of PHPTemplate

Twig sandbox: http://drupal.org/sandbox/pixelmord/1750250

We already have datetime.html.twig but we still need to remove theme_datetime() and likely do a few tweaks to template_preprocess_datetime() and datetime.html.twig while we're at it.

Remaining

  • Replace all theme functions and templates with .html.twig equivalent templates
  • Add new preprocess functions for the .html.twig equivalent templates
  • Update all hook_theme definitions

Related

#1885560: [meta] Convert everything in theme.inc to Twig

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tlattimore’s picture

I'll take this.

tlattimore’s picture

Assigned: Unassigned » tlattimore
joelpittet’s picture

Status: Active » Needs review
FileSize
2.75 KB

This one was technically already done and in core... I just cleaned the twig file up and removed the theme_ function.

tlattimore’s picture

Assigned: tlattimore » Unassigned

Thanks for working on this, joelpittet. Sorry I didn't get to it :(

This patch looks good for RTBC for me if it passes. Some good cleanup of the .twig and removing the theme function.

joelpittet’s picture

Assigned: Unassigned » joelpittet
FileSize
662 bytes
2.99 KB
star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, just cleanup and theme() function removal. Nice work, RTBC!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +needs profiling

We should profile this change

joelpittet’s picture

Assigned: joelpittet » Unassigned
joelpittet’s picture

Status: Needs work » Needs review
Issue tags: -needs profiling

Scenario: Added datetime field to article and loaded them into a fields view showing 10 articles titles and datetime fields

=== 8.x..8.x compared (51a287779d22e..51a287b61fb31):

ct  : 66,207|66,207|0|0.0%
wt  : 314,181|314,565|384|0.1%
cpu : 274,957|274,865|-92|-0.0%
mu  : 15,062,480|15,062,480|0|0.0%
pmu : 15,210,560|15,210,560|0|0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51a287779d22e&...

=== 8.x..1939080-twig-datetime compared (51a287779d22e..51a287f454ce8):

ct  : 66,207|66,127|-80|-0.1%
wt  : 314,181|313,537|-644|-0.2%
cpu : 274,957|273,795|-1,162|-0.4%
mu  : 15,062,480|15,056,392|-6,088|-0.0%
pmu : 15,210,560|15,205,392|-5,168|-0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51a287779d22e&...

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC, profiling looks good.

star-szr’s picture

+1 to going back to RTBC, less function calls.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Hooray for less function calls...

Committed 9236b3f and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.