asset-rack icon indicating copy to clipboard operation
asset-rack copied to clipboard

Use gaze instead of fs.watch to implement file watching.

Open alecgorge opened this issue 11 years ago • 5 comments

Makes file watching more robust and fixes all issues for me. Addresses #87 and #41.

I was having issues with the old watch functionality. This fixes it for me.

alecgorge avatar Oct 25 '13 18:10 alecgorge

It looks like you forgot to add gaze = require 'gaze'

bryanchriswhite avatar Nov 27 '13 16:11 bryanchriswhite

@alecgorge, have you manually tested this and confirmed that your changes work (esp. considering the fact that gaze = require 'gaze' was omitted from this commit)? I merged your branch with ours (and added the require statement) and i'm seeing some strange behavior. We've made changes of our own but I highly doubt they have any affect on this behavior.

I only tested stylus watching because i didn't have time to do any more but when I do have the time I'll be going back through and testing thoroughly to try to understand what is and isn't happening.

My brief experiment with stylus watching involved an assets.js with a rack containing stylusAsset with watch set to true:

...
var assets = new rack.Rack([
  new rack.StylusAsset({
    url: '/somewhere.css',
    filename: '/some/file.styl',
    watch: true
  }),
  ...
])
...

I simply changed the background color of an element and refreshed the page.

Normally the page looks like this: screenshot 2013-11-27 12 13 20

The change I made to stylus should look like this: screenshot 2013-11-27 12 13 54

This is what I got: screenshot 2013-11-27 12 02 49

bryanchriswhite avatar Nov 27 '13 17:11 bryanchriswhite

Also, that same result (third image) happened when I changed the color property (instead of background-color to a completely different element.. so I'm clueless as to what's going on for the time being.

bryanchriswhite avatar Nov 27 '13 17:11 bryanchriswhite

I won't be able to take a good look at this for a few days but I have been using this branch in production for several weeks without issues for some simple stylus stuff.

Sent from my iPhone

On Nov 27, 2013, at 12:21 PM, Bryan White [email protected] wrote:

Also, that same result (third image) happened when I changed the colorproperty (instead of background-color to a completely different element.. so I'm clueless as to what's going on for the time being.

— Reply to this email directly or view it on GitHubhttps://github.com/techpines/asset-rack/pull/105#issuecomment-29402657 .

alecgorge avatar Nov 27 '13 18:11 alecgorge

@alecgorge , could I please ping you again to update this pull request with the code you're using in production? We'd love to incorporate your changes and merge this.

dankohn avatar Jan 17 '14 20:01 dankohn