Skip to content

@docusaurus/theme-common#3775

Merged
slorber merged 4 commits into
masterfrom
slorber/theme-common
Nov 18, 2020
Merged

@docusaurus/theme-common#3775
slorber merged 4 commits into
masterfrom
slorber/theme-common

Conversation

@slorber

@slorber slorber commented Nov 18, 2020

Copy link
Copy Markdown
Collaborator

Motivation

  • need to share code across multiple themes, so that we can create implement same ux on multiple themes (Theme gallery #3522)
  • need to protect theme implementation details from swizzling, and only expose a subset of comps (mostly design/layout-related components)
  • need to address import issues when swizzling a component that imports internal theme code (#3394 appears to have broken swizzle #3747)

Solution: @docusaurus/theme-common package for shared client-side theme code.

  • independent from a specific theme/styling
  • its code is considered internal (but we must avoid api breaking changes to avoid breaking swizzled comps anyway)

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

Tests + preview + build keeps working as usual

Related PRs

#3752
#2714

@slorber slorber requested a review from lex111 as a code owner November 18, 2020 14:01
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Nov 18, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Nov 18, 2020
@slorber slorber linked an issue Nov 18, 2020 that may be closed by this pull request
@netlify

netlify Bot commented Nov 18, 2020

Copy link
Copy Markdown

Deploy preview for docusaurus-2 ready!

Built with commit d5aecf5

https://deploy-preview-3775--docusaurus-2.netlify.app

@github-actions

github-actions Bot commented Nov 18, 2020

Copy link
Copy Markdown

Size Change: +19 B (0%)

Total Size: 152 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 20.7 kB 0 B
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 5.84 kB -2 B (0%)
website/build/main.********.js 108 kB +21 B (0%)
website/build/styles.********.css 17.4 kB 0 B

compressed-size-action

@netlify

netlify Bot commented Nov 18, 2020

Copy link
Copy Markdown

Deploy preview for docusaurus-2 ready!

Built with commit 7ed3122

https://deploy-preview-3775--docusaurus-2.netlify.app

@lex111 lex111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@slorber slorber merged commit abcd8ce into master Nov 18, 2020
@lex111 lex111 added this to the v2.0.0-alpha.67 milestone Nov 18, 2020
@slorber slorber deleted the slorber/theme-common branch August 17, 2021 18:00
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* create base @docusaurus/theme-common package + fix Webpack client export aliases issue shadowing other theme-common package

* Move theme-classic/src/utils code to new @docusaurus/theme-common package

* add prettierignore

* fix bad test location for getDocusaurusAliases()
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: new feature This PR adds a new API or behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#3394 appears to have broken swizzle

3 participants