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(v2): correct plugin types #4418

Merged
merged 1 commit into from
Mar 15, 2021
Merged

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Mar 12, 2021

Motivation

Improve types in docusaurus,

Have you read the Contributing Guidelines on pull requests?

yes

@armano2 armano2 requested review from lex111 and slorber as code owners March 12, 2021 22:14
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 12, 2021
@armano2 armano2 changed the title fix(v2): correct plugin types refactor(v2): correct plugin types Mar 12, 2021
@netlify
Copy link

netlify bot commented Mar 12, 2021

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit de36444

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

@armano2
Copy link
Contributor Author

armano2 commented Mar 12, 2021

Lighthouse Report is failing :(

@netlify
Copy link

netlify bot commented Mar 14, 2021

1 similar comment
@netlify
Copy link

netlify bot commented Mar 14, 2021

@@ -114,7 +115,7 @@ For more information, visit https://v2.docusaurus.io/docs/using-plugins.`);
version: pluginVersion,
};
})
.filter(Boolean);
.filter(<T>(item: T): item is Exclude<T, null> => Boolean(item));
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤪

Copy link
Collaborator

Choose a reason for hiding this comment

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

will merge this, but if you can add a utility fn in docusaurus-utils that would be appreciated :)

https://kentcdodds.com/blog/typescript-function-syntaxes#type-guards

@slorber slorber added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Mar 15, 2021
@slorber
Copy link
Collaborator

slorber commented Mar 15, 2021

Thanks 👍

@slorber slorber merged commit abae86f into facebook:master Mar 15, 2021
@lex111 lex111 added this to the v2.0.0-alpha.72 milestone Mar 15, 2021
@armano2 armano2 deleted the type/plugins branch March 16, 2021 06:38
This was referenced Mar 17, 2021
This was referenced Mar 17, 2021
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: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants