[TYPO3-project-4-3] copy all JS code to typo3temp

Franz Koch typo.removeformessage at fx-graefix.de
Tue May 26 13:18:23 CEST 2009


Hi Steffen,

>>> flexible, just like you want. I started with backend.php to test it.
>>> I attach the class i use so you get the idea how it's done. It's not 
>>> final version, eg for FE extension the version of extension has to be 
>>> taken into account, so maybe one more property for building the hash.
>>
>> As it's a file-merger, maybe you provide different models for handling 
>> different output types. E.g. one for JS and one for CSS - each one 
>> capable of processing and minifying the respective contents.
> 
> I don't get it. You can use it for js or css or any other files. The 
> class is low-level, has a property for the fileExtension, it only merge 
> and minify (if set), so what would be a difference?

for minifying you're calling t3lib_div::minifyJavaScript - I was not 
aware that this is also correctly minifying CSS. That's why I suggested 
to maybe use a lightweight MVC approach here and have every model taking 
care of merging and minifying itself to keep things clean. This way you 
can also easily extend the functionality of t3lib_filemerge by simply 
providing a services based model for the new filetype and use 
t3lib_filemerge right away in your extension.

>> Maybe even ZIP or TAR might be suitable models - they're also 
>> "merging" somehow ;) Or if you think about PDF-documents - those could 
>> also be merged. Perfect would be if it would be SERVICE-driven, so 
>> that you can register services for different filetypes.
> 
> ok, my first idea was the simple merge of js / css. This is also 
> limited, as when you add prototype/extJs to this it will be too memory 
> consuming, so it works well for the typo3/js - files or t3skin css files
> 
> 
> Which advantage you see in having this as service?

The advantage would be that if you're f.e. having yui-compressor running 
on the server, you could install the yui-compressor aware JS-model (as 
service with higher priority) that would then be used for minifying etc. 
It simply adds a lot more flexibility and is implemented quite fast 
(easier then a hook -> t3lib_div::makeInstanceService(...)).

-- 
kind regards,
Franz Koch

---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------


More information about the TYPO3-project-4-3 mailing list