Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

YUI 3 CSS styles unnecessarily included twice

#344

If you profile the files that are loaded, you will notice that the styles for any module that references a YUI 3 widget are included twice. The first time is loaded statically via the <link> tag in <head> (minified and stitched to the others) and the second time it is loaded dynamically via YUI's built-in Loader infrastructure. See reference:

http://yuilibrary.com/yui/docs/tutorials/skins/#loading-skin-files

Given that it is being loaded dynamically, it is safe to remove the {css} tags from tpl files that are referencing YUI3 css files. For example in /framework/modules/text/views/text/showall_tabview.tpl it is safe to remove the following:

{css unique="id" link="$smarty.const.YUI3_PATHtabview/assets/skins/sam/tabview.css"}

{/css}

And you will notice that the tabview styles are still maintained. This applies to all other tpl files that reference YUI3 css files. This will minimize the amount of css that is downloaded, and applied duplicately hopefully improving performance. YUI's loader class is commented as such:

/** * Loader dynamically loads script and css files. It includes the dependency * info for the version of the library in use, and will automatically pull in * dependencies for the modules requested. It supports rollup files and will * automatically use these when appropriate in order to minimize the number of * http connections required to load all of the dependencies. It can load the * files from the Yahoo! CDN, and it can utilize the combo service provided on * this network to reduce the number of http connections required to download * YUI files. * * While the loader can be instantiated by the end user, it normally is not. * @see YUI.use for the normal use case. The use function automatically will * pull in missing dependencies.

Reported by Imran · September 27th, 2011 @ 03:20 AM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Imran
    Imran

    This is not true when the files are minified. This bug can be closed.

    Thanks

    October 4th, 2011 @ 07:44 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.