Skip to content

Commit cfa003c

Browse files
Add --turbopack CLI flag (#71657)
Changes `--turbo` -> `--turbopack` to avoid confusion. - Updated docs - Updates create-next-app -- For create-next-app it's a rename as otherwise there is an ordering problem with the prompts - For the CLI `next dev --turbo` is still supported, will eventually be a warning in a future version to swap with `--turbopack` but is not a requirement today, can be handled automatically by the upgrade codemod - New CLI flag: `next dev --turbopack` <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> --------- Co-authored-by: Will Binns-Smith <[email protected]>
1 parent 9bd38dd commit cfa003c

File tree

33 files changed

+88
-85
lines changed

33 files changed

+88
-85
lines changed

.github/actions/next-integration-stat/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ const createCommentPostAsync =
735735
console.log('Created a new comment', result.data.html_url)
736736
}
737737

738-
// An action report failed next.js integration test with --turbo
738+
// An action report failed next.js integration test with --turbopack
739739
async function run() {
740740
const {
741741
token,

bench/heavy-npm-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev-turbopack": "next dev --turbo",
6+
"dev-turbopack": "next dev --turbopack",
77
"dev-webpack": "next dev",
88
"build-turbopack": "TURBOPACK=1 TURBOPACK_BUILD=1 next build",
99
"build-webpack": "next build",

crates/napi/src/turbopack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::next_api::project::NapiDefineEnv;
1313
#[napi(object, object_to_js = false)]
1414
#[derive(Debug)]
1515
pub struct NextBuildContext {
16-
// Added by Next.js for next build --turbo specifically.
16+
// Added by Next.js for next build --turbopack specifically.
1717
/// The root directory of the workspace.
1818
pub root: Option<String>,
1919

crates/next-core/src/mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use turbopack_ecmascript_runtime::RuntimeType;
66
#[turbo_tasks::value(shared)]
77
#[derive(Debug, Copy, Clone, TaskInput, Ord, PartialOrd, Hash)]
88
pub enum NextMode {
9-
/// `next dev --turbo`
9+
/// `next dev --turbopack`
1010
Development,
1111
/// `next build`
1212
Build,

docs/02-app/01-building-your-application/07-configuring/05-mdx.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ module.exports = withMDX({
784784

785785
> **Good to know**:
786786
>
787-
> This option is required when processing markdown and MDX while using [Turbopack](/docs/architecture/turbopack) (`next dev --turbo`).
787+
> This option is required when processing markdown and MDX while using [Turbopack](/docs/architecture/turbopack) (`next dev --turbopack`).
788788
789789
## Helpful Links
790790

docs/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ Create React App and Next.js both default to using webpack for bundling.
480480

481481
When migrating your CRA application to Next.js, you might have a custom webpack configuration you're looking to migrate. Next.js supports providing a [custom webpack configuration](/docs/app/api-reference/next-config-js/webpack).
482482

483-
Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config-js/turbo) through `next dev --turbo` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/next-config-js/turbo) as well for compatibility and incremental adoption.
483+
Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config-js/turbo) through `next dev --turbopack` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/next-config-js/turbo) as well for compatibility and incremental adoption.
484484

485485
## Next Steps
486486

docs/02-app/02-api-reference/06-cli/create-next-app.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following options are available:
2828
| `--eslint` | Initialize with ESLint config |
2929
| `--app` | Initialize as an App Router project |
3030
| `--src-dir` | Initialize inside a `src/` directory |
31-
| `--turbo` | Enable Turbopack by default for development |
31+
| `--turbopack` | Enable Turbopack by default for development |
3232
| `--import-alias <alias-to-configure>` | Specify import alias to use (default "@/\*") |
3333
| `--empty` | Initialize an empty project |
3434
| `--use-npm` | Explicitly tell the CLI to bootstrap the application using npm |

docs/02-app/02-api-reference/06-cli/next.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The following commands are available:
4545
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
4646
| `-h, --help` | Show all available options. |
4747
| `[directory]` | A directory in which to build the application. If not provided, current directory is used. |
48-
| `--turbo` | Starts development mode using [Turbopack](https://nextjs.org/docs/architecture/turbopack). |
48+
| `--turbopack` | Starts development mode using [Turbopack](https://nextjs.org/docs/architecture/turbopack). |
4949
| `-p` or `--port <port>` | Specify a port number on which to start the application. Default: 3000, env: PORT |
5050
| `-H`or `--hostname <hostname>` | Specify a hostname on which to start the application. Useful for making the application available for other devices on the network. Default: 0.0.0.0 |
5151
| `--experimental-https` | Starts the server with HTTPS and generates a self-signed certificate. |

docs/04-architecture/turbopack.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ description: Turbopack is an incremental bundler optimized for JavaScript and Ty
77

88
## Usage
99

10-
Turbopack can be used in Next.js in both the `pages` and `app` directories for faster local development. To enable Turbopack, use the `--turbo` flag when running the Next.js development server.
10+
Turbopack can be used in Next.js in both the `pages` and `app` directories for faster local development. To enable Turbopack, use the `--turbopack` flag when running the Next.js development server.
1111

1212
```json filename="package.json" highlight={3}
1313
{
1414
"scripts": {
15-
"dev": "next dev --turbo",
15+
"dev": "next dev --turbopack",
1616
"build": "next build",
1717
"start": "next start",
1818
"lint": "next lint"
@@ -76,6 +76,6 @@ These features are currently not supported:
7676

7777
## Generating Trace Files
7878

79-
Trace files allow the Next.js team to investigate and improve performance metrics and memory usage. To generate a trace file, append `NEXT_TURBOPACK_TRACING=1` to the `next dev --turbo` command, this will generate a `.next/trace.log` file.
79+
Trace files allow the Next.js team to investigate and improve performance metrics and memory usage. To generate a trace file, append `NEXT_TURBOPACK_TRACING=1` to the `next dev --turbopack` command, this will generate a `.next/trace.log` file.
8080

8181
When reporting issues related to Turbopack performance and memory usage, please include the trace file in your [GitHub](https://github.com/vercel/next.js) issue.

packages/create-next-app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Options:
5959

6060
Initialize inside a `src/` directory.
6161

62-
--turbo
62+
--turbopack
6363

6464
Enable Turbopack by default for development.
6565

0 commit comments

Comments
 (0)