-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
refactor: move @theme/hooks to @docusaurus/theme-common #6289
Conversation
✔️ [V2] 🔨 Explore the source changes: 12f4d22 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61d87ef63199db00075a45e8 😎 Browse the preview: https://deploy-preview-6289--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6289--docusaurus-2.netlify.app/ |
Size Change: +998 B (0%) Total Size: 676 kB
ℹ️ View Unchanged
|
This change is causing some issues in our plugin ecosystem I'm thinking we could provide a compatibility layer (webpack or js aliases) temporarily? 🤷♂️ |
I think it's fine... We are going to break them some time in the future anyways... |
Per facebook/docusaurus#6289, @theme/hooks moved to @docusaurus/theme-common
Per facebook/docusaurus#6289, @theme/hooks moved to @docusaurus/theme-common
Breaking changes
@theme/hooks/*
have been moved to@docusaurus/theme-common
named exports (sometimes renamed/refactored a bit but it's normally not public API surface)import useThemeContext from '@theme/hooks/useThemeContext'
=>import {useColorMode} from '@docusaurus/theme-common';
Motivation
We'd like to keep the
@theme
namespace mostly for styled UI React components that you can swizzleAll the "UI agnostic" React and JS code is progressively moved to
@docusaurus/theme-common
Also do various refactors/renamings and grouping related things together (context value hook, context, context consumer hook)
Have you read the Contributing Guidelines on pull requests?
(Write your answer here.)
Test Plan
refactor: same behavior as before and tests are passing