javascript and hikashop and joomla ( greneral )

  • Posts: 846
  • Thank you received: 92
10 years 11 months ago #130735

Hi
I test many extension ( component "article" and module ) that implement some javascript code base on differents javascript Framework . I have some question about javascript and HKS but since HKS is bas on joomla my question focus also on javascript and Joomla .

1-How Hikashop handle javascript ?
1a ---do HKS use a javascript framework or their own ?
--->added <---
---->could make difference beetween backend and frontend
----> i think all backend use by HKS is mootool ?? !!
1b ---which HKS extension use javascript Framework ?
1c ---which javascript framework name and version is use if HKS use a FW ?


2- since use Javascript FW and custom javascript file for extension could occur !
Does joomla by default
2a---load only one version of the javascript framework even if call from many location ( article compoment module)
2b ---load javascript framework ( jquery mootool) before custom code ?
2c ---prevent incompatibility beetween FW by redefine $ for each framework ( howto modify the custom code ) ?

3 I was thinking Joomla have a javascript loader/manager for js framework and custom external javascript file .
For example when all extension have been process does joomla
3a --- know (in a "table" cache) all the javascript FW and custom js code that have been call
3b ---can order the javascript ( FW before custom code )
3c ---can or document howto change code to avoid incompatibility beetween $ variable for initiate FW and use in js custom file


4 in which order the javascript file link are in index.php ? l : does joomla write javascript link/call in the order it process extension ? How jomla process content order extension link in index .php for extension that contain javascript ? order can be set for menuitem , plug in , module but no information for how joomla order component , menu item, plug in , module ?


5 does joomla 3.x do better than 2.x ?
http://docs.joomla.org/J3.1:Javascript_Frameworks

6 If Joomla 2.x 3.x don't do that by default it is really a mess .........( if no good documentation exist ..... ) .It is a chance that the script language in the Front End is only javascript and not other language !!! We have enough too many work when manage incompatibility beetween javascript FW ( Framework ) .
I know there is a lot extension for manage javascript but manage javascript base on the menui item , or load js for whole site ( not when javascript is need ) and not for custom module ( some module don't have menu ) is not flexible /efficient .



regard's

Last edit: 10 years 11 months ago by lionel75.

Please Log in or Create an account to join the conversation.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 11 months ago #130744

Hi,

Javascript is a complex topic.

1. All our extensions uses a javascript framework at some point. We first tried to rely as much as possible on mootools, which was the defacto js library on joomla as it was, and still is in joomla by default. So our extensions do not include it but load it from joomla and thus the mootools version varies based on the version of joomla.
We then started to use jquery as Joomla changed their main js library from mootools to jquery but as we needed backward compatiblity, we had to include jquery in Hikashop. We don't always load it (only when necessary), and the version varies as well based on the version of joomla you're using.
We also have our own javascript "library" that we started as we had too much issues with conflict with other extensions using improperly jquery/mootools on their end.

2. It depends. If everyone would use the mootools/jquery of joomla like we do, there would be way less js conflicts as joomla loads them only once per page. The fact is that most templates and extensions load their own version of mootools/jquery instead of using joomla's and thus you usually end up with several versions on the pages and that create conflicts.
Some try to mitigate these conflicts, but there is no real solution put forward yet.

3. There is such cache table, but not all extensions rely on it and there is not one sure way to avoid incompatibilities with the way it is done. Of course, there is no documentation that I know of published for joomla on that subject.

4. Yes, in the order it process the extensions. Normally, the current component is first processed, then the modules and then the template. The plugins are processed all over the place.

5. No. It's getting worse as the number of javascript libraries increase and the advent of new types of frameworks like bootstrap.

6. Yes, it is a real mess and I don't see a real solution emerging any time soon.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum