-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support for app router #2023
Comments
@jonnylangefeld Nextra only works with the |
Similar discussion at Nextra in my already existing NextJs 13 app. |
C-EO mentioned this in another discussion but it may be helpful here too: #1142 (comment). |
Has there been any progress moving towards the App Router? |
@jakeleboeuf there is no progress currently A disadvantage of the App router for mdx docs is that each mdx page should be inside a folder for example
Also, you can't share your |
Just a note that we addressed this by using a catch-all segment ( If you do it this way, you don't need the pages directory at all, and so the theme can just use the app directory root layout. |
Can you share the code or repo where you dynamically import mdx files? |
@jthrilly how does that work? Did you setup your root Layout in the app dir to render the nextra theme? I'm looking for all the benefits of Nextra without losing all the benefits of the NextJS App Router world (ie RSC and friends). |
We aren't using Nextra currently. We wanted to, but we want app dir support. We built our solution as an experiment in how hard it would be to set up manually.
Its a pretty simple process:
|
@erichosick In this case you’ll be unable to
|
@erichosick gotcha, that setup makes sense if you're just looking to avoid the folder/page.tsx architecture. It's the Nextra + App Router part I'm looking for here, but tbh I'm not sure Nextra is the only thing holding me back at the moment. I need to better understand how mdx fits into the React Server Components world. For my use case, I'm working on a design system that will ship Server Components, and it would be ideal to render all our components in our Docs along with usage examples without any extra work done on components purely for our docs. But again, I'm not 100% sure this is a Nextra problem or if I'll run into issues no matter where I try to render RSC in .mdx files. *runs to the react repo 👀 |
@jakeleboeuf If you want to take a look at app router with MDX I will suggest source code of Rauch's blog |
Can't we just write a codegen/script which converts pagesDir mdx files to |
It seems like the only way to support App Router is to render mdx remotely (inspired by Lee blog https://github.com/leerob/leerob.io/blob/bb66498d9fc7dbfa28efcd1eaa475cb36d524efe/app/blog/%5Bslug%5D/page.tsx#L127) Example of file structure
That means the following ✅ no need to put each mdx page inside folder with |
@dimaMachina can you explain a bit more about why |
@tubbo solution with both proposals for me are not good enough to replace |
Seems nextra doesn't support app router yet, thus we didn't adopt app router. Ref: - shuding/nextra#2023 Issue: ppresume/ppresume#61
@dimaMachina could you elaborate on |
does it still now support app router? |
Yes check out nextra 4 pre-release. |
Nextra v3 was finally released. And Nextra v4 prerelease just out! Currently without docs changes update or migration guide. Nextra v4 will support a file-based router for your mdx files, Nextra v4 will also support rendering your docs from a single catch-all route Feel free to take a look at docs and i18n docs examples that were migrated to it! https://github.com/shuding/nextra/tree/v4-v2/examples Prerelease v4 last versions: Feel free to share your feedback and create separated issues for problems you encountered Have fun! I will close this issue to keep track of progress at #2600 |
Nextra 4 with App Router support is released https://the-guild.dev/blog/nextra-4 Feel free to submit your PRs to improve Nextra docs |
I'm using the next.js app router and Nextra doesn't quite work with that yet.
next.config.mjs
:when I run
npm run dev
:The text was updated successfully, but these errors were encountered: