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

refactor: move @theme/hooks to @docusaurus/theme-common #6289

Merged
merged 6 commits into from
Jan 7, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jan 7, 2022

Breaking changes

  • All @theme/hooks/* have been moved to @docusaurus/theme-common named exports (sometimes renamed/refactored a bit but it's normally not public API surface)
  • One documented API surface refactored: 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 swizzle

All 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

@slorber slorber added pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: maintenance This PR does not produce any behavior differences to end users when upgrading. labels Jan 7, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 7, 2022
@netlify
Copy link

netlify bot commented Jan 7, 2022

✔️ [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

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 87
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6289--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

Size Change: +998 B (0%)

Total Size: 676 kB

Filename Size Change
website/build/assets/js/main.********.js 502 kB +998 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 41.6 kB
website/build/assets/css/styles.********.css 102 kB
website/build/index.html 29.6 kB

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented Jan 28, 2022

This change is causing some issues in our plugin ecosystem

I'm thinking we could provide a compatibility layer (webpack or js aliases) temporarily? 🤷‍♂️

@Josh-Cena
Copy link
Collaborator

I think it's fine... We are going to break them some time in the future anyways...

antoniancu added a commit to Unity-Technologies/com.unity.multiplayer.docs that referenced this pull request Mar 3, 2023
Per facebook/docusaurus#6289,
@theme/hooks moved to @docusaurus/theme-common
antoniancu added a commit to Unity-Technologies/com.unity.multiplayer.docs that referenced this pull request Mar 8, 2023
Per facebook/docusaurus#6289,
@theme/hooks moved to @docusaurus/theme-common
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: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants