Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Conversation

StefanoMagrassi
Copy link
Contributor

It was added a configuration to enable/disable runAllTasks() call before watch.

This should help in some cases when gulp watch fails because of watchers start before all tasks are finished.

It is like a hack, but it can be useful. I think that to fix all the issues related to watch

Merge from laravel master
- group Elixir task by name
- get a list of tasks and runners from each name
- "tasks" is a list of globs which describe files that have to be watched
- "runners" is a list of Tasks object which don't have globs, but an implicit "watch" logic (e.g. browserify + watchify)
- if "runAllTasks()" before watch is enabled, for each "tasks" a gulp.watch is added
- otherwise is disabled, for each "runners" is called "run()" method in order to start implicit watch logic and then for each "tasks" a gulp.watch is added
@lukepolo
Copy link

lukepolo commented Nov 2, 2016

If this works , im going to be a very very happy person

@JeffreyWay
Copy link
Contributor

Can you help me understand better the issue that you're fixing here?

So, if gulp watch triggers all tasks, it's possible in some cases that the watchers will start before they've completed? Is that what you're saying?

If that's so, can we fix it without a hack? Or maybe we can disable runAllTasks() entirely. That's how Elixir used to behave.

@StefanoMagrassi
Copy link
Contributor Author

@JeffreyWay yes, this is the problem. Or at least it seems that it happens in my last project (a lot of less and browserify compilation).

I thought that adding a configuration in order to enable/disable runAllTasks() could be more flexible and less destructive.

@StefanoMagrassi
Copy link
Contributor Author

@JeffreyWay anyway IMHO watch shouldn't run all the tasks before start: this should be done by the developer if it helps him, maybe with some npm scripts.

@JeffreyWay
Copy link
Contributor

Okay, then I'm going to close this PR and remove that section.

@JeffreyWay JeffreyWay closed this Nov 2, 2016
JeffreyWay added a commit that referenced this pull request Nov 2, 2016
@JeffreyWay
Copy link
Contributor

JeffreyWay commented Nov 2, 2016

Actually, changed my mind. We're still triggering all tasks on gulp watch, but I think the commit I just made should ensure that those watchers aren't added until all tasks have completed. Updated to 6.0.0-13 to try it out.

@StefanoMagrassi
Copy link
Contributor Author

@JeffreyWay ok, this should work fine, but there still are a couple of changes that can be done to make the code better.
I will send you another PR

@StefanoMagrassi
Copy link
Contributor Author

@JeffreyWay sadly your change doesn't work... I think that your approach is correct, but maybe the problem stands at a lower level.

It seems that the "guilty" task is version: when gulp runs default the log says that task is finished after n milliseconds and it starts watch, but actually default is still running because the versioned files are added to the build directory after a couple of seconds.

@lukepolo
Copy link

lukepolo commented Nov 3, 2016

ideas on how to fix this?

@TimTruston
Copy link

@JeffreyWay Check my temporary solution on #626 . It works every time. It may bring up some ideas.

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.

4 participants