Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Konstantinos Kostarellis
When I add the 2 resources plugins:

compile ":lesscss-resources:0.6.1"
compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ? 

Thnx,
   Kosta


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Konstantinos Kostarellis
Is someone using resources like this ? 
Is there somebody experiencing similar problems ?


2011/10/24 Konstantinos Kostarellis <[hidden email]>
When I add the 2 resources plugins:

compile ":lesscss-resources:0.6.1"
compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error <a href="tel:2011-10-24%2015" value="+492011102415" target="_blank">2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ? 

Thnx,
   Kosta



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Marc Palmer Local

On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote:

> Is someone using resources like this ?
> Is there somebody experiencing similar problems ?
>
>
> 2011/10/24 Konstantinos Kostarellis <[hidden email]>
> When I add the 2 resources plugins:
>
> compile ":lesscss-resources:0.6.1"
> compile ":yui-minify-resources:0.1.2"
>
> in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
> I get the following error messages at startup-time (run-app).
>
> | Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.
>
> The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.
>
> Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.
>
> Any experts on resources ? Marc ?

Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Carsten Block
Hi Kosta,

sorry for my late reply. Today I tried out combinging less-css resources and yui-minify-resources and it works fine for me. Please find my sample application at: https://github.com/cblock/yui-minify-resources/downloads

In that app I installed the following plugins:

* resources 1.1.1
* yui-minify-resources 0.1.4
* lesscss-resources 0.6.1
* twitter-bootstrap 1.4.0.12
* enhanced-scaffolding 1.0.RC2

Also, I added the following two lines to Config.groovy:
grails.resources.mappers.yuicssminify.includes = ['**/*.less','**/*.css']
grails.resources.mappers.lesscss.excludes = ['**/*.css','**/*.js','**/*.png','**/*.gif','**/*.jpg','**/*.jpeg','**/*.gz','**/*.zip']


Note: twitter-bootstrap uses the less version of the framework as soon as lesscss-resources is installed, and enhanced-scaffolding provides several uncompressed js files. When running the app, all files are correctly transformed / packaged / minified - at least on my computer.

So maybe your problem stems from your own javascript file? Try minifying the file manually using the yui-compressor lib or an online service such as http://www.refresh-sf.com/yui/. Also, you might want to set the log level for the resource mappers in your application to debug to better trace the mapping process:

Config.groovy:
debug 'org.grails.plugin.resource',
      'org.grails.plugin.resource.yuijsminify',
      'org.grails.plugin.resource.yuicssminify',

Best,
Carsten




----- Ursprüngliche Mail -----
Von: "Marc Palmer" <[hidden email]>
An: [hidden email]
Gesendet: Donnerstag, 27. Oktober 2011 13:51:59
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)


On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote:

> Is someone using resources like this ?
> Is there somebody experiencing similar problems ?
>
>
> 2011/10/24 Konstantinos Kostarellis <[hidden email]>
> When I add the 2 resources plugins:
>
> compile ":lesscss-resources:0.6.1"
> compile ":yui-minify-resources:0.1.2"
>
> in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
> I get the following error messages at startup-time (run-app).
>
> | Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.
>
> The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.
>
> Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.
>
> Any experts on resources ? Marc ?

Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Frank-4
Hi Carsten

thanks a lot for having a look at this.

I just downloaded and tested your sample application, but for me, the yuiminifyresources.YuiJsMinifyResourceMapper throws some errors.

Here are some sample errors:
| Error 2011-11-11 02:27:10,274 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.alerts.loader.js]: null Set log level to warn for more details.
| Error 2011-11-11 02:27:10,286 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.forms.js]: null Set log level to warn for more details.
| Error 2011-11-11 02:27:10,291 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.fouc.js]: null Set log level to warn for more details.

These errors are reported for all twitter-bootstrap and enhanced-scaffolding js files.

The included /yuiminify20/static/bundle-scaffolding_defer.js js file contains no minified js code

I'm running Fedora 16/64bit

Best, Frank

On 11/10/2011 07:19 PM, Carsten A. Block wrote:
Hi Kosta,

sorry for my late reply. Today I tried out combinging less-css resources and yui-minify-resources and it works fine for me. Please find my sample application at: https://github.com/cblock/yui-minify-resources/downloads

In that app I installed the following plugins:

* resources 1.1.1
* yui-minify-resources 0.1.4
* lesscss-resources 0.6.1
* twitter-bootstrap 1.4.0.12
* enhanced-scaffolding 1.0.RC2

Also, I added the following two lines to Config.groovy:
grails.resources.mappers.yuicssminify.includes = ['**/*.less','**/*.css']
grails.resources.mappers.lesscss.excludes = ['**/*.css','**/*.js','**/*.png','**/*.gif','**/*.jpg','**/*.jpeg','**/*.gz','**/*.zip']


Note: twitter-bootstrap uses the less version of the framework as soon as lesscss-resources is installed, and enhanced-scaffolding provides several uncompressed js files. When running the app, all files are correctly transformed / packaged / minified - at least on my computer.

So maybe your problem stems from your own javascript file? Try minifying the file manually using the yui-compressor lib or an online service such as http://www.refresh-sf.com/yui/. Also, you might want to set the log level for the resource mappers in your application to debug to better trace the mapping process:

Config.groovy:
debug 'org.grails.plugin.resource',
      'org.grails.plugin.resource.yuijsminify',
      'org.grails.plugin.resource.yuicssminify',

Best,
Carsten




----- Ursprüngliche Mail -----
Von: "Marc Palmer" [hidden email]
An: [hidden email]
Gesendet: Donnerstag, 27. Oktober 2011 13:51:59
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)


On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote:

Is someone using resources like this ? 
Is there somebody experiencing similar problems ?


2011/10/24 Konstantinos Kostarellis [hidden email]
When I add the 2 resources plugins:

		compile ":lesscss-resources:0.6.1"
		compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ? 
Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Carsten Block
Hi Frank,

thanks for your report. I can't replicate that on my Mac right now and I will be out of office for two weeks starting this evening. If you can provide me with more detailes errors (stacktraces), I'll promise to look into that issue once I'm back.

Cheers,
Carsten


----- Ursprüngliche Mail -----

Von: "Frank" <[hidden email]>
An: [hidden email]
Gesendet: Freitag, 11. November 2011 03:36:19
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Hi Carsten

thanks a lot for having a look at this.

I just downloaded and tested your sample application, but for me, the yuiminifyresources.YuiJsMinifyResourceMapper throws some errors.

Here are some sample errors:
| Error 2011-11-11 02:27:10,274 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.alerts.loader.js]: null Set log level to warn for more details.
| Error 2011-11-11 02:27:10,286 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.forms.js]: null Set log level to warn for more details.
| Error 2011-11-11 02:27:10,291 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.fouc.js]: null Set log level to warn for more details.

These errors are reported for all twitter-bootstrap and enhanced-scaffolding js files.

The included /yuiminify20/static/bundle-scaffolding_defer.js js file contains no minified js code

I'm running Fedora 16/64bit

Best, Frank

On 11/10/2011 07:19 PM, Carsten A. Block wrote:

Hi Kosta,

sorry for my late reply. Today I tried out combinging less-css resources and yui-minify-resources and it works fine for me. Please find my sample application at: https://github.com/cblock/yui-minify-resources/downloads In that app I installed the following plugins:

* resources 1.1.1
* yui-minify-resources 0.1.4
* lesscss-resources 0.6.1
* twitter-bootstrap 1.4.0.12
* enhanced-scaffolding 1.0.RC2

Also, I added the following two lines to Config.groovy:
grails.resources.mappers.yuicssminify.includes = ['**/*.less','**/*.css']
grails.resources.mappers.lesscss.excludes = ['**/*.css','**/*.js','**/*.png','**/*.gif','**/*.jpg','**/*.jpeg','**/*.gz','**/*.zip']


