-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add API Reference to website #5922
Conversation
99f3863
to
badb7e9
Compare
badb7e9
to
50ac3d5
Compare
9f75d2a
to
23ef00e
Compare
So I have resolved most of the issues, mostly by patching packages. Only remaining issue is how to deal with workspaces that have multiple TS entrypoints. For now that's just only:
As far as I have tested, the default support for multiple entries in
I think I will try to further patch |
79dd69e
to
967746e
Compare
d292b5d
to
fb64fb6
Compare
I may have gone overzealous with my patches 😅 Additions to the
At this point I think the PR is ready |
+ remarkPlugins: [], | ||
+ rehypePlugins: [], |
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.
By any chance, can you try sending a PR upstream to get these changes accepted? I'd prefer if we could avoid maintaining permanent patches.
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.
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.
Thanks!
+import React from "${(0, url_1.pathToFileURL)(require.resolve('react'))}"; | ||
+import { mdx } from "${(0, url_1.pathToFileURL)(require.resolve('@mdx-js/react'))}"; |
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.
Would this allow removing the dependencies added in https://github.com/yarnpkg/berry/pull/5625/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519?
If you could send a PR upstream to fix this as well that would be great.
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.
Would this allow removing the dependencies added in https://github.com/yarnpkg/berry/pull/5625/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519?
Hmm.. Probably. I will test later
If you could send a PR upstream to fix this as well that would be great.
I will submit one. Though I do think this code pattern is kinda obscure and won't be surprised if it is rejected. Also, I don't know if they will backport it to v2. If not then I guess we should focus on migrating to Docusaurus v3 before merging this.
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.
We can keep the patch so that's fine but to make future upgrades easier it would be nice to get it upstream at some point.
@Josh-Cena Indicated that they would be fine with a change like this in https://discord.com/channels/226791405589233664/654372321225605128/949824347529445487
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.
By the way, Docusaurus now uses MDX v3 and React automatic runtime, so things may be different ;)
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.
Yeah. Last night I started looking into making a PR and found that part of the MDX loader in Docusaurus v3 has changed significantly.
@merceyz Let's wait until after we migrate to Docusaurus v3 to see whether we still need the patch and/or to make an upstream PR
What's the problem this PR addresses?
The API reference is not available in new website
How did you fix it?
This is a WIP to bring the API reference to the new website via
docusaurus-plugin-typedoc-api
.The current state is has some kinks and issues to work out. The purpose of this draft PR is to track and discuss. I'll sort those out over time but if anyone wants to take over then be my guest.
Seems likedocusaurus-plugin-typedoc-api
need to use the instance from@docusaurus/theme-common
and@docusaurus/plugin-content-docs
used by the main doc, which were hidden inside@docusaurus/preset-classic
. I added package extensions to resolve them but that seems brittle.Docusaurus's MDX loader resolvesreact
and@mdx-js/react
from the loaded Markdown file. To include READMEs into the API reference we need every workspace to depend onreact
and@mdx-js/react
which is not very reasonable. For now I usepnpFallbackMode: all
so they fallback to thereact
and@mdx-js/react
in the top-level but again seems brittle.Only resolve one entrypoint for each workspace. Tried multiple entries and some pages broke. Maybe try again later?Some stuff have duplicate source links due to virtual paths. Need to deduplicateFunctions receive dedicated pages but the header is just "Callable". Ideally I want them to be just in the index page like variablesChecklist