Turborepo 2.3
Turborepo 2.3 introduces several ergonomics improvements:
- Boundaries RFC: Enforce constraints to maintain developer experience
- Package task shortcuts: Execute tasks with
turbo run package#task
- Simplified cache control: Easier management of cache sources using a single flag
Update today by running npx @turbo/codemod migrate
or get started with npx create-turbo@latest
.
Boundaries RFC
Monorepos unlock greater iteration speed and incredible flexibility, but also introduce new challenges:
- How do we make sure the public API of a package is respected?
- How do we communicate where code can and cannot be used to all of our developers?
- How can we ensure packages are only used in the right context?
These are only a few examples of a key question when building in monorepos: How do we communicate and enforce the structural integrity of the Workspace?
At the time of publishing this post, the Boundaries RFC is only an initial draft. The implementation described below is subject to change. Please see the RFC itself for the most up to date information.
The Boundaries RFC is our initial proposal for this problem. In our current approach, we want you to be able to incrementally adopt Boundaries in one line of code:
Additionally, we want to create a tagging system so you can mark domains, concerns, contexts, and other useful metadata with custom Boundaries.
We also plan for you to be able to allowlist existing diagnostics with a flag:
This way, you can enforce Boundaries for new code and gradually fix existing issues.
We're looking forward to hearing your ideas and feedback on the Boundaries RFC.
Package task shortcuts
You can now run tasks using the fully qualified task identifier:
This is more convenient than the equivalent command using --filter
(turbo run build --filter=web
) and allows for more precision if you have multiple tasks that you'd like to target:
Learn more in the documentation.
Simplified cache control
Previously, the --remote-only
and --no-cache
flags were used to manage the sources and caching for your output artifacts. However, we've seen how they can cause confusion, and there are gaps in control as far as reading and writing to local and Remote Caches.
To refine this, we've introduced a new --cache
flag that brings these flags together - and provides more power.
Using local
and remote
, you can control the reading and writing behavior of the turbo
invocation. Learn more in the documentation.
Continued improvements for turbo query
In 2.2, we introduced turbo query
, a feature built for examining your repository using Turborepo's knowledge of your package and task graphs. We've iterated further on this feature to provide you with even more powerful queries:
- Implemented reverse file tracing to find which files depend on a specific file
- Filters for file tracing to find type-only dependencies
- Package names that you provide are now validated to ensure that they exist
Community
Since releasing Turborepo 2.2, we've seen great adoption and community growth:
- 26.3+ GitHub Stars
- 3.4M+ weekly NPM downloads
- 496 years of compute time saved using Vercel Remote Cache
Turborepo is the result of the combined work of all of its contributors, including our core team: Anthony, Chris, Nicholas, and Tom.
Thank you for your continued support, feedback, and collaboration to make Turborepo your build tool of choice.