gulpjs / gulpjs/vinyl-fs

Reconsider utf8 as default encoding

Open
#355 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
973
Forks
154
PR merge metrics
No merged PRs in 30d

Description

I was very surprised to encounter a bug report on `gulp.spritesmith` not working with Gulp 5.0.0 today.

https://github.com/twolfson/gulp.spritesmith/issues/159

After some sleuthing, we found it was tied to both `src()` and `dest()` assuming a default `encoding` of `utf8` instead of none

I was quite shocked to find the source of this idea was from 2014 (10 years ago)

and there's nothing in the discussions about implications for how Gulp is being used currently, and what would break downstream as a result

https://github.com/gulpjs/vinyl-fs/issues/23

I appreciate the sentiment, assuming that Gulp is prob for text-based files, but that's simply not the only case and far from the default now

This decision broke for `gulp.spritesmith` both in the standalone image stream case, as well as common `dest` stream which outputs both a CSS spritesheet as well as the corresponding image

I've seen lots of other image based libraries have similar issues

Adoption for Gulp@5 seems quite low compared to Gulp@4 ([200K downloads in past week vs 3.4M](https://www.npmjs.com/package/gulp?activeTab=versions)), so I encourage reconsidering reverting the default encoding, to avoid upending more downstream maintainers by surprise (or worse, getting more broken unmaintained libraries)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the linked gulp.spritesmith report and vinyl-fs issue 23, then trace how src() and dest() choose their default encoding. Compare the impact on text and binary streams; done means the intended default and its downstream compatibility implications are decided.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.