Quantcast

The resources plugin is not reloading my CSS and JS of a bundle

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

The resources plugin is not reloading my CSS and JS of a bundle

rosenfeld
Should I do anything special for getting my CSS and JS of the bundle to
be reloaded on each change when using the resources plugin?

For now, I need to restart the application for getting it to work. Is
there another way for forcing the plugin to process the files again?

Thanks in advance,

Rodrigo.

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

    http://xircles.codehaus.org/manage_email


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

Re: The resources plugin is not reloading my CSS and JS of a bundle

LE2
Try "touch"ing a page that uses the CSS.  I've had to do this to get the CSS to reload.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The resources plugin is not reloading my CSS and JS of a bundle

Marc Palmer Local
In reply to this post by rosenfeld

On 29 Sep 2011, at 19:36, Rodrigo Rosenfeld Rosas wrote:

> Should I do anything special for getting my CSS and JS of the bundle to be reloaded on each change when using the resources plugin?
>
> For now, I need to restart the application for getting it to work. Is there another way for forcing the plugin to process the files again?
>

It does support reload. You will need to wait for Grails to pick up the resource change, and you will need to make sure you aren't using a browser that caches stuff when it shouldn't - older IEs.

What resource files are you changing (what path within your app) and what type are they, are they declared or ad-hoc, what O/S do you have... ?

Also if you use debug mode - xxx?_debugResources=y it will bypass all processing.

Thanks
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: The resources plugin is not reloading my CSS and JS of a bundle

rosenfeld
Em 30-09-2011 09:17, Marc Palmer escreveu:
> On 29 Sep 2011, at 19:36, Rodrigo Rosenfeld Rosas wrote:
>
>> Should I do anything special for getting my CSS and JS of the bundle to be reloaded on each change when using the resources plugin?
>>
>> For now, I need to restart the application for getting it to work. Is there another way for forcing the plugin to process the files again?
>>
> It does support reload. You will need to wait for Grails to pick up the resource change, and you will need to make sure you aren't using a browser that caches stuff when it shouldn't - older IEs.

