-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
docs(mdx): add a dynamic imports section for App Router #73466
Conversation
cc @karlhorky I don't think this is as seamless (probably possible) with Pages Router since pages can't be async in Pages Router, so opted to just stick to adding this for App Router. |
839a24f
to
774554d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest removing / reworking the "Remote MDX" section, at least for App Router:
This section introduces secondary terminology "remote MDX" and recommends a 3rd-party library, whereas these capabilities are possible with only @next/mdx
@karlhorky I'm not sure if this is the same capabilities—the Remote MDX example is using raw Markdown text from fetch, whereas my example is importing a markdown file as a Component. We could probably figure out a way to fetch Markdown text and make it usable, but it seems more complicated to implement than just Maybe we just remove this line from the Remote MDX section → " content stored in a separate local folder"? |
With this part "If we fetched MDX text, how would we pa", I guess you mean "how would we parse and compile the MDX" Maybe
That's a good point, we could potentially suggest that.
In case you think there's a high value of keeping the "Remote MDX" section, this would also be a possibility: Eg. remove the parts about local files, which overlap with Maybe also add more language about this being an "alternative" and more emphasis that it's "third party". Could also be moved further down in the docs. |
@karlhorky Sounds good! It's late here (the next day haha) so I will finish later today! |
Also, if the following people have time, would also request a PR review from you as well: |
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
This looks suspicious. |
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple clarifications needed as you can run into issues here
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
0befb1d
to
eba4bdd
Compare
@remcohaszing I think |
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
docs/01-app/02-building-your-application/07-configuring/05-mdx.mdx
Outdated
Show resolved
Hide resolved
5703760
to
985e9b0
Compare
985e9b0
to
5187c6e
Compare
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Lee Robinson <me@leerob.io>
5187c6e
to
a56956e
Compare
Thanks everyone for getting this in! 🚀 |
Why?
Adding a section dedicated to dynamically importing MDX files inside pages for App Router.