question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Full Support For TypeScript

See original GitHub issue

🚀 Feature

The ability to run docusaurus in a TypeScript environment

Have you read the Contributing Guidelines on issues?

Yes

Motivation

I would personally like to see this because myself and likely others prefer TypeScript to writing pure Node.js, and I believe it is a relatively small change.

Pitch

There are already 7 upvotes on the TypeScript suggestion by Zihua Wu on the Docusaurus 2 feedback website.

  • It would require no new dependencies
  • I am willing to work on a PR
  • Modify how docusaurus loads files for rendering the website:
    • require() files without providing a specific extension
    • Support processing .ts and .tsx file extensions

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
EvanDarwincommented, Jan 18, 2020

@sarunast Your PR looks great, and is a simple change like I imagined.

@SleepWalker I think you will want to make a separate issue for Flow support, if that’s what you’re looking to do. Apologies, I misunderstood your question. I’m not sure about mdx or if Docusaurus already supports it – but I would still recommend separate feature requests for Flow and mdx support.

0reactions
sarunastcommented, Jan 14, 2020

I managed to get it work with TSX (docusaurus v2). Here is the config file from my project: https://github.com/sarunast/german-grammar/blob/master/webpackConfigPlugin/index.js

After that, you load it as a plugin in config. I guess it would be best if someone could create an actual plugin package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add TypeScript support to an existing codebase | by Billel
Add TypeScript support to an existing codebase · Install typescript npm package and node type definitions. Just run npm i --save-dev typescript @types/node ......
Read more >
How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do...
Read more >
How to Add TypeScript to a JavaScript Project - freeCodeCamp
How to convert a JavaScript application to support TypeScript. · Install typescript · Typescript config file · Create your first .TS file in...
Read more >
TypeScript Programming with Visual Studio Code
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It offers classes, modules, and interfaces to help you build robust...
Read more >
Typescript - Strapi Developer Docs
Strapi supports TypeScript in new projects on v4.3.0 and above. Existing JavaScript projects can add TypeScript support through a conversion ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found