Skip to content

Commit 913bfff

Browse files
JakobJingleheimeravivkellerstyflebmuenzenmeyer
authored
feat(learn): organise TypeScript articles from simplest to advanced usage (#7465)
* feat(learn): organise TypeScript articles from simplest to advanced usage * fixup! Co-authored-by: Steven <[email protected]> Signed-off-by: Aviv Keller <[email protected]> --------- Signed-off-by: Aviv Keller <[email protected]> Signed-off-by: Brian Muenzenmeyer <[email protected]> Co-authored-by: Aviv Keller <[email protected]> Co-authored-by: Steven <[email protected]> Co-authored-by: Brian Muenzenmeyer <[email protected]>
1 parent c3411eb commit 913bfff

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

apps/site/navigation.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@
211211
"link": "/learn/typescript/introduction",
212212
"label": "components.navigation.learn.typescript.links.introduction"
213213
},
214-
"transpile": {
215-
"link": "/learn/typescript/transpile",
216-
"label": "components.navigation.learn.typescript.links.transpile"
214+
"runNatively": {
215+
"link": "/learn/typescript/run-natively",
216+
"label": "components.navigation.learn.typescript.links.runNatively"
217217
},
218218
"run": {
219219
"link": "/learn/typescript/run",
220220
"label": "components.navigation.learn.typescript.links.run"
221221
},
222-
"runNatively": {
223-
"link": "/learn/typescript/run-natively",
224-
"label": "components.navigation.learn.typescript.links.runNatively"
222+
"transpile": {
223+
"link": "/learn/typescript/transpile",
224+
"label": "components.navigation.learn.typescript.links.transpile"
225225
},
226226
"publishingTSPackage": {
227227
"link": "/learn/typescript/publishing-a-ts-package",

apps/site/pages/en/learn/typescript/run-natively.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ layout: learn
44
authors: AugustinMauroy, khaosdoctor, jakebailey, robpalme
55
---
66

7-
> **⚠️WARNING⚠️:** All content in this article uses Node.js experimental features. Please make sure you are using a version of Node.js that supports the features mentioned in this article. And remember that experimental features can change in future versions of Node.js.
8-
97
# Running TypeScript Natively
108

11-
In the previous articles, we learned how to run TypeScript code using transpilation and with a runner. In this article, we will learn how to run TypeScript code using Node.js itself.
9+
Since v23.6.0, Node.js enables "type stripping" by default. If you are using v23.6.0 or later and your source code contains only [erasable typescript syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/#the---erasablesyntaxonly-option), you do not need this article.
1210

1311
## Running TypeScript code with Node.js
1412

@@ -28,7 +26,7 @@ In V22.7.0 this experimental support was extended to transform TypeScript-only s
2826
node --experimental-transform-types another-example.ts
2927
```
3028

31-
From V23 onwards, the `--experimental-strip-types` flag is enabled by default (you can disable it via the [`--no-experimental-strip-types`](https://nodejs.org/docs/latest-v23.x/api/cli.html#--no-experimental-strip-types) flag), enabling you to run any supported syntax, so running files like the one below with `node file.ts` is supported:
29+
From v23.6.0 onwards, type stripping is enabled by default (you can disable it via [`--no-experimental-strip-types`](https://nodejs.org/docs/latest-v23.x/api/cli.html#--no-experimental-strip-types)), enabling you to run any supported syntax, so running files like the one below with `node file.ts` is supported:
3230

3331
```ts
3432
function foo(bar: number): string {

apps/site/pages/en/learn/typescript/run.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors: AugustinMauroy
66

77
# Running TypeScript with a runner
88

9-
In the previous article, we learned how to run TypeScript code using transpilation. In this article, we will learn how to run TypeScript code using a runner.
9+
If you want more advanced processing of TypeScript than the built-in support (or you're using Node.js prior to v22.7.0), you have 2 options: use a runner (which handles much of the complexity for you), or handle it all yourself via [transpilation](./transpile.md).
1010

1111
## Running TypeScript code with `ts-node`
1212

apps/site/pages/en/learn/typescript/transpile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors: AugustinMauroy
66

77
# Running TypeScript code using transpilation
88

9-
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.
9+
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 don't run TypeScript code directly.
1010

1111
## Compiling TypeScript to JavaScript
1212

0 commit comments

Comments
 (0)