On Thu, May 2, 2013 at 3:53 PM, Vincent Massol <[email protected]> wrote:
> Hi devs,
>
> ATM the solution is described here:
> http://dev.xwiki.org/xwiki/bin/view/Community/Debugging#HDebuggingJavaScript
>
> What would you think about doing this instead:
> * Package both the minimized and the non minimized version in our WAR (it
> shouldn't add too much weight to our overall WAR size)
> * Have a directory structure like this:
>
> resources/.../<module>/
> |_ <non minified js file here>
> |_ min/<minified js files here>
The "min" folder is an overhead IMO. I prefer to place the minified
file in the same folder, with a suffix to distinguish it.
>
> * This would allow to put in our xwikivars.vm something like (pseudo code):
>
> #if ("$!request.minify" == 'false')
> #set ($jsDir = '/')
> #else
> #set ($jsDir = 'min/'
> #end
#set ($js = '-min.js')
#if ("$!request.minify" == 'false')
#set ($js = '.js')
#end
## Or $jsSuffix, but as you can see below $js reads better:
>
> * Then everywhere we reference JS files we use $jsDir. For example in
> attachmentsinline.vm:
>
> $xwiki.jsfx.use('uicomponents/widgets/${jsDir}upload.js', {'forceSkinAction':
> true, 'language': ${xcontext.language}})
$xwiki.jsfx.use("uicomponents/widgets/upload$js", {'forceSkinAction':
true, 'language': ${xcontext.language}})
Thanks,
Marius
> …
>
> This would allow to remove the "debug" profile and make it much faster to
> debug XWiki issues, even in production systems.
>
> WDYT?
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs