Open ifedotov opened 11 years ago
Is that the exact definition that is timing out on dependency calculation? This seems very odd to me - I know that there are people who use a dependency file 1000s of lines long.
I agree though, I think a fourth minify mode that enables you to hand-craft the minified concatenated files would be great, something like:
mobilecore
/core/reset.less
/core/mobile/mobile.less
...
core
/core/reset.less
/core/layout.less
/jqueryui/ui.less
Also, it looks to me like you are specifying that jquery.validate.js depends on jquery.zoom.js (though it is hard to tell because your indentation has been lost - hint: put four spaces in front of all your code-block lines for appropriate syntax rendering). Surely it does not truly depend on that? the dependency file is for declaring true dependencies, if they are specified correctly, the order of the files should come out in a way that lets the js work.
I fixed the indent in the example. The file that timed out would be about twice that long. I used indent to basically make sure the files are included in the order that they were before using cfstatic so every other line should be indented. Yes some of these are probably not true dependencies. Also I am pretty sure that its dependency processing that takes a long time because if I flatten the file it's very quick. I started pocking around in the code to see if I could short circuit somewhere to force it to output based on order in dependency file but time is short right now and the package part is somewhat complex.
great work on this btw
;) thanks. Your best bet to get this up and running in your desired order very quickly, is to rename the files by prepending and order number on them, e.g.
010_bootstrap.js
020_jquery.ui.js
030_another.js
Not pretty, but dead quick. CfStatic will order files alphabetically (case insensitive) when there is no dependency info.
I'll take a look at the performance issue asap. Manual packaging specifications is something I definitely want to implement too - very useful for a lot of people I think (and easier to get your head around).
Dominic
"CfStatic will order files alphabetically (case insensitive) when there is no dependency info."
Why?
If there is no dependency info, it should simply include them in the order they are included in,
Also getting what I assume is the same issue as ifedotov - a java.lang.StackOverflowError when trying to use a JS dependency file with 29 items in - there is an infinite recursion loop in getDependencies.
java.lang.StackOverflowError at java.util.Random.nextInt(Random.java:239) at sun.misc.Hashing.randomHashSeed(Hashing.java:254) at java.util.HashMap.
(HashMap.java:255) at java.util.HashMap. (HashMap.java:305) at coldfusion.runtime.LocalScope. (LocalScope.java:29) at coldfusion.runtime.NeoPageContext.pushNewFunctionLocalScope(NeoPageContext.java:1698) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:460) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfStaticFile2ecfc1222477987$funcGETDEPENDENCIES.runFunction( \lib\cfstatic\core\StaticFile.cfc:61) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfStaticFile2ecfc1222477987$funcGETDEPENDENCIES.runFunction( \lib\cfstatic\core\StaticFile.cfc:61) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at
The StackOverflowError appears to occur when a file in a directory is dependent on one that isn't.
i.e. this causes the error:
bootstrap-modal.js
tabdrop/bootstrap-tabdrop.js
tabdrop/bootstrap-tabdrop.js
bootstrap-editable.min.js
bootstrap-editable.min.js
jquery.dataTables.min.js
jquery.dataTables.min.js
highstock.js
This doesn't:
bootstrap-modal.js
bootstrap-editable.min.js
bootstrap-editable.min.js
jquery.dataTables.min.js
jquery.dataTables.min.js
highstock.js
This also doesn't:
bootstrap-modal.js
tabdrop/bootstrap-tabdrop.js
bootstrap-editable.min.js
jquery.dataTables.min.js
tabdrop/bootstrap-tabdrop.js
jquery.dataTables.min.js
highstock.js
The error seems to be package related, despite packages not being used (issue occurs for both MinifyMode="all"
and MinifyMode="file"
).
(There are multiple instances of files in directories here, and the dependency file is generated, so simply re-ordering the dependencies isn't a solution.)
Again, the only reason for this dependency file to exist is to enforce the specified order of the files - modifying or renaming files is not a solution. Maintaining the order the files were included in would make the issue go away.
I'll have a look at the recursion issue.
Compilation, concatenation and minification of files happens completely independently of request includes and concatenation order cannot therefore be dictated by the order of include() calls.
As for the ordering of the includes themselves, I have had no need for what you presume should happen and so have not yet implemented it yet. More options will become available though as folk request them. I believe I have responded to that effect elsewhere on this ordering issue.
It would be great if I could list the files in dependency list and have them minified or outputted in that order. Current dependency processing takes a long time (to the point of CF timing out) when forced to specify order for say 20 files in following way: