Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
14 HTTP requests
Pretty sure I brought this up with version 1 of Vanilla too..
Is there really a need to make 14 http requests for each page before it's even rendered? There's so many calls for separate JQuery files its unbelievable.
Is there really a need to make 14 http requests for each page before it's even rendered? There's so many calls for separate JQuery files its unbelievable.
0
Comments
See also:
http://vanillaforums.org/discussion/10677/vanilla-2-inbrowser-speed-optimization/
http://vanillaforums.org/discussion/10690/theme-controller-overriding-and-javascript-excluding/
We still have a few things to fix before it is released, but it shouldn't be too long now, and of course you can always grab the latest version from our SVN repository if you are feeling adventurous
Being modular, and being able to enable/disable application/plugins/themes that can add css and/or js adds an order of magnitude of things to think of before being able to put everything into a single minified js and a single minified css.
Given that 1.2's getting minify I wouldn't be surprised to see it ported to V2 as well.
Also putting the javascript at the bottom will mean more can be downloaded at once by the browser.
As a relatively simple improvement to the "1 big file" solution, perhaps we could have in addition to the we already have. That way, scripts that can be deferred until the content has loaded could be specified to go in the footer. Then we'd have 2 big JS files, one set in the head and one set in the footer. Thoughts?
I agree about the footer bit. And I suppose scripts could also specify jQuery.ready for on-DOM load, although Google's idea of having JS that loads to write in further JS might be worth a look. The idea of turning JS from something dumbly loaded via HTML into something smartly loaded by JS as a platform itself might be worth considering. I love all the new MVC frameworks for JavaScript, or something I just discovered the other day-- CoffeeScript. I don't see why we can't treat JS more like PHP and optimize its hooks/execution the same way we do in Garden for PHP.
Applications and plugins should instead list the ressources they can serve. A resource should have a name, a default location, a list of dependency (some other js or css script) and some flags (like "can be packed", "can be minified", "can be loaded asynchronously", "is a library", etc...)
Then the controllers should list the ressources a page needs and let Vanilla or a plugin add the scripts and stylesheets. Vanilla should have a naive implementation, adding all ressources inside the Head elements in the correct order. Plugins could implement different way to optimize loading so that admin can test and pick the best solutions for their forum (a forum that get most of its traffic from google will have different needs than a private forum).
It is better for the developers who will use these libraries if the providers of the library define all metadata; it's also "DRYer".
In Vanilla 1.2, to add jQuery and your plugin (and allow them to be packed), you will have to remember the recommended order of loading for jQuery and its plugins: If you are using MooTools, you have to guess since the framework or the plugins Vanilla 1.2 includes don't use MooTools.
I would have like better: About js and themes, there are patterns that allow default settings to be customised: To overwrite the selector, the theme can add the following script at the end of the head element: Or If I understand what Garden's "definition()" can be used for, it can just add an entry for the "askConfirmation.selector" definition.
It is too late for Vanilla 1; packer extensions can break extension's js and css loading, not many developer will debug and update their extensions.