Comments (8)
@miguel-leon I've updated the README to specifically address this use case. Feel free to use one of the described workarounds. Thank you for pinpointing this problem.
Cheers!
from gulp-require-tasks.
there is no purpose in setting passCallback to false, as it's the last argument
It's a matter of taste, I just wanted to give the end user the most possible control of the task function.
Maybe someone is doing something nasty with arguments
and this functionality is needed.
from gulp-require-tasks.
Hello @miguel-leon! After a thorough investigation I can see the problem is with synchronous task functions only. It's pretty rare use case in my opinion, cause probably most gulp plugins return proper streams and most of the node modules are also asynchronous in nature.
Could you elaborate please, what is your use case with synchronous task functions?
Also, what solution are you seeing to this problem?
Thank you!
from gulp-require-tasks.
Hello @slavafomin, I was about to write. You're right, I didn't realize it didn't happen with (most commonly used) tasks that return promises or streams.
It is produced with tasks that do something synchronous like logging.
I should have realized it and specified which kind of tasks are the ones not finishing.
I guess, it's a little bit cumbersome to fix since orchestrator is relying in Function.length
in the first place.
Maybe having two functions function taskFunction (callback) { ... }
and function taskFunction () { ... }
. But it might just not worth the trouble for the uncommon use case.
Should I edit the posts and specify what type of tasks are not finishing or should they be closed.
from gulp-require-tasks.
I think I will just add a warning and an example to the documentation regarding synchronous task functions. The workaround is pretty simple: either fire a callback from your synchronous functions or just use a nativeTask
functionality. I think it's a very rare situation and it's a pretty low price to pay for splitting tasks across separate files.
from gulp-require-tasks.
I will leave this issue open for now. Maybe in the future we will find a way to make it work transparently to the end user. Do a thumbs up if you think this feature is necessary.
from gulp-require-tasks.
Hi @slavafomin, I concur it is the best thing to do by now. I had already used and confirmed both workarounds.
The only thing to notice, is that, for now, there is no purpose in setting passCallback
to false
, as it's the last argument, it may just stay true
and omit the function parameter when not needed.
Thanks for taking the time.
Cheers...
from gulp-require-tasks.
I'm going to close this now.
from gulp-require-tasks.
Related Issues (18)
- Question: Alternative syntax for dependencies HOT 2
- Pass variables to tasks HOT 1
- Possible to retrieve values from dependencies? HOT 2
- Register tasks with the name of directories HOT 1
- Unexpected token ... HOT 4
- Add dependencies to package.json HOT 1
- arguments is an empty object in on.('finish') callback HOT 3
- Multiple tasks in a single file? HOT 2
- Load tasks from multiple directories HOT 3
- Sub-task triggers parent task HOT 2
- The path option documentation is not clear HOT 1
- Pass options to white/blacklist files in tasks directory HOT 1
- How to use nativeTask, provide example please. HOT 5
- Share configuration variables across all task files HOT 1
- Provide support for modules that change Gulp's API HOT 5
- Support for babel files HOT 13
- __dirname + '/tasks' is not default value of path parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-require-tasks.