Skip to content
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: add theme-common to API docs #7382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Josh-Cena
Copy link
Collaborator

@Josh-Cena Josh-Cena commented May 9, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

theme-common is in a very, very awkward situation. Its APIs are not meant to be public, but are more or less so through ejecting theme components. Nevertheless, there are some very stable APIs that are worth documenting.

For now, I've simply moved the useColorMode hook documentation here; in the near future, we can include more utilities that are stable. For example, usePluralForm is also mentioned in the i18n tutorial and worth including in the future.

@slorber Before the official release, we need to decide the subset of theme-common APIs to be made stable and documented. Those that rely on unstable theme-common APIs would not be safe for eject. This is related to #6116

I even think some hooks like usePrevious and ReactContextError can be in core because they may be useful to every user and plugin...

Test Plan

Test links

Deploy preview: https://deploy-preview-7382--docusaurus-2.netlify.app/docs/api/misc/@docusaurus/theme-common/

Related issues/PRs

@Josh-Cena Josh-Cena added the pr: documentation This PR works on the website or other text documents in the repo. label May 9, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 9, 2022
@netlify
Copy link

netlify bot commented May 9, 2022

[V2]

Name Link
🔨 Latest commit 115212c
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62793426a5b10d000867b980
😎 Deploy Preview https://deploy-preview-7382--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented May 9, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 65 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟢 91 🟢 99 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

github-actions bot commented May 9, 2022

Size Change: +607 B (0%)

Total Size: 811 kB

Filename Size Change
website/.docusaurus/globalData.json 52.4 kB +175 B (0%)
website/build/assets/js/main.********.js 615 kB +432 B (0%)
ℹ️ View Unchanged
Filename Size
website/build/assets/css/styles.********.css 105 kB
website/build/index.html 38.8 kB

compressed-size-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants