-
Notifications
You must be signed in to change notification settings - Fork 3
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 installation async #136
Conversation
used 3rd party package for speed
inc component source
reusing ComponentExample existing component more
Base docs on latest prod
keep singular vs plural as that one is easy to transform
smart docTabbedCode which can fetch tab content itself
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -57,6 +57,7 @@ export default async function ComponentPage({ | |||
|
|||
const mdxDoc = await getInstallationDoc({ | |||
componentType: type, | |||
// @ts-expect-error async component |
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.
Tbh, I'm not sure if adding @ts-expect-error
is something we'd want in our project, but I feel like I can't really make that decision on my own.
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.
Yep, I am not sure either. Just to expand I would be ok with that if I feel that its very likely this feature gonna be supported soon. But I am not really confident about that
Also thats way I extracted this into separate proposal. Maybe we will switch to @next/mdx and this wont be relevant anymore ...
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'm looking into @next/mdx
and we will see if that is a good option for us. I'm still not sure if it would be good for us.
As I wrote above, I'm not sure if adding support for async components is worth adding Maybe @iamhectorsosa would have a better opinion on this, but he is away until next week. |
This PR is not relevant anymore if #130 is merged with @next-mdx lib |
@ChcJohnie @ericvalcik if we need to update this PR with close with comment, please do so. |
I'd close this PR. @ChcJohnie if you agree, you can close this PR |
Deprecated as |
Proposal to use RSC async components in MXD components compile list to allow more flexibility inside components for loading files etc.
Tested with DocTabbedCode (wrapper around common TabbedCode which can fetch files from src folder based on path).
In that case mxd markup can be (for List component with 2 files and 1 dependency).
<DocTabbedCode tabs={[ { id: "List.tsx", path: "mailingui/components/list/List.tsx" }, { id: "BulletList.tsx", path: "mailingui/components/list/BulletList.tsx", }, { id: "Paragraph.tsx", path: "mailingui/components/text/Text.tsx", }, ]} />
Off course component could be more or less automatic, this one is more on general side to have discussion.
Both buildtime and runtime async component looks ok and I think is expected to work, but there are some issues with typing (both react side - should be improved in latest ts and types/react and mxd side). For now only solution seems to expect ts error.
Relevant issues: mdx-js/mdx#2242 , DefinitelyTyped/DefinitelyTyped#65003