Turborepo 1.7
Turborepo 1.7 focuses on improving developer experience by bringing more clarity to your tasks:
- Improved support for long running tasks: Use
persistent: true
to mark non-terminating tasks so thatturbo
can alert you if you have dependencies on them. - Better clarity for outputs: You'll now always need to declare your task outputs, improving transparency to what your tasks will cache.
- Globally installable: Install once, use everywhere. Turborepo can now be installed globally, and ran from any directory, not just from your repo root.
- “Error only” output mode: Quiet your output logs to only show when a task fails.
Update today by running npm install turbo@latest
, or by installing globally NEW and running the set-default-outputs
codemod.
Schedule your long-running tasks with confidence
To avoid misconfigurations that could result in tasks that never run, you can now tell Turborepo about tasks that won't exit on their own (like dev
scripts) with a persistent: true
configuration option. When this config is set on a task, Turborepo will ensure no other task can depend on this task. This is useful for dev
tasks or test runners with --watch
flags.
Previously, if Task B
depended on a persistent Task A
, Task B
would never execute, because Task A
never exited. By declaring Task A
as persistent
, Turborepo will prevent this error scenario from happening.
Before this release, we had been recommending the use of turbo run <task> --parallel
for persistent tasks. With --parallel
, turbo
would ignore your dependency graph and execute all your tasks at once.
While --parallel
did provide a helpful escape hatch, it meant that users had to tell Turborepo how to run their tasks rather than declaring what a task is.
Rather than throwing away your entire topological dependency graph, it's much more precise for Turborepo to keep your dependency graph while guaranteeing that you don't depend on a process that won't exit with persistent: true
.
Global turbo
You can now run your Turborepo tasks from anywhere in your project once you've installed turbo
globally. To do so, use:
turbo
will now work in any project. To find your local turbo
version, turbo
will walk through a few steps, always looking upward from your current directory:
- Find the nearest turbo.json.
- If one is not found, find the first
package.json
with aworkspaces
property. - If one is not found, find the first
package.json
.
Your globally installed version of turbo
will only be used when a locally installed version of turbo
does not exist or cannot be found.
turbo --version
and turbo bin
will show you the version and binary location, respectively, of the copy of turbo
that will execute your tasks.
Additionally, running with -vv
or --verbosity=2
will always show if your local, or global turbo
is being used.
Declare your outputs
for improved clarity
Previously, if you did not specify an outputs
key for a task, Turborepo would automatically attempt to cache all files in the dist/
and build/
directories.
This worked well for build
tasks of specific frameworks, but this implicit behavior did not scale well as it applied to all tasks. We've found that, across the many developers, teams, projects, and codebases using Turborepo, the assumption to automatically cache dist/
and build/
directories was causing problems for users.
In version 1.7, this behavior is removed and you will now need to explicitly tell turborepo what to cache.
If you were relying on the default cache output in Turborepo versions below 1.7, you can get the same behavior by running the @turbo/codemod set-default-outputs
codemod:
Also note that you will no longer need to specify outputs: []
because not caching anything is now the default behavior. The codemod will also remove this configuration from your tasks.
“Errors only” output mode for quieter logs
To bring visibility to errors, community member @dobesv contributed a solution to only show errors instead of all logs from a task run. While debugging a pipeline, --output-logs=errors-only
can be used to keep your signal-to-noise ratio high so you can focus on ensuring successful runs for your pipelines.
This can be used as a configuration option or as a CLI flag
Community
Since releasing Turborepo v1.6 and merging with Turbopack, we've seen incredible adoption and community growth:
- 18.7k+ GitHub Stars
- 750k weekly NPM downloads
- 30 years of compute time saved through Remote Caching on Vercel
Turborepo is the result of the combined work of all of our contributors including our core team.
Thank you for your continued support, feedback, and collaboration to make Turborepo your build tool of choice.