alexo / wro4j

New project location is:https://github.com/wro4j/wro4j
442 stars 110 forks source link

Grails plugin is not detecting changes in resources #149

Closed genuinefafa closed 11 years ago

genuinefafa commented 11 years ago

I'm not sure if it is something related with my configuration or what, but I change files and are not detected by wro4j, therefore, they are not recompiled/updated and sent to the browser updated.

I need to restart the application. :(

This is the startup log of my grails app.

ro.isdc.wro.config.factory.PropertyWroConfigurationFactory WroConfiguration created: ro.isdc.wro.config.jmx.WroConfiguration@4b41ceef[
  cacheUpdatePeriod=0
  modelUpdatePeriod=0
  resourceWatcherUpdatePeriod=0
  gzipEnabled=true
  debug=true
  ignoreMissingResources=true
  disableCache=false
  cacheGzippedContent=false
  jmxEnabled=true
  wroManagerClassName=wro4j.grails.plugin.GrailsWroManagerFactory
  encoding=UTF-8
  mbeanName=<null>
  header=<null>
  connectionTimeout=2000
  parallelPreprocessing=false
  ignoreEmptyGroup=true
  ignoreFailingProcessor=false
  minimizeEnabled=true
]
ro.isdc.wro.http.WroServletContextListener initializing attributeHelper named: default
ro.isdc.wro.http.WroServletContextListener Loaded managerFactory: class wro4j.grails.plugin.GrailsWroManagerFactory
ro.isdc.wro.http.WroServletContextListener setting attribute: CONFIGURATION with value: ro.isdc.wro.config.jmx.WroConfiguration@4b41ceef[
  cacheUpdatePeriod=0
  modelUpdatePeriod=0
  resourceWatcherUpdatePeriod=0
  gzipEnabled=true
  debug=true
  ignoreMissingResources=true
  disableCache=false
  cacheGzippedContent=false
  jmxEnabled=true
  wroManagerClassName=wro4j.grails.plugin.GrailsWroManagerFactory
  encoding=UTF-8
  mbeanName=<null>
  header=<null>
  connectionTimeout=2000
  parallelPreprocessing=false
  ignoreEmptyGroup=true
  ignoreFailingProcessor=false
  minimizeEnabled=true
]
ro.isdc.wro.http.WroServletContextListener setting attribute: MANAGER_FACTORY with value: wro4j.grails.plugin.GrailsWroManagerFactory@1ca13466
ro.isdc.wro.util.provider.ProviderFinder searching for providers of type : interface ro.isdc.wro.http.handler.spi.RequestHandlerProvider
ro.isdc.wro.util.provider.ProviderFinder using java.util.ServiceLoader to lookupProviders
ro.isdc.wro.util.provider.ProviderFinder searching for providers of type : interface ro.isdc.wro.util.provider.ConfigurableProvider
ro.isdc.wro.util.provider.ProviderFinder using java.util.ServiceLoader to lookupProviders
ro.isdc.wro.util.provider.ProviderFinder found provider: ro.isdc.wro.extensions.support.spi.DefaultConfigurableProvider@5a412c79
ro.isdc.wro.util.provider.ProviderFinder found provider: ro.isdc.wro.util.provider.DefaultConfigurableProvider@52ce14f6
ro.isdc.wro.http.handler.factory.DefaultRequestHandlerFactory using provider: ro.isdc.wro.extensions.support.spi.DefaultConfigurableProvider@5a412c79
ro.isdc.wro.http.handler.factory.DefaultRequestHandlerFactory using provider: ro.isdc.wro.util.provider.DefaultConfigurableProvider@52ce14f6
ro.isdc.wro.http.WroServletContextListener initializing attributeHelper named: default
ro.isdc.wro.http.WroFilter created managerFactory: wro4j.grails.plugin.GrailsWroManagerFactory@1ca13466
ro.isdc.wro.http.support.ResponseHeadersConfigurer Header Values: {pragma=no-cache, cache-control=no-cache, expires=0}
ro.isdc.wro.http.WroFilter Cache & Model change listeners were registered
ro.isdc.wro.http.WroFilter wro4j version: 1.7.1-SNAPSHOT
ro.isdc.wro.http.WroFilter wro4j configuration: ro.isdc.wro.config.jmx.WroConfiguration@4b41ceef[
  cacheUpdatePeriod=0
  modelUpdatePeriod=0
  resourceWatcherUpdatePeriod=0
  gzipEnabled=true
  debug=true
  ignoreMissingResources=true
  disableCache=false
  cacheGzippedContent=false
  jmxEnabled=true
  wroManagerClassName=wro4j.grails.plugin.GrailsWroManagerFactory
  encoding=UTF-8
  mbeanName=<null>
  header=<null>
  connectionTimeout=2000
  parallelPreprocessing=false
  ignoreEmptyGroup=true
  ignoreFailingProcessor=false
  minimizeEnabled=true

First time I access the page, it compiles, then, i see this in the log,

ro.isdc.wro.util.SchedulerHelper period: 0 [SECONDS]
ro.isdc.wro.util.SchedulerHelper period: 0 [SECONDS]
ro.isdc.wro.manager.ResourceBundleProcessor set aggregatedFolderPath: /wro/
ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator Searching cache key: ro.isdc.wro.cache.CacheKey@457c5969[
  type=CSS
  groupName=bootstrap
  minimize=true
  map={}
]
ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator shouldWatchForChange: false
ro.isdc.wro.manager.ResourceBundleProcessor ETag hash detected: "be01e215fbcd5494d442bb9535db2699064402bf". Sending 304 status code

Why wro thinks it should not "watchForChange"?

alexo commented 11 years ago

Probably you are looking for this:http://stackoverflow.com/questions/17935629/is-there-a-way-to-configure-wro4j-to-pick-up-changed-files-without-restart-durin

genuinefafa commented 11 years ago

Fair enough. 

This seems like a workaround and I'm ok with that, but, what is the desirable behavior? I mean, should it (wro) detect changes by default?

— Sent from Mailbox for iPhone

On Fri, Aug 9, 2013 at 2:52 PM, Alex Objelean notifications@github.com wrote:

Probably you are looking for this:http://stackoverflow.com/questions/17935629/is-there-a-way-to-configure-wro4j-to-pick-up-changed-files-without-restart-durin

Reply to this email directly or view it on GitHub: https://github.com/alexo/wro4j/issues/149#issuecomment-22411949

alexo commented 11 years ago

The change detection is a configuration driven feature. It is not enabled by default since it has a performance penalty you wouldn't like to have in production environment. On 9 Aug 2013 20:40, "genuinefafa" notifications@github.com wrote:

Fair enough.

This seems like a workaround and I'm ok with that, but, what is the desirable behavior? I mean, should it (wro) detect changes by default?

— Sent from Mailbox for iPhone

On Fri, Aug 9, 2013 at 2:52 PM, Alex Objelean notifications@github.com wrote:

Probably you are looking for this:

http://stackoverflow.com/questions/17935629/is-there-a-way-to-configure-wro4j-to-pick-up-changed-files-without-restart-durin

Reply to this email directly or view it on GitHub: https://github.com/alexo/wro4j/issues/149#issuecomment-22411949

— Reply to this email directly or view it on GitHubhttps://github.com/alexo/wro4j/issues/149#issuecomment-22415038 .

genuinefafa commented 11 years ago

Ok... What is the point of a debug flag? avoid minifiyng?

alexo commented 11 years ago

There is an explanation on the FAQ page. Basically, it allows enable/fisable some of the features useful only during development. An example is adding minimize request param which allows turning minimization on or off. Another example is api endpoints (reloadCache, reloadModel, etc) which are enabled only when debug is true, since allowing them in production is not secure.. You can also use this flag to apply some customization, like running a processor only in debug mode. On 9 Aug 2013 23:11, "genuinefafa" notifications@github.com wrote:

Ok... What is the point of a debug flag? avoid minifiyng?

— Reply to this email directly or view it on GitHubhttps://github.com/alexo/wro4j/issues/149#issuecomment-22423507 .

genuinefafa commented 11 years ago

Ok! Updating bootstrap project and grails-plugin docs https://github.com/genuinefafa/wro4j/compare/alexo:1.7.x...patch-1

:)