Note: twitter-bootstrap uses the less version of the framework as soon as lesscss-resources is installed, and enhanced-scaffolding provides several uncompressed js files. When running the app, all files are correctly transformed / packaged / minified - at least on my computer.

So maybe your problem stems from your own javascript file? Try minifying the file manually using the yui-compressor lib or an online service such as http://www.refresh-sf.com/yui/ . Also, you might want to set the log level for the resource mappers in your application to debug to better trace the mapping process:

Config.groovy:
debug 'org.grails.plugin.resource',
      'org.grails.plugin.resource.yuijsminify',
      'org.grails.plugin.resource.yuicssminify',

Best,
Carsten




----- Ursprüngliche Mail -----
Von: "Marc Palmer" <[hidden email]> An: [hidden email] Gesendet: Donnerstag, 27. Oktober 2011 13:51:59
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)


On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote:
<blockquote>
Is someone using resources like this ?
Is there somebody experiencing similar problems ?


2011/10/24 Konstantinos Kostarellis <[hidden email]> When I add the 2 resources plugins:

                compile ":lesscss-resources:0.6.1"
                compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ?

Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org Member @ http://spottymushroom.com | Contributor @ http://grails.org Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/ Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
</blockquote>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Frank-4
Hi Carsten

thanks for having a look at this again once you're back

So far, I could find out 2 more things:

A) the dependency report lists a duplication rhino jar versions

I solved this issue by adding the following exclusion in your sample project
compile(":lesscss-resources:0.6.1") {
               excludes "js"
}

B)  A
fter resolving the rhino jar issue, the minification works correctly when the project runs with run-app for the first time.  But strangely, when I stop it and rerun run-app, then I get error messages, again, such as:

Error 2011-11-12 06:26:37,324 [Thread-8] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.alerts.js]: String index out of range: 720 Set log level to warn for more details.

When I delete the /home/liefra/.grails/2.0.0.RC1/projects/yuiminify20 folder and rerun, then it works correct again.

Let's see what else we can find out

Cheers, Frank

On 11/11/2011 09:57 PM, Carsten A. Block wrote:
Hi Frank,

thanks for your report. I can't replicate that on my Mac right now and I will be out of office for two weeks starting this evening. If you can provide me with more detailes errors (stacktraces), I'll promise to look into that issue once I'm back.

Cheers,
Carsten


----- Ursprüngliche Mail ----- 

Von: "Frank" [hidden email] 
An: [hidden email] 
Gesendet: Freitag, 11. November 2011 03:36:19 
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems) 

Hi Carsten 

thanks a lot for having a look at this. 

I just downloaded and tested your sample application, but for me, the yuiminifyresources.YuiJsMinifyResourceMapper throws some errors. 

Here are some sample errors: 
| Error 2011-11-11 02:27:10,274 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.alerts.loader.js]: null Set log level to warn for more details. 
| Error 2011-11-11 02:27:10,286 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.forms.js]: null Set log level to warn for more details. 
| Error 2011-11-11 02:27:10,291 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.fouc.js]: null Set log level to warn for more details. 

These errors are reported for all twitter-bootstrap and enhanced-scaffolding js files. 

The included /yuiminify20/static/bundle-scaffolding_defer.js js file contains no minified js code 

I'm running Fedora 16/64bit 

Best, Frank 

On 11/10/2011 07:19 PM, Carsten A. Block wrote: 

Hi Kosta,

sorry for my late reply. Today I tried out combinging less-css resources and yui-minify-resources and it works fine for me. Please find my sample application at: https://github.com/cblock/yui-minify-resources/downloads In that app I installed the following plugins:

* resources 1.1.1
* yui-minify-resources 0.1.4
* lesscss-resources 0.6.1
* twitter-bootstrap 1.4.0.12
* enhanced-scaffolding 1.0.RC2

Also, I added the following two lines to Config.groovy:
grails.resources.mappers.yuicssminify.includes = ['**/*.less','**/*.css']
grails.resources.mappers.lesscss.excludes = ['**/*.css','**/*.js','**/*.png','**/*.gif','**/*.jpg','**/*.jpeg','**/*.gz','**/*.zip']


