-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
POC: Introduce Node.js 6+ compatibility mode for gulp@3 #1760
Conversation
8340432
to
4b6e252
Compare
Would it potentially make sense to wrap the require of This could be a good way to allow for a transparent fix for those on affected versions. |
I find this an interesting workaround. Let me think on it for awhile. |
@phated Would it be ok to transfer vinyl-fs-03-compat ownership now? Asking in advance because I don't want to spam you =). |
@ChALkeR no worries. If we decide to pull this workaround in, I'll create a branch/tag in vinyl-fs proper |
@phated Ah, ok. That makes sense =). |
just fyi, related to this: nodejs/node#8166. It doesn't solve the issue but it's one small step. |
Another note: this is not a separate module, but a mere separate entry point for these reasons:
|
Ah, this approach has a drawback. Fixable, though. The propogation would only work if the Thoughts? |
Is this even supported by task managers like Gulp?
Had this been necessary, could we use a symbol to minimize the possibility of a collision? |
I could definitely imagine people doing Note that about 2943 packages depend on |
@mgol e.g. sifttt is both managed using a gulpfile with a top-level |
Note: graceful-fs@3.0.10 was released by @isaacs and that version does not trigger the warning anymore, so this can be closed now. |
Closed, will reopen if any issues arise with the new graceful-fs or if the change there gets reverted for some reason. |
Works for me. Thanks to everyone that contributed towards a solution! |
For posterity and anyone else with graceful-fs@3: this was done with https://github.com/isaacs/natives/blob/master/index.js, which also uses a bunch of undocumented and internal things, relies on implementation details, and also has some other hacks. E.g. it's basically a noop on the That perhaps shouldn't manifest itself in the near future in regards to graceful-fs@3, (hence it was ok to close this now and leave things as they are), but in the long term no one should ever user graceful-fs below v4 and no one should ever use that |
Refs: #1640 (comment)
This is unfinished POC, it lacks the documentation and perhaps the tests.
It works though, and successfully unbreaks gulp@3 with Node.js 6+ if gulp was required using
require('gulp/compat')
.This is a pure opt-in, it does not change anything unless the user specifically enables it (except for installing one extra unused package).
If gulp is already loaded at the time of the opt-in, then it throws an error — so that deps won't misuse it and change the behaviour of everything, — this makes this option available only to the top-level gulpfile itself.
If this would be accepted, I will gladly move vinyl-fs-03-compat to gulpjs both on GitHub and npm.
/cc @phated, @contra, @thealphanerd, @jasnell
Thoughts?