GithubHelp home page GithubHelp logo

Comments (8)

slavafomin avatar slavafomin commented on May 28, 2024 1

@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.

slavafomin avatar slavafomin commented on May 28, 2024 1

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.

slavafomin avatar slavafomin commented on May 28, 2024

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.

miguel-leon avatar miguel-leon commented on May 28, 2024

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.

slavafomin avatar slavafomin commented on May 28, 2024

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.

slavafomin avatar slavafomin commented on May 28, 2024

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.

miguel-leon avatar miguel-leon commented on May 28, 2024

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.

slavafomin avatar slavafomin commented on May 28, 2024

I'm going to close this now.

from gulp-require-tasks.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.