Note: twitter-bootstrap uses the less version of the framework as soon as lesscss-resources is installed, and enhanced-scaffolding provides several uncompressed js files. When running the app, all files are correctly transformed / packaged / minified - at least on my computer.

So maybe your problem stems from your own javascript file? Try minifying the file manually using the yui-compressor lib or an online service such as http://www.refresh-sf.com/yui/ . Also, you might want to set the log level for the resource mappers in your application to debug to better trace the mapping process:

Config.groovy:
debug 'org.grails.plugin.resource',
      'org.grails.plugin.resource.yuijsminify',
      'org.grails.plugin.resource.yuicssminify',

Best,
Carsten




----- Ursprüngliche Mail -----
Von: "Marc Palmer" [hidden email] An: [hidden email] Gesendet: Donnerstag, 27. Oktober 2011 13:51:59
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)


On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote: 
<blockquote>
Is someone using resources like this ? 
Is there somebody experiencing similar problems ?


2011/10/24 Konstantinos Kostarellis [hidden email] When I add the 2 resources plugins:

		compile ":lesscss-resources:0.6.1"
		compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ? 

Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org Member @ http://spottymushroom.com | Contributor @ http://grails.org Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/ Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email 
</blockquote>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

Frank-4
In reply to this post by Carsten Block
I just wanted to follow up on this thread. It works now for me, using the latest resources plugin 1.1.4

Cheers and Thanks
Frank

On 11/11/2011 09:57 PM, Carsten A. Block wrote:
Hi Frank,

thanks for your report. I can't replicate that on my Mac right now and I will be out of office for two weeks starting this evening. If you can provide me with more detailes errors (stacktraces), I'll promise to look into that issue once I'm back.

Cheers,
Carsten


----- Ursprüngliche Mail ----- 

Von: "Frank" [hidden email] 
An: [hidden email] 
Gesendet: Freitag, 11. November 2011 03:36:19 
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems) 

Hi Carsten 

thanks a lot for having a look at this. 

I just downloaded and tested your sample application, but for me, the yuiminifyresources.YuiJsMinifyResourceMapper throws some errors. 

Here are some sample errors: 
| Error 2011-11-11 02:27:10,274 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.alerts.loader.js]: null Set log level to warn for more details. 
| Error 2011-11-11 02:27:10,286 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.forms.js]: null Set log level to warn for more details. 
| Error 2011-11-11 02:27:10,291 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper - Stopped minifying [/home/liefra/.grails/2.0.0.RC1/projects/yuiminify20/tomcat/work/Tomcat/localhost/yuiminify20/grails-resources/plugins/enhanced-scaffolding-1.0.RC2/js/grails.fouc.js]: null Set log level to warn for more details. 

These errors are reported for all twitter-bootstrap and enhanced-scaffolding js files. 

The included /yuiminify20/static/bundle-scaffolding_defer.js js file contains no minified js code 

I'm running Fedora 16/64bit 

Best, Frank 

On 11/10/2011 07:19 PM, Carsten A. Block wrote: 

Hi Kosta,

sorry for my late reply. Today I tried out combinging less-css resources and yui-minify-resources and it works fine for me. Please find my sample application at: https://github.com/cblock/yui-minify-resources/downloads In that app I installed the following plugins:

* resources 1.1.1
* yui-minify-resources 0.1.4
* lesscss-resources 0.6.1
* twitter-bootstrap 1.4.0.12
* enhanced-scaffolding 1.0.RC2

Also, I added the following two lines to Config.groovy:
grails.resources.mappers.yuicssminify.includes = ['**/*.less','**/*.css']
grails.resources.mappers.lesscss.excludes = ['**/*.css','**/*.js','**/*.png','**/*.gif','**/*.jpg','**/*.jpeg','**/*.gz','**/*.zip']


Note: twitter-bootstrap uses the less version of the framework as soon as lesscss-resources is installed, and enhanced-scaffolding provides several uncompressed js files. When running the app, all files are correctly transformed / packaged / minified - at least on my computer.

So maybe your problem stems from your own javascript file? Try minifying the file manually using the yui-compressor lib or an online service such as http://www.refresh-sf.com/yui/ . Also, you might want to set the log level for the resource mappers in your application to debug to better trace the mapping process:

Config.groovy:
debug 'org.grails.plugin.resource',
      'org.grails.plugin.resource.yuijsminify',
      'org.grails.plugin.resource.yuicssminify',

Best,
Carsten




----- Ursprüngliche Mail -----
Von: "Marc Palmer" [hidden email] An: [hidden email] Gesendet: Donnerstag, 27. Oktober 2011 13:51:59
Betreff: Re: [grails-user] Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)


On 27 Oct 2011, at 09:37, Konstantinos Kostarellis wrote: 
<blockquote>
Is someone using resources like this ? 
Is there somebody experiencing similar problems ?


2011/10/24 Konstantinos Kostarellis [hidden email] When I add the 2 resources plugins:

		compile ":lesscss-resources:0.6.1"
		compile ":yui-minify-resources:0.1.2"

in the projects BuildConfig.groovy the minification of JavaScript-Files is broken.
I get the following error messages at startup-time (run-app).

| Error 2011-10-24 15:35:15,799 [Thread-9] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/home/kosta/.grails/2.0.0.RC1/projects/MProj/tomcat/work/Tomcat/localhost/MProj/grails-resources/js/application.js]: null Set log level to warn for more details.

The result is that the js - file is not minified. Thats odd cause less doesn't do anything with JavaScript files.

Besides I couln't get them working together even thou, they seem to be working in the right mapper phases.

Any experts on resources ? Marc ? 

Hi Kosta,

I haven't tried those two plugins together yet I'm afraid.

Did you set log level to "warn" as instructed - what did it say? It looks like something from the YUI minifier. Perhaps it is processing before "less" and choking on the syntax of the files?

Marc

~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)

Founder @ http://noticelocal.com | Developer @ http://weceem.org Member @ http://spottymushroom.com | Contributor @ http://grails.org Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/ Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email ---------------------------------------------------------------------
To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email 
</blockquote>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

OverZealous
I hate to dredge up this old thread, but I'm seeing this exact issue, using the latest plugins:

Error:
| Error 2012-02-15 16:38:19,075 [pool-5-thread-1] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/Users/phil/.grails/2.0.1/projects/gt2/tomcat/work/Tomcat/localhost/gt2/grails-resources/js/application.js]: null Set log level to warn for more details.
| Error 2012-02-15 16:38:20,157 [pool-5-thread-1] ERROR yuiminifyresources.YuiJsMinifyResourceMapper  - Stopped minifying [/Users/phil/.grails/2.0.1/projects/gt2/tomcat/work/Tomcat/localhost/gt2/grails-resources/bundle-bundle_application_defer.js]: null Set log level to warn for more details.

    runtime ":resources:1.1.6"
    runtime ":yui-minify-resources:0.1.4"
    compile ":lesscss-resources:1.0.1"

Setting log level to warn for just yui-minify does not provide additional information.  Setting the log level to debug for resources is overwhelming, to say the least, but did not appear to have any new information related to the Yui error.

If I try to add excludes "js" to lesscss, the less plugin fails completely with an error about missing the Rhino classes. Adding the list of includes and excludes to the Config.groovy did not help.

As far as I can tell, these two plugins just use incompatible versions of Rhino, and if they are both installed, it will fail.  The Rhino in YUI is embedded in the yuicompressor-2.4.6.jar file, while Less pulls it in via maven.

Has anyone else gotten them to play nicely?  (Grails plugins being a form of Jar-hell is bad enough, but even within plugin categories like Resources gets old quick...)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resources Plugins (lesscss-resources + yui-minify-resources = JavaScript-Minify-Problems)

mikelilin
In reply to this post by Konstantinos Kostarellis
you can try this free online js minifier to reduce your js file size.
Loading...