Meta issue: #1843738: [meta] Convert views module to Twig
#1987510: [meta] Convert all core *.tpl.php templates to Twig as singular patch
Profiling results
=== views-view-rss-8.x..views-view-rss-8.x compared (519aa9d3a1b8c..519aaa3d27345):
ct : 41,342|41,342|0|0.0%
wt : 267,443|267,501|58|0.0%
cpu : 251,455|250,983|-472|-0.2%
mu : 18,107,976|18,107,976|0|0.0%
pmu : 18,186,400|18,186,400|0|0.0%http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=519aa9d3a1b8c&...
=== views-view-rss-8.x..views-view-rss-1843760-32 compared (519aa9d3a1b8c..519aaa62743ee):
ct : 41,342|41,424|82|0.2%
wt : 267,443|267,876|433|0.2%
cpu : 251,455|251,969|514|0.2%
mu : 18,107,976|18,140,752|32,776|0.2%
pmu : 18,186,400|18,212,776|26,376|0.1%http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=519aa9d3a1b8c&...
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | interdiff.txt | 2.52 KB | joelpittet |
| #32 | 1843760-32-twig-views-view-rss.patch | 3.85 KB | joelpittet |
| #27 | twig-views-view-rss-1843760--27.patch | 1.96 KB | webthingee |
| #25 | twig-views-view-rss-1843760--25.patch | 1.96 KB | webthingee |
| #18 | twig-views-view-rss-1843760--3--innerdiff.txt | 1.08 KB | webthingee |
Comments
Comment #1
joelpittetComment #2
mbrett5062 commentedTagging.
Comment #3
jpamental commentedConverted to core patch. Removes views-view-rss.tpl.php, adds views-view-rss.html.twig
Comment #4
jpamental commentedReassigning to Drupal core.
Comment #6
idflood commented#3: drupal-twig-views-view-rss-1843760.patch queued for re-testing.
Comment #7
dawehnerJust this line shows how much better twig is :)
I'm wondering whether you know what the codestyle tells us about these descriptive lines. Should they be full sentences?
This looks really great in general.
Comment #8
jpamental commented@dawehner I confess I don't really know. There were no comments in the original patch or file, so I write these in as best I could. I don't know if there is a format I was supposed to follow, though if there is point me in the right direction and I'll reroll it!
Comment #9
star-szrThe general guidelines are that all documentation should form complete sentences (http://drupal.org/node/1354#drupal) and the template documentation standards show this in action (http://drupal.org/node/1354#templates). There's also the Twig-specific standards, I think for example the
@ingroup views_templatesneeds to be@ingroup themeable.Comment #10
dawehnerSo needs work, sorry.
Comment #11
joelpittetAdding twig tag
Comment #12
webthingee commentedgrabbing
Comment #13
joelpittetComment #14
webthingee commentedupdating documentation.
used views-exposed-form.html.twig as a guide/sample and used both @ingroup statements.
Comment #15
webthingee commentedComment #16
webthingee commentedComment #17
webthingee commentedComment #18
webthingee commentedThis time I GOT IT.
Comment #19
joelpittetNice work, if you want you can uppercase the first letter on those sentences as well.
Also we can clean up the docs and variables on the preprocess function
replacing
$varswith$variablesAnd removing the spaces infront of these variables.
Comment #20
star-szrTagging.
Comment #21
thedavidmeister commented#19 - We don't have to convert the $vars to $variables just yet, that's a task for another day #1963942: Change all instances of $vars to $variables.
This is a very minor point but could we add
@see template_preprocess()to the template comments?Other than that though I think the code style in this patch is good. Essentially, once the documentation is updated it's ready for manual testing and for manual testing steps to be written :)
Comment #22
star-szrTagging as novice to add
@see template_preprocess()to the .html.twig between the variables and the @ingroup, see Twig coding standards for an example.Also, these descriptions should be complete sentences (starting in a capital letter) per http://drupal.org/node/1354#drupal.
Comment #23
star-szrOops, tag.
If you'd like to work on this, please assign the issue to yourself. If you get stuck, drop by #drupal-twig on IRC or post your questions here. Thanks!
Comment #24
star-szrI didn't notice this was already assigned.
@webthingee - same as #1843740: Convert views/templates/views-exposed-form.tpl.php to twig, you're more than welcome to see this through but if you can't for whatever reason please unassign.
Comment #25
webthingee commented#21 held off on any variables.
#22 added @see template_preprocess()
#22 updated docs to complete sentences.
Ended up with a fresh patch after updating latest 8.x repo.
Comment #26
webthingee commentedsetting this patch to needs review.
Comment #27
webthingee commentedlooking at code standards again, seeing I need an extra space.
re-rolled....
Comment #28
jenlamptonOkay, testing manually. Markup looks good! Doc block looks great. :)
before:
after:
Since #25 passed tests and #27 just adds another space, I'm confident marking this RTBC :)
Comment #29
dawehnerThis looks perfect!
Comment #30
thedavidmeister commentedComment #31
star-szrTagging for profiling.
Comment #32
joelpittetDoc updates, missing preprocess docs. Removed $options because they weren't being used and =& references.
Comment #33
star-szrI'll profile this one.
Comment #34
star-szrProfiling results:
Added this code to template_preprocess_views_view_rss() to isolate the profiling to only this template conversion (not comparing loading Twig itself):
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=519aa9d3a1b8c&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=519aa9d3a1b8c&...
Comment #34.0
star-szrUpdated issue summary.
Comment #35
alexpott+1. Ready for #1987510: [meta] Convert all core *.tpl.php templates to Twig as singular patch
Yay!
Comment #36
alexpottCommitted a312df8 and pushed to 8.x. Thanks!
Comment #37.0
(not verified) commentedAdd profiling results