Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

downgrade vinyl dependency to ^0.4.0 #103

Closed
wants to merge 1 commit into from

Conversation

evocateur
Copy link

As I mentioned in a comment on 64325ae, the current version of gulp depends on a different version of vinyl-fs (and thus vinyl) than the version gulp-util 3.0.6 depends on. A given version of gulp and gulp-util should share the same underlying version of vinyl-fs/vinyl, surely?

This has caused a divergence in what the current version of gulp installs, and violates the semver contract of a patch version.
@yocontra
Copy link
Member

yocontra commented Sep 2, 2015

@evocateur the vinyl update was just some new APIs so no breaking changes. vinyl-fs (on master, not pushed yet) is already updated and so is gulp on the 4.0 branch. theres no problem with having gulp-util be on a new version

@yocontra yocontra closed this Sep 2, 2015
@yocontra
Copy link
Member

yocontra commented Sep 2, 2015

Just read your comment, yeah it does cause a breaking change if people are using instanceof. Unfortunately, reverting the change is also a breaking change and some people are already relying on the update. I'm on the side of not breaking it again. Really, updating any module that exports a class is going to be problematic so I don't think there is anything that we as module authors can do to prevent this other than tell people not to use instanceof.

Going forward we should probably discourage instanceof checks and add a vinyl .isInstanceOf function.

@yocontra yocontra mentioned this pull request Sep 2, 2015
@evocateur
Copy link
Author

I just wasted a whole damned day trying to understand why my gulp plugin stream (that clones and manipulates vinyl File instances) wasn't behaving the same way in my tests as it was while being used in an external gulpfile.

instanceOf is not the issue, quite frankly. It was only used in my tests, not the plugin itself, and was overly paranoid. Instead of instanceOf, I could poke around and assert that all the properties of a File instance exist, but I'd rather not pollute my unit tests with that sort of brittle quacking.

gulp-util v3.0.6 is still backward-incompatible with gulp v3.9.0 in the current scheme because a plugin author who uses the File export of gulp-util (as almost every single available tutorial and example does) will expect the new API, attempt to modify something like basename on the File instances being passed into their plugin stream, and now it's broken when used in every currently-available installation of gulp.

@yocontra
Copy link
Member

yocontra commented Sep 3, 2015

@evocateur Don't use gulp-util, it is being deprecated. Also, I've add an isVinyl function to the vinyl module so no need for instanceof or duck-typing

@evocateur
Copy link
Author

Thanks for putting up with my crankiness. Looking forward to the future!

@evocateur evocateur deleted the patch-1 branch September 3, 2015 00:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants