Skip to content

Commit

Permalink
Merge branch 'canary' into 04-29-fix_redirect_to_url_with_semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiShake1 authored May 1, 2024
2 parents beb36a0 + d62b68f commit 4958450
Show file tree
Hide file tree
Showing 24 changed files with 349 additions and 795 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.33", features = [
testing = { version = "0.35.22" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240429.1" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240430.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-240429.1" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240430.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240429.1" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240430.2" }

# General Deps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ export default function Page() {

> **Good to know**: You should **not** manually add `<head>` tags such as `<title>` and `<meta>` to root layouts. Instead, use the [Metadata API](/docs/app/api-reference/functions/generate-metadata) which automatically handles advanced requirements such as streaming and de-duplicating `<head>` elements.
Learn more about available metadata options in the [API reference](/docs/app/api-reference/functions/generate-metadata)
Learn more about available metadata options in the [API reference](/docs/app/api-reference/functions/generate-metadata).

### Active Nav Links

You can use the [usePathname()](/docs/app/api-reference/functions/use-pathname) hook to determine if a nav link is active.

Since `usePathname()` is a client hook, you need to extract the nav links into a Client Component, which can be imported into your layout or template:

```tsx filename="app/components/nav-links.tsx" switcher
```tsx filename="app/ui/nav-links.tsx" switcher
'use client'

import { usePathname } from 'next/navigation'
Expand All @@ -249,7 +249,7 @@ export function Links() {
}
```

```jsx filename="app/components/nav-links.js" switcher
```jsx filename="app/ui/nav-links.js" switcher
'use client'

import { usePathname } from 'next/navigation'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,9 @@ export default async function middleware(req) {
!pathname.endsWith('/') &&
!pathname.match(/((?!\.well-known(?:\/.*)?)(?:[^/]+\/)*[^/]+\.\w+)/)
) {
req.nextUrl.pathname += '/'
return NextResponse.redirect(req.nextUrl)
return NextResponse.redirect(
new URL(`${req.nextUrl.pathname}/`, req.nextUrl)
)
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "14.3.0-canary.32"
"version": "14.3.0-canary.33"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "14.3.0-canary.32",
"version": "14.3.0-canary.33",
"keywords": [
"react",
"next",
Expand Down
Loading

0 comments on commit 4958450

Please sign in to comment.