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

feat(v2): add TypeScript support for theme components #2469

Merged
merged 1 commit into from
Mar 27, 2020
Merged

feat(v2): add TypeScript support for theme components #2469

merged 1 commit into from
Mar 27, 2020

Conversation

SamChou19815
Copy link
Contributor

@SamChou19815 SamChou19815 commented Mar 26, 2020

Motivation

I want to write swizzled theme components in TypeScript. (I'm not sure whether the maintainers of docusaurus want to eventually convert @docusaurus/theme-classic components into typescript.)

The infrastructure for typescript is already mostly setup in #2221 and #2310. This diff just adds support for recognizing typescript files for theme component.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Without this diff, change packages/docusaurus-theme-classic/src/theme/Footer/index.js's extension to tsx. Try yarn start. It will fail by saying @theme/Footer cannot be resolved.
  2. After I made these changes. Stop dev server and run yarn start again. Now @theme/Footer is correctly resolved and the page will load successfully.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 26, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit a953aaf

https://deploy-preview-2469--docusaurus-2.netlify.com

@lex111 lex111 added the pr: new feature This PR adds a new API or behavior. label Mar 27, 2020
@lex111 lex111 added this to the v2.0.0-alpha.49 milestone Mar 27, 2020
@lex111 lex111 changed the title feat(v2): Support typescript theme components feat(v2): add TypeScript support for theme components Mar 27, 2020
Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Thanks once again Sam!

@yangshun yangshun merged commit ecfb55e into facebook:master Mar 27, 2020
@SamChou19815 SamChou19815 deleted the feat/support-typescript-theme-components branch March 27, 2020 17:13
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.

6 participants