diff --git a/Cargo.lock b/Cargo.lock index 82132cb223777..b6d5acb3a052a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "serde", "smallvec", @@ -3217,7 +3217,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "serde", @@ -7160,7 +7160,7 @@ dependencies = [ [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-trait", @@ -7192,7 +7192,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "cargo-lock", @@ -7204,7 +7204,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "bytes", @@ -7219,7 +7219,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "dotenvs", @@ -7233,7 +7233,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7250,7 +7250,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "auto-hash-map", @@ -7282,7 +7282,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "base16", "hex", @@ -7294,7 +7294,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7308,7 +7308,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "proc-macro2", "quote", @@ -7318,7 +7318,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "mimalloc", ] @@ -7326,7 +7326,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "auto-hash-map", @@ -7351,7 +7351,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-recursion", @@ -7384,7 +7384,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "auto-hash-map", "mdxjs", @@ -7424,7 +7424,7 @@ dependencies = [ [[package]] name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7450,7 +7450,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "clap", @@ -7469,7 +7469,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-recursion", @@ -7500,7 +7500,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-trait", @@ -7528,7 +7528,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-compression", @@ -7565,7 +7565,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-trait", @@ -7603,7 +7603,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "serde", "serde_json", @@ -7614,7 +7614,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-trait", @@ -7639,7 +7639,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indoc", @@ -7656,7 +7656,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7672,7 +7672,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "base64 0.21.4", @@ -7692,7 +7692,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "serde", @@ -7707,7 +7707,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "mdxjs", @@ -7722,7 +7722,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-stream", @@ -7760,7 +7760,7 @@ dependencies = [ [[package]] name = "turbopack-nodejs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7784,7 +7784,7 @@ dependencies = [ [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "async-recursion", @@ -7806,7 +7806,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "serde", @@ -7822,7 +7822,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "swc_core", "turbo-tasks", @@ -7833,7 +7833,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "crossbeam-channel", @@ -7849,7 +7849,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240319.2#0f31686269839f10966ae1f60eb71f822f29303a" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240321.3#f8bff1a1177b7fb60d37a8bb496cd0eecc23855b" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index 15ead37c95f71..9548fdc6e5a4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,11 @@ swc_core = { version = "0.90.22", features = [ testing = { version = "0.35.20" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240319.2" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240321.3" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240319.2" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240321.3" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240319.2" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240321.3" } # General Deps diff --git a/docs/02-app/01-building-your-application/01-routing/13-middleware.mdx b/docs/02-app/01-building-your-application/01-routing/13-middleware.mdx index 2091aec5a3e03..99e96747946c0 100644 --- a/docs/02-app/01-building-your-application/01-routing/13-middleware.mdx +++ b/docs/02-app/01-building-your-application/01-routing/13-middleware.mdx @@ -97,7 +97,7 @@ export const config = { } ``` -You can also ignore prefetches (from `next/link`) that don't need to go through the Middleware using the `missing` array: +You can also bypass Middleware for certain requests by using the `missing` or `has` arrays, or a combination of both: ```js filename="middleware.js" export const config = { @@ -116,6 +116,20 @@ export const config = { { type: 'header', key: 'purpose', value: 'prefetch' }, ], }, + + { + source: '/((?!api|_next/static|_next/image|favicon.ico).*)', + has: [ + { type: 'header', key: 'next-router-prefetch' }, + { type: 'header', key: 'purpose', value: 'prefetch' }, + ], + }, + + { + source: '/((?!api|_next/static|_next/image|favicon.ico).*)', + has: [{ type: 'header', key: 'x-present' }], + missing: [{ type: 'header', key: 'x-missing', value: 'prefetch' }], + }, ], } ``` diff --git a/docs/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx b/docs/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx index c946fae030a80..c4953d16953ac 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx @@ -46,7 +46,6 @@ Next.js includes a [short list of popular packages](https://github.com/vercel/ne - `jest` - `jsdom` - `libsql` -- `lodash` - `mdx-bundler` - `mongodb` - `mongoose` diff --git a/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx b/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx index 38b7a62c6c67b..6335b520ee50e 100644 --- a/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx +++ b/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx @@ -17,6 +17,7 @@ By default, Next.js includes its own server with `next start`. If you have an ex > > - Before deciding to use a custom server, please keep in mind that it should only be used when the integrated router of Next.js can't meet your app requirements. A custom server will remove important performance optimizations, like **serverless functions** and **[Automatic Static Optimization](/docs/pages/building-your-application/rendering/automatic-static-optimization).** > - A custom server **cannot** be deployed on [Vercel](https://vercel.com/solutions/nextjs). +> - Standalone output mode, does not trace custom server files and this mode outputs a separate minimal `server.js` file instead. Take a look at the following example of a custom server: diff --git a/docs/03-pages/01-building-your-application/10-upgrading/07-version-12.mdx b/docs/03-pages/01-building-your-application/10-upgrading/07-version-12.mdx index a420faaca6d68..6a4bb67e2e716 100644 --- a/docs/03-pages/01-building-your-application/10-upgrading/07-version-12.mdx +++ b/docs/03-pages/01-building-your-application/10-upgrading/07-version-12.mdx @@ -31,7 +31,7 @@ bun add next@12 react@17 react-dom@17 eslint-config-next@12 [Minimum Node.js Version](https://nodejs.org/en/) - The minimum Node.js version has been bumped from `12.0.0` to `12.22.0` which is the first version of Node.js with native ES Modules support. -[Minimum React Version](https://reactjs.org/docs/add-react-to-a-website.html) - The minimum required React version is `17.0.2`. To upgrade you can run the following command in the terminal: +[Minimum React Version](https://react.dev/learn/add-react-to-an-existing-project) - The minimum required React version is `17.0.2`. To upgrade you can run the following command in the terminal: ```bash filename="Terminal" npm install react@latest react-dom@latest diff --git a/examples/cms-sanity/package.json b/examples/cms-sanity/package.json index 1d44773ac32d1..f519931aaeba5 100644 --- a/examples/cms-sanity/package.json +++ b/examples/cms-sanity/package.json @@ -10,30 +10,30 @@ "postsetup": "echo 'create the read token by following the rest of the guide: https://github.com/vercel/next.js/tree/canary/examples/cms-sanity#creating-a-read-token'" }, "dependencies": { - "@sanity/assist": "^2.0.3", + "@sanity/assist": "^2.0.4", "@sanity/icons": "^2.11.2", "@sanity/image-url": "^1.0.2", - "@sanity/preview-url-secret": "^1.6.4", - "@sanity/vision": "^3.33.0", + "@sanity/preview-url-secret": "^1.6.5", + "@sanity/vision": "^3.35.0", "@tailwindcss/typography": "^0.5.10", - "@types/node": "^20.11.27", - "@types/react": "^18.2.65", + "@types/node": "^20.11.30", + "@types/react": "^18.2.67", "@types/react-dom": "^18.2.22", "@vercel/speed-insights": "^1.0.10", "autoprefixer": "^10.4.18", - "date-fns": "^3.4.0", + "date-fns": "^3.6.0", "next": "latest", - "next-sanity": "^8.3.2", - "postcss": "^8.4.35", + "next-sanity": "^8.4.4", + "postcss": "^8.4.37", "react": "^18.2.0", "react-dom": "^18.2.0", "rxjs": "^7.8.1", - "sanity": "^3.33.0", + "sanity": "^3.35.0", "sanity-plugin-asset-source-unsplash": "^2.0.1", "server-only": "^0.0.1", "styled-components": "^6.1.8", "tailwindcss": "^3.4.1", - "typescript": "5.3.3" + "typescript": "5.4.2" }, "devDependencies": { "@next/env": "latest", diff --git a/examples/with-redux/app/layout.tsx b/examples/with-redux/app/layout.tsx index 7493f7cec6106..c8127135bea7c 100644 --- a/examples/with-redux/app/layout.tsx +++ b/examples/with-redux/app/layout.tsx @@ -19,7 +19,13 @@ export default function RootLayout({ children }: Props) {