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

Long running tasks in parallel #27586

Open
raine-works opened this issue Jan 8, 2025 · 4 comments
Open

Long running tasks in parallel #27586

raine-works opened this issue Jan 8, 2025 · 4 comments
Labels
bug Something isn't working correctly task runner related to deno task

Comments

@raine-works
Copy link

The ability to run tasks in all workspace projects recursively is very useful, specifically for build tasks, but it would be nice to be able to run long running tasks recursively in parallel similar to how Turborepo works.

@marvinhagemeister
Copy link
Contributor

Related #26462

@marvinhagemeister marvinhagemeister added suggestion suggestions for new features (yet to be agreed) task runner related to deno task labels Jan 8, 2025
@bartlomieju
Copy link
Member

Could you give an example command you want to run and the expected result?

@raine-works
Copy link
Author

deno.json

{
    "workspace": [
        "apps/*"
    ],
}

apps/server/deno.json

{
    "tasks": {
        "dev": "deno run -A --env-file --watch src/mod.ts"
    }
}

apps/web/deno.json

{
    "tasks": {
        "dev": "deno run -A --node-modules-dir npm:vite"
    }
}

I want to be able to use the recursive flag to run these tasks. Currently when I try using deno task -r dev it starts one dev server and waits until the task is complete before starting the second dev server. The dev servers should run concurrently since they rely on each other. There are a few NPM tools that make this possible, but I think Turborepo does it best. Unfortunately Turborepo does not currently support Deno. One of things I have really enjoyed about Deno is most of the development tooling I use is built-in. If Deno handled workspaces similarly to Turborepo it would be perfect.

Below is a simple example of what the output could look like in the terminal.

vscode ➜ /workspaces/demo (main) $ deno task -r dev 
[0] Task dev deno run -A --env-file --watch src/mod.ts
[0] Watcher Process started.
[0] Listening on http://0.0.0.0:8000/
[1] VITE v6.0.7  ready in 158 ms
[1] ➜  Local:   http://127.0.0.1:3000/
[1] ➜  press h + enter to show help

Below is an example of how Turborepo represents concurrent processes in the terminal.

image

Something like this would be amazing, but honestly I don't really care what the output looks like as long as it works.

@bartlomieju
Copy link
Member

Thanks for explanation. I think the current behavior might actually be buggy. Deno should run recursive tasks in parallel if the topology allows for that.

@bartlomieju bartlomieju added bug Something isn't working correctly and removed suggestion suggestions for new features (yet to be agreed) labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly task runner related to deno task
Projects
None yet
Development

No branches or pull requests

3 participants