Unverified Commit 91144461 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Revert "chore(examples): migrate mdx from pages router (JS) to app router (TS)" (#63704)

Reverts vercel/next.js#63646

The example changes are missing a bunch of stuff:
- Types are not added, you can see the changes required here:
https://github.com/vercel/next.js/pull/63703
- Dependencies are missing, i.e. `@types/react` `@types/node`,
`typescript` are all missing.

Reverting as CI is broken.
parent f502ebbe
export const metadata = {
title: "Next.js MDX example",
description: "Generated by Next.js",
};
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
// This file is required to use @next/mdx in the `app` directory.
export function useMDXComponents(components) {
return components;
// Allows customizing built-in components, e.g. to add styling.
// return {
// h1: ({ children }) => <h1 style={{ fontSize: "100px" }}>{children}</h1>,
// ...components,
// }
}
const withMDX = require("@next/mdx")(); const withMDX = require("@next/mdx")({
extension: /\.mdx?$/,
});
module.exports = withMDX({ module.exports = withMDX({
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"], pageExtensions: ["js", "jsx", "mdx"],
}); });
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"@mdx-js/loader": "^3.0.1", "@mdx-js/loader": "^1.5.1",
"@mdx-js/react": "^3.0.1", "@mdx-js/react": "^1.6.18",
"@next/mdx": "^14.1.4", "@next/mdx": "^9.1.1",
"next": "latest", "next": "latest",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
......
import Button from "../components/button"; import Button from "../components/button.js";
# MDX + Next.js # MDX + Next.js
......
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"strictNullChecks": true
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment