Skip to content

Commit bd498c6

Browse files
authoredOct 17, 2024··
bump next 15 rc1 (#3477)
* bump next 15 rc1 * lint * aa * aa * Update .changeset/gentle-eyes-bathe.md
1 parent 9a724ec commit bd498c6

File tree

9 files changed

+893
-2008
lines changed

9 files changed

+893
-2008
lines changed
 

‎.changeset/gentle-eyes-bathe.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextra': patch
3+
---
4+
5+
fix compatibility with Next.js `15.0.0-rc.1`

‎docs/components/ready-to-go.mdx

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### Create Next.js [`App` Component](https://nextjs.org/docs/pages/building-your-application/routing/custom-app)
2+
3+
Create `pages/_app.jsx` file with the following content:
4+
5+
```jsx filename="pages/_app.jsx"
6+
export default function App({ Component, pageProps }) {
7+
return <Component {...pageProps} />
8+
}
9+
```
10+
111
### Ready to Go!
212

313
Now, you can create your first MDX page as `pages/index.mdx`:

‎docs/pages/docs/guide/advanced/remote.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import { Callout } from 'nextra/components'
44

5-
<Callout emoji="🚨">
6-
This page is a stub. Help us expand it by contributing!
5+
<Callout type="info">
6+
You can find information about remote docs support in [Nextra 3
7+
blogpost](https://the-guild.dev/blog/nextra-3#remote-docs-support)
8+
announcement.
79
</Callout>

‎examples/blog/pages/_app.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function App({ Component, pageProps }) {
2+
return <Component {...pageProps} />
3+
}

‎examples/docs/src/pages/_app.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function App({ Component, pageProps }) {
2+
return <Component {...pageProps} />
3+
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"overrides": {
5252
"vite": "5.4.8",
5353
"esbuild": "0.24.0",
54-
"next": "14.2.15"
54+
"next": "15.0.0-rc.1"
5555
},
5656
"patchedDependencies": {
5757
"@changesets/assemble-release-plan@6.0.4": "patches/@changesets__assemble-release-plan.patch",

‎packages/nextra/src/server/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ const nextra: Nextra = nextraConfig => {
137137
appESM
138138
]
139139
} else {
140-
alias[join(alias.next, 'dist', 'pages', '_app')] = appESM
140+
const nextAlias = alias.next
141+
if (nextAlias) {
142+
alias[join(alias.next, 'dist', 'pages', '_app')] = appESM
143+
}
141144
}
142145
const rules = config.module.rules as RuleSetRule[]
143146

‎packages/nextra/src/server/rehype-plugins/rehype.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ export const rehypeParseCodeMeta: Plugin<
4949
ast => {
5050
visit(ast, { tagName: 'pre' }, (node: PreElement) => {
5151
const [codeEl] = node.children as Element[]
52-
// @ts-expect-error fixme
5352
const { meta = '' } = codeEl.data || {}
5453

55-
node.__filename = meta.match(CODE_BLOCK_FILENAME_REGEX)?.[1]
54+
node.__filename = meta!.match(CODE_BLOCK_FILENAME_REGEX)?.[1]
5655
node.properties['data-filename'] = node.__filename
5756

58-
node.__hasWordWrap = meta.includes('word-wrap=false') ? false : true
57+
node.__hasWordWrap = !meta!.includes('word-wrap=false')
5958
if (node.__hasWordWrap) {
6059
node.properties['data-word-wrap'] = ''
6160
}

0 commit comments

Comments
 (0)
Please sign in to comment.