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

Martin Kutschker masi-no at spam-typo3.org
Tue Jan 13 17:40:04 CET 2009


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?

Masi


More information about the TYPO3-team-core mailing list