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

Create an explainer / hub page for type stripping (TypeScript) support #7440

Open
JoshuaKGoldberg opened this issue Feb 1, 2025 · 5 comments
Labels
content Issues/pr concerning content good first issue Issues for newcomers help wanted learn Issues/pr concerning the learn section

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Feb 1, 2025

Enter your suggestions in details:

The new type stripping / TypeScript support in Node.js is very exciting. A lot of users are adopting the built-in support for both source code and tooling config files. 🚀

But, there isn't one single high-level, official resource that users can be pointed to to understand the unflagged support.

Proposal: can the Node.js site have a page added dedicated to explaining type stripping at the high level? I'd imagine it could contain:

  1. What "type stripping" is
  2. Quick examples of running a .ts file
  3. What versions of Node.js have it
  4. Quick FAQs such as un/not-yet-supported syntax and type checking
  5. Links to learn more on the official Node.js and TypeScript websites

Sibling issue to #7441, intentionally with as similar an issue body as possible.

@AugustinMauroy
Copy link
Member

cc @marco-ippolito

@marco-ippolito
Copy link
Member

No objections from my side, I agree a detailed guide would be useful. It has been moving pretty quickly and now its slowing down, so it should be possibile to write something without it becoming outdated immediately

@AugustinMauroy
Copy link
Member

Can I work on this or someone want work onto it ?

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Feb 2, 2025

Okay after re-read of whole typescript sub-section:

  • learn/typescript/transpile: should have explaining about tsconfig and what transpiling can be interesting (mainly choosing the target).
  • learn/typescript/run: we should add why this method exist and what is interesting for user to use this method.
  • learn/typescript/run-natively has been created just after the landing of "types-stripping" so we need some new thing
    • Why node didn't have any kind of config
    • JSX + TSX what is it why node didn't handle this (basically no config + depend of the target).
    • Why/what is type-stripping

Other point

  • The order need to be changed introduction => run natively ('cause it's the easiest way no conf just run) => transpiling => extra thing with runner
  • feat(learn): add article for publishing a typescript package #7279 explain how to publish a ts package to npm registry. But how should we advise working with typescript when it's not a package, I mean when it's directly a project. IMO native run for dev + tsc transpiling for prod.
  • there is no mention of type definition, for example there is no mention of @types/node.

Extra thing just to keep trace/ personal note

  • Transpilation is the process of converting source code from one language to another. In the case of TypeScript, it's the process of converting TypeScript code to JavaScript code. This is necessary because browsers and Node.js can't run TypeScript code directly.
    this should be rephrased because "node can run typescript".

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Feb 3, 2025

After sync with Jacob:

Here is the logic/link between the articles and the order in which they should appear

  • Intro:
    • add info about type defs (ex @types/node)
    • jsx
  • Running:
    • in dev
    • in prod
      • don’t → pre-compile. link back to dev compile option with diff codeblock for prod settings (ex minify: true)
  • Publishing for distribution:
    • down-versioning

So action will be:

  1. revise intro
  2. finish Publishing a TypeScript project
  3. Reviese order and logic between article (explain above)

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Node.js Website Feb 4, 2025
@ovflowd ovflowd added the content Issues/pr concerning content label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues/pr concerning content good first issue Issues for newcomers help wanted learn Issues/pr concerning the learn section
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants