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

skipBinary option should be true by default #81

Closed
alexbain opened this issue Jan 19, 2017 · 7 comments
Closed

skipBinary option should be true by default #81

alexbain opened this issue Jan 19, 2017 · 7 comments

Comments

@alexbain
Copy link

I ran into an issue where gulp-replace was trying to parse binary files in my project, which lead me to discover the skipBinary option. This is set to false, by default.

Why is a string replacement library trying to parse binary files, by default? I can't think of a use case where this is a sensible default. It seems far more sane to have skipBinary be true by default and, if someone needs to parse binary files, they adjust that setting to false.

@lazd
Copy link
Owner

lazd commented Jan 19, 2017 via email

@alexbain
Copy link
Author

Hi @lazd - I do see your point, but my thought is that binary files are very rarely files you perform string replacements on. In my case, the string replacement was corrupting all of my binary files.

Since replacing strings in binary files is a "risky" operation, and something I'd imagine people are attempting only under specific circumstances, it seems generally safer to make users to opt in to that setting. This way, users are less likely to shoot themselves in the foot and can be lazy with their globs.

@lazd
Copy link
Owner

lazd commented Jan 19, 2017

I agree, very few use cases need to perform a string replacement in a binary file.

Changing skipBinary to true by default would result in a major version increase. There are some other things we're considering, such as #50, that may require breaking API changes, so if this is done, it should be done at the same time.

@alexbain
Copy link
Author

That makes sense, and I agree it would be a major version increase. Thank you for considering!

@abdonrd
Copy link

abdonrd commented Mar 8, 2017

Any news on that? I also have the corrupting binary files issue.

@lazd
Copy link
Owner

lazd commented Mar 8, 2017

@abdonrd then set skipBinary: true...

@lazd lazd closed this as completed in 14df43b May 16, 2018
@lazd
Copy link
Owner

lazd commented May 16, 2018

1.0.0 released with skipBinary: true by default.

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

No branches or pull requests

3 participants