Skip to content

[pull] canary from vercel:canary #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/01-app/02-guides/mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,18 @@ const nextConfig = {

const withMDX = createMDX({
options: {
remarkPlugins: [],
rehypePlugins: [['rehype-katex', { strict: true, throwOnError: true }]],
remarkPlugins: [
// Without options
'remark-gfm',
// With options
['remark-toc', { heading: 'The Table' }],
],
rehypePlugins: [
// Without options
'rehype-slug',
// With options
['rehype-katex', { strict: true, throwOnError: true }],
],
},
})

Expand All @@ -737,7 +747,7 @@ export default withMDX(nextConfig)

> **Good to know**:
>
> remark and rehype plugins without serializable options cannot be used yet with [Turbopack](/docs/app/api-reference/turbopack), due to [inability to pass JavaScript functions to Rust](https://github.com/vercel/next.js/issues/71819#issuecomment-2461802968)
> remark and rehype plugins without serializable options cannot be used yet with [Turbopack](/docs/app/api-reference/turbopack), because JavaScript functions can't be passed to Rust.

## Remote MDX

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": "15.4.2-canary.1"
"version": "15.4.2-canary.3"
}
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
'*.{js,jsx,mjs,ts,tsx,mts,mdx}': [
'prettier --with-node-modules --ignore-path .prettierignore --write',
'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.cli.json --no-eslintrc --fix',
'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.json --no-eslintrc --fix',
],
'*.{json,md,css,html,yml,yaml,scss}': [
'prettier --with-node-modules --ignore-path .prettierignore --write',
Expand Down
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": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
"dependencies": {
"@next/eslint-plugin-next": "15.4.2-canary.1",
"@next/eslint-plugin-next": "15.4.2-canary.3",
"@rushstack/eslint-patch": "^1.10.3",
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/eslint-plugin-internal",
"private": true,
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "ESLint plugin for working on Next.js.",
"exports": {
".": "./src/eslint-plugin-internal.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"keywords": [
"react",
"next",
Expand Down
17 changes: 16 additions & 1 deletion packages/next-mdx/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,22 @@ declare namespace nextMDX {
*
* @see https://mdxjs.com/packages/mdx/#api
*/
options?: Options
options?: Options & {
remarkPlugins?:
| (
| string
| [name: string, options: any]
| NonNullable<Options['remarkPlugins']>[number]
)[]
| Options['remarkPlugins']
rehypePlugins?:
| (
| string
| [name: string, options: any]
| NonNullable<Options['rehypePlugins']>[number]
)[]
| Options['rehypePlugins']
}
}
}

Expand Down
21 changes: 14 additions & 7 deletions packages/next-mdx/mdx-js-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ function interopDefault(mod) {
return mod.default || mod
}

async function importPluginForPath(pluginPath, projectRoot) {
const path = require.resolve(pluginPath, { paths: [projectRoot] })
return interopDefault(
// "use pathToFileUrl to make esm import()s work with absolute windows paths":
// on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs
// https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9
await import(process.platform === 'win32' ? pathToFileURL(path) : path)
)
}

async function importPlugin(plugin, projectRoot) {
if (Array.isArray(plugin) && typeof plugin[0] === 'string') {
const path = require.resolve(plugin[0], { paths: [projectRoot] })
plugin[0] = interopDefault(
// "use pathToFileUrl to make esm import()s work with absolute windows paths":
// on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs
// https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9
await import(process.platform === 'win32' ? pathToFileURL(path) : path)
)
plugin[0] = await importPluginForPath(plugin[0], projectRoot)
}
if (typeof plugin === 'string') {
plugin = await importPluginForPath(plugin, projectRoot)
}
return plugin
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-rspack",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-rspack"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"private": true,
"files": [
"native/"
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "15.4.2-canary.1",
"version": "15.4.2-canary.3",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -100,7 +100,7 @@
]
},
"dependencies": {
"@next/env": "15.4.2-canary.1",
"@next/env": "15.4.2-canary.3",
"@swc/helpers": "0.5.15",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
Expand Down Expand Up @@ -163,11 +163,11 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/font": "15.4.2-canary.1",
"@next/polyfill-module": "15.4.2-canary.1",
"@next/polyfill-nomodule": "15.4.2-canary.1",
"@next/react-refresh-utils": "15.4.2-canary.1",
"@next/swc": "15.4.2-canary.1",
"@next/font": "15.4.2-canary.3",
"@next/polyfill-module": "15.4.2-canary.3",
"@next/polyfill-nomodule": "15.4.2-canary.3",
"@next/react-refresh-utils": "15.4.2-canary.3",
"@next/swc": "15.4.2-canary.3",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.51.1",
"@rspack/core": "1.4.5",
Expand Down
Loading
Loading