docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

docs: add theme-common to API docs

Open Josh-Cena opened this issue 3 years ago â€ĸ 3 comments
trafficstars

Pre-flight checklist

  • [x] 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 https://github.com/facebook/docusaurus/issues/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 avatar May 09 '22 15:05 Josh-Cena

[V2]

Name Link
Latest commit 115212c2ba2f42ed9845a06e8c7aebbf5ec30f68
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.

netlify[bot] avatar May 09 '22 15:05 netlify[bot]

âšĄī¸ 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[bot] avatar May 09 '22 15:05 github-actions[bot]

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

github-actions[bot] avatar May 09 '22 15:05 github-actions[bot]