[TYPO3-core] RFC: #10122: loadJavascriptLib needs second param to be unique

Steffen Kamper info at sk-typo3.de
Tue Jan 13 17:52:49 CET 2009


Hi Masi,

Martin Kutschker schrieb:
> Steffen Kamper schrieb:
>> Hey Masi,
>>
>> Martin Kutschker schrieb:
>>> Furthermore Prototype must be loaded before the adapter. And the adapter
>>> must be loaded before the main extJS library.
>>>
>>> What happens if Prototype is loaded, but the Prototype adapater isn't?
>>>
>>> Bah, working with automated code with more than one lib in a context
>>> where anybody may add stuff (jQuery anyone) isn't easy :( I'm thinking
>>> about a loadPrototype() function, so that the correct adaper is used and
>>> all libs are loaded in the required order.
>>>
>> :-) yes of coarse it's not easy.
>> But using the (right) names here may help
>>
>> first: load prototype if any ($this->JScodeLibArray['prototype'])
>> second: load ExtJS ( $this->JScodeLibArray['ext-adapter'],
>> $this->JScodeLibArray['extJS'])
>> third: load the rest
> 
> The problem as I see is that there no guarantee that will happen. I
> envisage extension A that adds a Prototype feature to the BE, extension
> B uses extJS and extension C uses jQuery.
> 
> Depending on the code excution (defined by load order and code flow of
> the hooks) the library inclusion calls will be made. The result is a mess.
> 
> I have a plan to enhance standard TCA "select" types with an extJS tree
> selector (for tables with a parent relationsship) and a combo box with
> autocomplete/typeahead. How can it be guaranteed that any code dependent
> on Prototyope is called earlier?
> 

there is only one condition: prototype has to be load before extjs 
because of the adapter. Any other library can be loaded after without 
problems. So this is the only thing we have to look for, this was also 
my intention to use a special function for loading extJS.

vg Steffen


More information about the TYPO3-team-core mailing list