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): allow for Typescript pages and components #2221

Merged
merged 1 commit into from
Jan 20, 2020
Merged

feat(v2): allow for Typescript pages and components #2221

merged 1 commit into from
Jan 20, 2020

Conversation

jonathanrdelgado
Copy link
Contributor

Motivation

Most of our codebase is in Typescript. We want some dynamic documentation to where we can reference variables in Typescript files. It would be awesome to further support inline Typescript files as well.

This is a very simple change that enables a lot of possibilities.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Pretty straight forward!

  • Try putting a .ts file in the pages folder (and a .js file for backwards compatibility) and test it compiles
  • Try putting a .ts or a .tsx file somewhere in the project, then reference it in any .md or .mdx file and be amazed as it works

Related PRs

Let me know how we want this documented (a page or a footnote) and I'll add it to the PR.

Fixes #2120

@facebook-github-bot
Copy link
Contributor

Hi jonathanrdelgado! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit e5c9c8f

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

@yangshun yangshun changed the title feat: allow for Typescript pages and components feat(v2): allow for Typescript pages and components Jan 20, 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.

Amazing, thank you!

@yangshun yangshun merged commit 5cb3309 into facebook:master Jan 20, 2020
@lex111 lex111 mentioned this pull request Jan 20, 2020
@lex111 lex111 added the pr: new feature This PR adds a new API or behavior. label Jan 31, 2020
@monapasan
Copy link

@jonathanrdelgado @yangshun
are there any docs on this?
I've tried to change my index.js to index.ts but the build didn't work :(

@lex111
Copy link
Contributor

lex111 commented Feb 26, 2020

@monapasan it will be resolved in #2334

So support TS pages will be available in the next release! 💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Full Support For TypeScript
6 participants