Hi guys,
I am very unhappy with one of the design choises you made in 3.2. In the core.php you load the whole Javascript package without checking if you need it or not. Calling javascript packages should be something, a view does, and not something that's being triggered by the core.php (!!!)
/**
* Load core scripts
* @since 3.2
*/
$app = JFactory::getApplication();
if($app->isSite()){
$js = 'assets/stream.js';
CAssets::attach($js, 'js');
// $map = 'https://maps.googleapis.com/maps/api/js?libraries=places&sensor=false';
// $doc = JFactory::getDocument();
// $doc->addScript($map);
}
This leads to the JomSocial jQuery package being loaded once the core.php is being integrated in the runtime. And you must know, that the core.php is being loaded, not just, when the component is running. You load core.php everytime, anything remotely related to JomSocial happens during the runtime.
I give you one example to show you, how uncool it is, to load javascript via core.php:
If a link in your menu points to the community component (and this must be the case for pretty much every site), then the menu-item link is beeing routed, first by the JRouterSite::buildRoute() method, and later by the Component Router's CommunityBuildRoute() function. And this component router loads the core.php and hence loads the Javascript package. Even though we are not even in the community component, but merely linking to it.
It would be enought to simply state, that this causes unneccesary overhead, but it also breaks things. It breaks things, because if we want to run other jQuery instances on other sites of our Joomla installation, this will override it.
So, please fix this. Loading the Javascript package via the core.php is just being lazy!