Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filepath Bug Fix + Nonblocking Filereads #73

Merged
merged 3 commits into from
Oct 17, 2014
Merged

Filepath Bug Fix + Nonblocking Filereads #73

merged 3 commits into from
Oct 17, 2014

Conversation

quaderi
Copy link
Contributor

@quaderi quaderi commented Oct 16, 2014

Firstly, thanks for making this!

There's basically 2 changes here and I'm fairly sure that neither should affect the API/documentation, so I think it's a SemVer patch version bump. I do however think these simple changes might save quite a number of people from going mad. =)

Filepath Bug Fix
Previously, the filepath was being changed incorrectly. The extension was being changed from the existing filepath (which pointed to the sass files). The new filepath should actually point to the output file which is in the css directory. I've also moved the code to change the extension into the compass library because otherwise the path passed down to the callback in index doesn't refer to any actually existing file (in the general case).

I suspect this might fix some of the issues people have been running into:
#15
#49

This also seems to fix other issues that arise when you pipe to other gulp packages (e.g. gulp-rename) that rely on the vinyl path being correct.

Non-blocking File-reads
The current approach to reading the CSS files outputted by compass is using fs.readFileSync.
readFileSync should never be called on a node webserver since it blocks the only node thread while I/O is being performed. Changing this code to use fs.readFile which is the asynchronous (non-blocking) version of the function is really straightforward here. Since gulp tasks are meant to be asynchronous in nature, it's just a matter of calling the callback from readFile's own callback.

@appleboy
Copy link
Owner

👍

appleboy added a commit that referenced this pull request Oct 17, 2014
Filepath Bug Fix + Nonblocking Filereads
@appleboy appleboy merged commit 9a5533a into appleboy:master Oct 17, 2014
@appleboy
Copy link
Owner

@quaderi I appreciate for what you have done. I will bump new version.

@quaderi
Copy link
Contributor Author

quaderi commented Oct 17, 2014

Awesome! Thanks for pulling this in so quickly!

@appleboy
Copy link
Owner

I already create new tag 1.3.3 and publish it.

https://github.com/appleboy/gulp-compass/releases/tag/1.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants