Skip to content

Commit 261fcdc

Browse files
authored
fix next 16 compatibility (#4854)
* upd zod * update next * upd deps * upd typescript * upd prettier/eslint/turbo * format * format * upd * lint * lint * lint * lint * lint * typecheck * upd * upd * format * fix next 16 issue * upd * upd * upd * upd * upd * add changeset * fix build:all * fix build:all 2 * rm next-env.d.ts * Change middleware file name to proxy in i18n guide Updated instructions for automatic language detection to use 'proxy.ts' instead of 'middleware.ts'. * upd * jsonc * fix analyze * remove dead website * upd snapshot * try * fixx * Delete .github/workflows/nextjs-bundle-analysis.yml * tests pass
1 parent e9bf0a5 commit 261fcdc

68 files changed

Lines changed: 878 additions & 921 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/dark-regions-judge.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'nextra-theme-blog': patch
3+
'nextra-theme-docs': patch
4+
'nextra': patch
5+
---
6+
7+
- update zod to v4 stable
8+
- fix compatibility with Next.js 16

.github/workflows/nextjs-bundle-analysis.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ tsconfig.vitest-temp.json
1818

1919
_pagefind/
2020
docs/public/sitemap.xml
21+
next-env.d.ts

docs/app/_components/i18n-demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const I18n: FC = () => {
3535
key={lang}
3636
onPointerOver={() => setActive(lang)}
3737
className={cn(
38-
'relative cursor-default select-none whitespace-nowrap px-4 py-1.5',
38+
'relative cursor-default px-4 py-1.5 whitespace-nowrap select-none',
3939
active === lang
4040
? 'x:text-primary-600 x:bg-primary-50 x:dark:bg-primary-500/10'
4141
: 'text-gray-800 dark:text-gray-100'

docs/app/api/[name]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default $`,
4343
{ name: 'importPage', packageName: 'nextra/pages' },
4444
{ name: 'compileMdx', packageName: 'nextra/compile' },
4545
{ name: 'generateDefinition', packageName: 'nextra/tsdoc' },
46-
{ name: 'middleware', packageName: 'nextra/locales' },
46+
{ name: 'proxy', packageName: 'nextra/locales' },
4747
{ name: 'evaluate', packageName: 'nextra/evaluate' },
4848
{ name: 'normalizePages', packageName: 'nextra/normalize-pages' }
4949
]

docs/app/docs/guide/i18n/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ i18n: [
6060
## Automatically detect and redirect to user-selected language (_optional_)
6161

6262
You can automatically detect the user's preferred language and redirect them to
63-
the corresponding version of the site. To achieve this, create a `middleware.ts`
64-
or `middleware.js` file in the root of your project and export Nextra's
65-
middleware function from `nextra/locales`:
63+
the corresponding version of the site. To achieve this, create a `proxy.ts` or
64+
`proxy.js` file in the root of your project and export Nextra's middleware
65+
function from `nextra/locales`:
6666

67-
<ExampleCode example="swr-site" filePath="middleware.ts" metadata="{1}" />
67+
<ExampleCode example="swr-site" filePath="proxy.ts" metadata="{1}" />
6868

6969
> [!WARNING]
7070
>

docs/app/docs/guide/syntax-highlighting/_dynamic-code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const DynamicCode: FC<{ children: ReactNode }> = ({ children }) => {
2323
variant="outline"
2424
onClick={() => {
2525
const token = tokenRef.current!
26-
const prev = token.textContent!
26+
const prev = token.textContent
2727
token.textContent = String((+prev || 0) + 1)
2828
}}
2929
>

docs/app/layout.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Footer, Layout, Link, Navbar } from 'nextra-theme-docs'
88
import { Anchor, Banner, Head } from 'nextra/components'
99
import type { FC } from 'react'
1010
import inkeep from './showcase/_logos/inkeep.png'
11+
import xyflow from './showcase/_logos/xyflow.png'
1112
import './globals.css'
1213

1314
export const metadata: Metadata = {
@@ -65,7 +66,7 @@ const navbar = (
6566
height="20"
6667
className={cn(
6768
'hover:transition-all hover:duration-1000 motion-reduce:hover:transition-none',
68-
'[mask-image:linear-gradient(60deg,#000_25%,rgba(0,0,0,.2)_50%,#000_75%)] [mask-position:0] [mask-size:400%]',
69+
'[mask-image:linear-gradient(60deg,#000_25%,rgba(0,0,0,.2)_50%,#000_75%)] [mask-size:400%] [mask-position:0]',
6970
'hover:[mask-position:100%]'
7071
)}
7172
/>
@@ -110,14 +111,30 @@ const RootLayout: FC<LayoutProps<'/'>> = async ({ children }) => {
110111
extraContent: (
111112
<>
112113
<b className="mt-2 text-xs">Sponsored by:</b>
113-
<Anchor href="https://inkeep.com?utm_source=nextra.site&utm_campaign=nextra&utm_content=sidebarLink">
114-
<NextImage
115-
src={inkeep}
116-
title="AI Agents that get real work done"
117-
alt="AI Agents that get real work done"
118-
className="nextra-border rounded-sm border"
119-
/>
120-
</Anchor>
114+
{[
115+
{
116+
url: 'https://inkeep.com',
117+
alt: 'AI Agents that get real work done',
118+
img: inkeep
119+
},
120+
{
121+
url: 'https://xyflow.com',
122+
alt: 'Wire your ideas with xyflow!',
123+
img: xyflow
124+
}
125+
].map(o => (
126+
<Anchor
127+
key={o.url}
128+
href={`${o.url}?utm_source=nextra.site&utm_campaign=nextra&utm_content=sidebarLink`}
129+
>
130+
<NextImage
131+
src={o.img}
132+
title={o.alt}
133+
alt={o.alt}
134+
className="nextra-border rounded-sm border"
135+
/>
136+
</Anchor>
137+
))}
121138
</>
122139
)
123140
}}

docs/app/og/route.tsx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,32 @@ export async function GET(req: Request): Promise<Response> {
1818
searchParams.get('title')?.slice(0, 75) || 'Nextra Documentation'
1919

2020
return new ImageResponse(
21-
(
22-
<div
23-
tw="text-white px-20 py-[70px] bg-[#030303] h-full w-full flex justify-between flex-col"
21+
<div
22+
tw="text-white px-20 py-[70px] bg-[#030303] h-full w-full flex justify-between flex-col"
23+
style={{
24+
backgroundImage:
25+
'radial-gradient(circle at 25px 25px, #333 2%, transparent 0%), radial-gradient(circle at 75px 75px, #333 2%, transparent 0%)',
26+
backgroundSize: '100px 100px',
27+
backgroundPosition: '-30px -10px'
28+
}}
29+
>
30+
<NextraLogo height="40" />
31+
<h1
32+
tw="text-transparent text-[82px] m-0 mb-10 tracking-tighter leading-[1.1]"
2433
style={{
25-
backgroundImage:
26-
'radial-gradient(circle at 25px 25px, #333 2%, transparent 0%), radial-gradient(circle at 75px 75px, #333 2%, transparent 0%)',
27-
backgroundSize: '100px 100px',
28-
backgroundPosition: '-30px -10px'
34+
textShadow: '0 2px 30px #000',
35+
backgroundImage: 'linear-gradient(90deg, #fff 40%, #aaa)',
36+
backgroundClip: 'text',
37+
// To preserve new line
38+
whiteSpace: 'pre'
2939
}}
3040
>
31-
<NextraLogo height="40" />
32-
<h1
33-
tw="text-transparent text-[82px] m-0 mb-10 tracking-tighter leading-[1.1]"
34-
style={{
35-
textShadow: '0 2px 30px #000',
36-
backgroundImage: 'linear-gradient(90deg, #fff 40%, #aaa)',
37-
backgroundClip: 'text',
38-
// To preserve new line
39-
whiteSpace: 'pre'
40-
}}
41-
>
42-
{title}
43-
</h1>
44-
<p tw="m-0 text-3xl tracking-tight">
45-
Create beautiful websites with Next.js & MDX.
46-
</p>
47-
</div>
48-
),
41+
{title}
42+
</h1>
43+
<p tw="m-0 text-3xl tracking-tight">
44+
Create beautiful websites with Next.js & MDX.
45+
</p>
46+
</div>,
4947
{
5048
width: 1200,
5149
height: 630,

docs/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const IndexPage: FC = () => {
229229
</Link>
230230
.
231231
</p>
232-
<div className="z-1 absolute inset-0 size-full bg-[linear-gradient(to_right,white_250px,_transparent)] max-sm:hidden dark:bg-[linear-gradient(to_right,#202020_250px,_transparent)]" />
232+
<div className="absolute inset-0 z-1 size-full bg-[linear-gradient(to_right,white_250px,_transparent)] max-sm:hidden dark:bg-[linear-gradient(to_right,#202020_250px,_transparent)]" />
233233
<video
234234
autoPlay
235235
loop

0 commit comments

Comments
 (0)