Skip to content

Commit

Permalink
Merge branch 'canary' into gadzik/playwright-peer-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
agadzik authored Mar 21, 2024
2 parents 9f1cedb + abe74a5 commit 6c19401
Show file tree
Hide file tree
Showing 53 changed files with 436 additions and 142 deletions.
70 changes: 35 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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-240320.2" }
# [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-240320.2" }
# [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-240320.2" }

# General Deps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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' }],
},
],
}
```
Expand Down
Loading

0 comments on commit 6c19401

Please sign in to comment.