I've tested on both Chrome, Firefox and Opera. Same behavior in all of
them. How much should I wait before automatic reload to work? I've
already waited a long time after the change and it didn't reload
automatically. I'll probably have to install the cached-resources plugin
again in development mode for working around this issue. Here is the
thing, in development mode I must use the cached-resources plugin or my
assets won't update, but I need to remove it before generating the war
or the application won't work in IE due to the another issue I've
already commented with you. Too sad... :(

> What resource files are you changing (what path within your app) and what type are they, are they declared or ad-hoc, what O/S do you have... ?

All my assets are JavaScript and CSS and all of them are inside
web-app/js and web-app/css. The JavaScript files are automatically
generated by Jitter from CoffeeScript:

https://github.com/TrevorBurnham/Jitter

I use it this way:

jitter src/coffee web-app/js

My OS is a Debian Unstable Linux. What do you mean by if they are
declared or ad-hoc?

> Also if you use debug mode - xxx?_debugResources=y it will bypass all processing.

I'll try this param, thanks.

Best,

Rodrigo.


---------------------------------------------------------------------
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: The resources plugin is not reloading my CSS and JS of a bundle

Marc Palmer Local

On 30 Sep 2011, at 20:25, Rodrigo Rosenfeld Rosas wrote:

> Em 30-09-2011 09:17, Marc Palmer escreveu:
>> On 29 Sep 2011, at 19:36, Rodrigo Rosenfeld Rosas wrote:
>>
>>> Should I do anything special for getting my CSS and JS of the bundle to be reloaded on each change when using the resources plugin?
>>>
>>> For now, I need to restart the application for getting it to work. Is there another way for forcing the plugin to process the files again?
>>>
>> It does support reload. You will need to wait for Grails to pick up the resource change, and you will need to make sure you aren't using a browser that caches stuff when it shouldn't - older IEs.
>
> I've tested on both Chrome, Firefox and Opera. Same behavior in all of them. How much should I wait before automatic reload to work? I've already waited a long time after the change and it didn't reload automatically. I'll probably have to install the cached-resources plugin again in development mode for working around this issue. Here is the thing, in development mode I must use the cached-resources plugin or my assets won't update, but I need to remove it before generating the war or the application won't work in IE due to the another issue I've already commented with you. Too sad... :(
>

Debug mode will get you past this. However reloading works for others.

There must be some other factor about your environment.

>> What resource files are you changing (what path within your app) and what type are they, are they declared or ad-hoc, what O/S do you have... ?
>
> All my assets are JavaScript and CSS and all of them are inside web-app/js and web-app/css. The JavaScript files are automatically generated by Jitter from CoffeeScript:
>
> https://github.com/TrevorBurnham/Jitter
>
> I use it this way:
>
> jitter src/coffee web-app/js
>
> My OS is a Debian Unstable Linux. What do you mean by if they are declared or ad-hoc?
>

Well, this should not be a problem from what I can tell.

The plugin uses the standard file change detection mechanisms of Grails. It simply matches all files in web-app:

 def watchedResources = [
        "file:./grails-app/resourceMappers/**/*.groovy",
        "file:./plugins/*/grails-app/resourceMappers/**/*.groovy",
        "file:./grails-app/conf/*Resources.groovy",
        "file:./plugins/*/grails-app/conf/*Resources.groovy",
        "file:./web-app/**/*.*" // Watch for resource changes, we need excludes here for WEB-INF+META-INF when grails impls this
    ]

If we don't get a notification from grails, no reload can happen.

Please turn on full debug logging and load your app. Then clear your terminal output, change your file and save it. Within ~5s you should see a lot of debug info from Grails about reloading.

If this gives you debug output showing that Grails reloading is occurring when you save the file, look for output from the resources plugin too. There may be clues in there about why it is not reloading it.

However my guess is that Grails is not seeing the resource change, which is a deeper problem.

>> Also if you use debug mode - xxx?_debugResources=y it will bypass all processing.
>
> I'll try this param, thanks.


Please try the above also. We have no other pending reports of users not being able to reload edited resources.

Regards

~ ~ ~
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: The resources plugin is not reloading my CSS and JS of a bundle

rosenfeld
Indeed, the _debugResources=y fixed the problem in development mode.

The following script will generate a Grails application that fails to
reload automatically here:

https://raw.github.com/gist/1257438/instructions.sh

Setting 'root {debug()}' in log4j settings, I got this output after
changing 'test.js':

https://raw.github.com/gist/1257438/output.log


Does this help debugging what could be happening here?

Thanks,

Rodrigo.

Em 01-10-2011 10:26, Marc Palmer escreveu:

> On 30 Sep 2011, at 20:25, Rodrigo Rosenfeld Rosas wrote:
>
>> Em 30-09-2011 09:17, Marc Palmer escreveu:
>>> On 29 Sep 2011, at 19:36, Rodrigo Rosenfeld Rosas wrote:
>>>
>>>> Should I do anything special for getting my CSS and JS of the bundle to be reloaded on each change when using the resources plugin?
>>>>
>>>> For now, I need to restart the application for getting it to work. Is there another way for forcing the plugin to process the files again?
>>>>
>>> It does support reload. You will need to wait for Grails to pick up the resource change, and you will need to make sure you aren't using a browser that caches stuff when it shouldn't - older IEs.
>> I've tested on both Chrome, Firefox and Opera. Same behavior in all of them. How much should I wait before automatic reload to work? I've already waited a long time after the change and it didn't reload automatically. I'll probably have to install the cached-resources plugin again in development mode for working around this issue. Here is the thing, in development mode I must use the cached-resources plugin or my assets won't update, but I need to remove it before generating the war or the application won't work in IE due to the another issue I've already commented with you. Too sad... :(
>>
> Debug mode will get you past this. However reloading works for others.
>
> There must be some other factor about your environment.
>
>>> What resource files are you changing (what path within your app) and what type are they, are they declared or ad-hoc, what O/S do you have... ?
>> All my assets are JavaScript and CSS and all of them are inside web-app/js and web-app/css. The JavaScript files are automatically generated by Jitter from CoffeeScript:
>>
>> https://github.com/TrevorBurnham/Jitter
>>
>> I use it this way:
>>
>> jitter src/coffee web-app/js
>>
>> My OS is a Debian Unstable Linux. What do you mean by if they are declared or ad-hoc?
>>
> Well, this should not be a problem from what I can tell.
>
> The plugin uses the standard file change detection mechanisms of Grails. It simply matches all files in web-app:
>
>   def watchedResources = [
>          "file:./grails-app/resourceMappers/**/*.groovy",
>          "file:./plugins/*/grails-app/resourceMappers/**/*.groovy",
>          "file:./grails-app/conf/*Resources.groovy",
>          "file:./plugins/*/grails-app/conf/*Resources.groovy",
>          "file:./web-app/**/*.*" // Watch for resource changes, we need excludes here for WEB-INF+META-INF when grails impls this
>      ]
>
> If we don't get a notification from grails, no reload can happen.
>
> Please turn on full debug logging and load your app. Then clear your terminal output, change your file and save it. Within ~5s you should see a lot of debug info from Grails about reloading.
>
> If this gives you debug output showing that Grails reloading is occurring when you save the file, look for output from the resources plugin too. There may be clues in there about why it is not reloading it.
>
> However my guess is that Grails is not seeing the resource change, which is a deeper problem.
>
>>> Also if you use debug mode - xxx?_debugResources=y it will bypass all processing.
>> I'll try this param, thanks.
>
> Please try the above also. We have no other pending reports of users not being able to reload edited resources.
>
> Regards
>
> ~ ~ ~
> 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: The resources plugin is not reloading my CSS and JS of a bundle

iamsteveholmes
Sorry where do I put _debugResources=y?  I've been using grails.resources.debug=true in the development block in Config.groovy.

My problems are with javascript and image files that are deeply nested under web-app.

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

Re: The resources plugin is not reloading my CSS and JS of a bundle

iamsteveholmes
I've tried doing both and neither worked.  Our work around is to disable cacheing using firefox's web dev toolbar.  But there has got to be a better solution for this.  Please let me know what I can send you to help out with this effort.

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

Re: The resources plugin is not reloading my CSS and JS of a bundle

rosenfeld
In reply to this post by iamsteveholmes
I passed this parameter in the URL of the page I was viewing.

I agree that this should be configured in Config.groovy instead of
messing with the request params...

Em 04-10-2011 14:42, iamsteveholmes escreveu:
> Sorry where do I put _debugResources=y?  I've been using
> grails.resources.debug=true in the development block in Config.groovy.
>
> My problems are with javascript and image files that are deeply nested under
> web-app.
>
> Thanks!


---------------------------------------------------------------------
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: The resources plugin is not reloading my CSS and JS of a bundle

iamsteveholmes
I tried that but it isn't working for me.
Loading...