[TYPO3-core] RFC: #10069: Feature: Function for including extJS in Backend module

Steffen Kamper info at sk-typo3.de
Mon Jan 12 10:53:27 CET 2009


Hi,

Martin Kutschker schrieb:
> Steffen Kamper schrieb:
> 
>>> BTW, what happens if two scripts call this function with different
>>> options? I think that extJS will be included twice as the JS/CSS loader
>>> APIs will treat the included files as different.
>>>
>> In genereal a second call only adds the missing part.
> 
> How come?
>
because inclusion is done inside with loadJavascriptLib(path), you can't 
change the path from outside, so inclusion will be done only once.
It's only add to the arry before rendering the header.

>> First call without
>> adapter, second with adapter will only add the adapter.
> 
> The the adapter will be loaded AFTER the main code, which must not
> happen. BTW, I doubt that you can use more then one adapter at the same
> time, but I didn't check the extJS docs.
> 

second call doesn't change load order, adapter will be included always 
as first, see above.

>>> this should throw an exception
>>>
>> there is imho no reason for. Remember that this is used for modules, who
>> should call it a second time?
> 
> I'm just about to write some code for a custom TCA field that needs to
> load extJS. Now what happens if another extensions adds another custom
> field to the same table but loads extJS differently.
> 
> Even in the BE it is not guaranteed that any given resource is loaded
> only once. There are hooks all over the place, so any BE code developer
> must be aware of other extensions that might load resources.
> 

I will test it again with more calls and different ones, but i'm quite 
sure that it won't be included twice.

> 
>> At the moment we don't have the compressed version. I know from own
>> expieriences that it's not easy to compress extJS - the minifier won't
>> work.
> 
> I found minified files in the build directory of extJS.
> 
you mean in build-directory? That is something new since 2.1 or so, i 
didn't checked yet. I'm not sure they are the same as in source, but i 
will check that. If so we should include minified in core too. In my 
remember there waere huge discussion in extJs-forum about compressing 
extJS, but this is some months ago.


vg Steffen


More information about the TYPO3-team-core mailing list