Multiple Copies of dhtmlxcommon.js

I was working on creating a routine in my UI that remembers what JS files have been loaded and so that they aren’t re-loaded. That led me to noticing that each dhtmlx component has a dhtmlxcommon.js:



: find . -name ‘dhtmlxcommon.js’

./dhtmlx/dhtmlxSlider/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxCalendar/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxGrid/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxToolbar/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxTree/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxMenu/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxCombo/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxColorPicker/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxTabbar/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxFolders/codebase/dhtmlxcommon.js

./dhtmlx/dhtmlxWindows/codebase/dhtmlxcommon.js



Why is this? I diffed a couple of them and they have many differences. This makes me think they are not actually common. I wish there was just one and I could just include that one for all dhtmlx components that I use. Possible?



Thanks.

Each component can be used separatly, so they all contains core js file
Technically they are the same ( it possible that you are using different version - which may cause different sizes ) , and you can use any one from them ( only one file necessary )
If you are using few different versions of components - just use dhtmlxcommon.js from latest build ( new version is always backward compatible )

I’ve verified that the latest build of dhtmlx (I purchased it just a couple days ago) contains different versions of  dhtmlxcommon.js:

: find . -name ‘dhtmlxcommon.js’ | xargs -i[F] ls -la [F]
-r–r--r--  1 vcm vcm 15736 May 19 14:39 ./dhtmlxSlider/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxCalendar/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15736 May 23 19:52 ./dhtmlxGrid/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxToolbar/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxTree/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxMenu/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxCombo/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxColorPicker/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxTabbar/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxFolders/codebase/dhtmlxcommon.js
-r–r--r--  1 vcm vcm 15505 May 19 14:39 ./dhtmlxWindows/codebase/dhtmlxcommon.js

Notice that Grid and Slider have different file sizes than the rest for this file.  Anyways, I’ll still go on what you said and just use one of these (opting for the more common 15505 byte version).

Thanks.

Notice that Grid and Slider have different file sizes than the rest for this file.
Yep, they have slightly different code formating which cause differnce in size, the functionality is exactly the same.