-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix(content-docs): export versioning utils #6477
Conversation
✔️ [V2] 🔨 Explore the source changes: e111ef4 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61f48a5beeebf30008b64306 😎 Browse the preview: https://deploy-preview-6477--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6477--docusaurus-2.netlify.app/ |
@docusaurus/plugin-content-docs
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.
👍 that seems like a reasonable thing to do.
Not sure we'll want to document this officially but we can at least restore the useful exports
I don't know all the internals of your plugin, was wondering if in the future we couldn't find a way to make it work by extending the docs plugin? maybe having a way to somehow create "virtual mdx files" or something?
Maybe you'll find this interesting: #4138 (comment)
@@ -5,6 +5,7 @@ | |||
"main": "lib/index.js", | |||
"exports": { | |||
"./client": "./lib/client/index.js", | |||
"./versions": "./lib/versions.js", |
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.
"./versions": "./lib/versions.js", | |
"./node": "./lib/node/index.js", |
I'd rather have a unique entry point for all the exposed Node.js apis.
This way it's more explicit what the API surface is and we are less likely to rename a function by mistake and break your plugin.
Does it make sense and work for you?
@slorber Change works for me. Updated. As for the plugin, it does not use Markdown. It renders pages using React components and a JSON dataset: https://github.com/milesj/docusaurus-plugin-typedoc-api/tree/master/packages/plugin/src/components We also piggyback off of docs components when we can. Like this is a somewhat clone of |
|
||
// APIs available to Node.js | ||
export * from '../constants'; | ||
export * from '../versions'; |
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.
for constants I'm fine with * but I'd rather have named exports for everything else, so that we don't expose publicly things by mistake
(for client, all global data hooks are exposed on purpose)
@slorber @Josh-Cena Updated. |
@slorber @Josh-Cena Bumping this because of the weekend. |
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.
LGTM thanks 👍
cc: @slorber
Motivation
In docusaurus-plugin-typedoc-api we support versioning by piggy-backing off the docs implementation. We did this by importing some code from
lib/versions.js
and duplicating code that wasn't exported, you can view that here: https://github.com/milesj/docusaurus-plugin-typedoc-api/blob/master/packages/plugin/src/plugin/version.tsWith the addition of
exports
inbeta.15
, we're no longer able to import this utilities, which puts a lot of burden on us.To remedy this, I'm doing the following:
exports
for/versions
export
to some util functionsHave you read the Contributing Guidelines on pull requests?
Yes
Test Plan
N/A
Related PRs
N/A