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

Files: 
CommentFileSizeAuthor
#5 twig-datetime-1939080-5.patch2.99 KBjoelpittet
PASSED: [[SimpleTest]]: [MySQL] 53,317 pass(es).
[ View ]
#5 interdiff.txt662 bytesjoelpittet
#3 twig-datetime-1939080-3.patch2.75 KBjoelpittet
PASSED: [[SimpleTest]]: [MySQL] 53,462 pass(es).
[ View ]

Comments

I'll take this.

Assigned:Unassigned» tlattimore

Status:Active» Needs review
StatusFileSize
new2.75 KB
PASSED: [[SimpleTest]]: [MySQL] 53,462 pass(es).
[ View ]

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

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.

Assigned:Unassigned» joelpittet
StatusFileSize
new662 bytes
new2.99 KB
PASSED: [[SimpleTest]]: [MySQL] 53,317 pass(es).
[ View ]

Status:Needs review» Reviewed & tested by the community

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

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

We should profile this change

Assigned:joelpittet» Unassigned

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&...

Status:Needs review» Reviewed & tested by the community

Back to RTBC, profiling looks good.

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

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.