Support forums : Branches


Discussion about existing branches and the directions they need to go in, or, for branches that are going to happen. "Quickies" is wide open. "Branches" is more focused.

Moderator: Dracones


Postby EdB » Mon Jul 25, 2011 7:48 pm ... s-js_order

This branch will focus on putting the CSS before the JS in page <head> sections. The issue to the best of my ability to understand is that style sheets can hit the visitor in parallel but javascripts need to reach the visitor before the next bit starts. So the way we have it means time for style sheets, time for javascript A, time for javascript B, time for more style sheets, time for javascript C and so on and so forth.

The first nut to crack is the include_headlines() function. It will add whatever comes along in the order it comes along, though core actually can rather easily split that into include_css_headlines() and include_js_headlines().

The next issue will be $Plugins->trigger_event( 'TemplateBeginHtmlHead' ) in, which can spit out either styles or scripts and (imho) is way too high up in the head section. Yabs once proposed a reason for having that hook high up, but honestly I'm not sure I'm buying it. viewtopic.php?p=2563#p2563 is the explanation. The problem is "playing with the title" isn't possible given that the title follows that hook whether a plugin wants to tweak it or not. In other words, the most a plugin can do is create another page title tag, which is not the way to make a document happen.

ANYWAY I'm kinda thinking TemplateBeginHtmlHead should be multiple hooks. TemplateAddMetaTags, TemplateHeadAddCss, and TemplateHeadAddJs would cover all the bits we might possibly do with the head section of a page. But I dunno for sure and don't want to go too far down the path without seeing what others think. For now gonna work on the include_headlines() thing because it seems really easy.
User avatar
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Return to Branches

Who is online

Users browsing this forum: No registered users and 1 guest