asset-rack
asset-rack copied to clipboard
Use gaze instead of fs.watch to implement file watching.
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.
It looks like you forgot to add gaze = require 'gaze'
@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:
The change I made to stylus should look like this:
This is what I got:
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.
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 , 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.