Back to blog

Turborepo 2.3

Tuesday, November 14th, 2024
Chris Olszewski
Name
Chris Olszewski
Nicholas Yang
Name
Nicholas Yang
X
@nicholaslyang
Anthony Shew
Name
Anthony Shew
X
@anthonysheww

Turborepo 2.3 introduces several ergonomics improvements:

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:

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:

turbo.json
{
  "boundaries": true
}

Additionally, we want to create a tagging system so you can mark domains, concerns, contexts, and other useful metadata with custom Boundaries.

apps/ui/turbo.json
{
  "extends": ["//"],
  "boundaries": {
    "tags": ["library", "ui", "frontend", "beta"],
    "allowDependencyOn": ["library", "frontend"],
    "denyDependencyFrom": ["backend", "stable"]
  }
}

We also plan for you to be able to allowlist existing diagnostics with a flag:

Terminal
turbo boundaries --exclude-errors

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:

Terminal
turbo run web#build

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:

Terminal
turbo run web#build docs#lint

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.

Terminal
turbo run build --cache=local:rw,remote:r

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:

Community

Since releasing Turborepo 2.2, we've seen great adoption and community growth:

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.