Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

core.php loads the whole Javascript package without thinking

12 years 5 months ago
  • GENOVA's Avatar
    Topic Author
  • GENOVA
  • Offline
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Licenses:
JomSocial Expired

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!

12 years 5 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Genova,

Thank you for your reporting..well we aware with this issue, because it will make your website slow.. we decided to improve this things in version 3.3, so for every library only will be called on the specific pages, and we will separate each file for each functions.

thank you

12 years 5 months ago
  • GENOVA's Avatar
    Topic Author
  • GENOVA
  • Offline
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Licenses:
JomSocial Expired

I'm glad to hear that.

Thank you!

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW