-
-
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: better typing + remove unnecessary eslint-disable #5335
Conversation
✔️ [V2] 🔨 Explore the source changes: 1249923 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6113c88ba8f5c50008b1dbb4 😎 Browse the preview: https://deploy-preview-5335--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5335--docusaurus-2.netlify.app/ |
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
0aee955
to
7e2192e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Didn't notice at first you modified the bootstrap theme: ignore my comments about it, we don't care much about maintaining it atm, we might as well simply deprecate it because it's not in an usable state currently
@@ -57,7 +55,6 @@ function DocPageContent({ | |||
|
|||
return ( | |||
<Layout | |||
key={isClient} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, this one has always been a bit suspicious to me and don't think it should be needed. It may have side-effects though, that we may have to handle in a different way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized that in CodeBlock
we also have key={String(mounted)}
. Maybe this is some black magic on client render?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just keep the keys for now, we'll take a look at this in another PR. The key in CodeBlock seems there for a good reason, but this one can probably be removed
} = useDocusaurusContext(); | ||
const { | ||
navbar: {title: navbarTitle, logo = {src: ''}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never linked too much this comp 🤪 a bit messy
maybe a good time to extract a separate one and cleanup a bit the code? I'm thinking of something like:
{logo && <LogoThemedImage logo={logo}/>)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit hard, since the use of logo
is intertwined with rendering logic of the component itself. Should we use Joi instead to make a default logo: {src: ''}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, not so easy 😅 I'll look at simplifying this in another pr
packages/docusaurus-theme-classic/src/theme/NavbarItem/LocaleDropdownNavbarItem.tsx
Outdated
Show resolved
Hide resolved
packages/docusaurus/src/client/baseUrlIssueBanner/BaseUrlIssueBanner.tsx
Outdated
Show resolved
Hide resolved
Yes, I find it a bit painful to backport the changes for type checks to pass while it seems so unmaintained... It seems to have zero usage on NPM. I was just making minimal changes to make TSC happy |
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
f86754a
to
b0d2e58
Compare
LGTM thanks 👍 we can do other changes in subsequent PRs |
Motivation
any
useDocusaurusContext
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Build & test