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

Restore does not save order of files #72

Closed
denieler opened this issue Aug 24, 2016 · 6 comments
Closed

Restore does not save order of files #72

denieler opened this issue Aug 24, 2016 · 6 comments

Comments

@denieler
Copy link

Hi!

We've had a bug with modules order because of the issue in your restore function. It is not saving the order of files that was in gulp.src before.

Example:

return gulp.src(["file1.js", "file2.coffee", "file3.js"])
           .pipe(filterCoffee)
           .pipe(compileCoffeeFiles())
           .pipe(filterCoffee.restore)
           .pipe(concat(fileName))
           .pipe(gulp.dest(fileDir));

In this example, on some CPUs you'll have order file1, file3, file2 in the result.

But concat save order from gulp.src

@nfroidure
Copy link
Contributor

Order will be preserved only if you use streams, this is a known issue with gulp and buffers gulpjs/gulp#300

@denieler
Copy link
Author

@nfroidure wait, for concat it works, why it doesn't work for restore function for your plugin?

@nfroidure
Copy link
Contributor

nfroidure commented Aug 24, 2016

concat concats files as they come, gulp filter split them and feed 2 different streams which leads to concurrence issues i pointed out on gulp.

@nfroidure
Copy link
Contributor

To be honest, i find it bad too, it should be fixed on Gulp itself. I gave a path on the Gulp issue to avoid it.

@denieler
Copy link
Author

I had to use

.....
.pipe(gulpIf(fileCoffee, compileCoffee()))
.pipe(....

instead of your package because of this bug. Can you please add this to documentation of restore function? Because it is not clear. Thanks!

@nfroidure
Copy link
Contributor

@denieler feel free to, i do not use Gulp anymore ;)

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

2 participants