Modular loading of the Ext library

kiamlaluno - May 23, 2008 - 15:35
Project:Ext
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

ext-all.js is a big file to be uploaded on a low connection.
Would it be possible to change the module so that it loads single JavaScript files (the same files contained in the ext-2.1/source folder in the Ext archive)?

#1

ximo - May 24, 2008 - 01:03
Status:active» postponed (maintainer needs more info)

I was thinking the same thing, and I tried adding a setting that allowed you to choose which single components to load as you suggest (except from the build folder, those files are minified). But I read somewhere that Ext components need to be loaded in the right order because of dependency issues, so it would require a much more sofisticated UI than just a bunch of checkboxes (which is what I threw together).

Looking at how advanced the Build your own Ext JS widget is, I'm not entirely sure it's something I want to attempt to copy. People can build their own Ext library there anyway, drop it into the Ext folder and tell the module to use that one.

Or is there a real need for dynamical building of an Ext library from all available components that I'm missing?

#2

kiamlaluno - May 24, 2008 - 21:43

What I was thinking of it is a way to load the components of the Ext JS library, and not the full library which is very huge, even when it is minified.
My suggestion refers to a runtime way to load the components of the library third party modules would require, taking in consideration the dependencies between the single components. Just to make an example, a third party module could need the Ext core to add a namespace of functions to handle HTTP cookies.

Considering that the dependencies are declared on the source code of the library, it would be not difficult to write the needed code. That is what I was actually trying to do.

#3

kiamlaluno - May 25, 2008 - 02:28

Looking closer to the Ext JS library source code, I notice it's a little hard to track any dependences between the JavaScript files (and they aren't so well documented too).

#4

kiamlaluno - May 25, 2008 - 02:29
Status:postponed (maintainer needs more info)» active

#5

ximo - May 25, 2008 - 23:06

Aha, I was too focused on the end user, and not on the modules that may want to use this functionality.

Anyway, the dependencies are listed on the Build your own Ext JS widget, so what one could do is simply store the dependencies for each file in an array, and load the dependent files using this information. One issue that I can think of is that dependencies may change between versions of Ext, so one would need to accommodate this.

If you want to add this to the module, you're very much welcome to give it a try :)

I'll be busy with my Summer of Code project, and won't have time to work on this module for a while..

#6

ximo - May 27, 2008 - 23:50

Just a quick note that mikehostetler will continue the development of this module while I'm working on my SoC project. So you might see a solution for this during the summer :)

#7

kiamlaluno - July 27, 2008 - 05:26

Looking at the code of jquery.module, I think the same tattic can be used here.
The module should load the core code, and then any library more required from third party modules; it would be them to ask for the libraries in the right order, and taking in consideration any dependencies. In this way the module should not have to know any dependencies between the Ext JS libraries.

#8

apanag - June 19, 2009 - 20:37

Hello kiam,

i am the new developer of the Ext module. I saw your request and i agree with you. Its important to provide the new developers of such ways to interact with the ExtJS framework.
I saw the implementation of jquery.module from jquery_ui and i think its very simple to have such funtionality.
So i am going to add a function like that.

Thanks for your suggestion.
apanag

 
 

Drupal is a registered trademark of Dries Buytaert.