From 397b8b520e6fe10ded16e14fa0e7a346dc6445a2 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 12 Sep 2021 14:20:43 -0400 Subject: [PATCH] update esm messaging in docs --- website/docs/imports.md | 5 ++--- website/readme-sources/prefix.md | 6 +----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/website/docs/imports.md b/website/docs/imports.md index 9f759d20..e37887c4 100644 --- a/website/docs/imports.md +++ b/website/docs/imports.md @@ -2,7 +2,7 @@ title: "CommonJS vs native ECMAScript modules" --- -TypeScript is almost always written using modern `import` syntax, but you can choose to either transform to CommonJS or use node's native ESM support. Configuration is different for each. +TypeScript is almost always written using modern `import` syntax, but it is also transformed before being executed by the underlying runtime. You can choose to either transform to CommonJS or to preserve the native `import` syntax, using node's native ESM support. Configuration is different for each. Here is a brief comparison of the two. @@ -49,8 +49,7 @@ If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool, ## Native ECMAScript modules -[Node's ESM loader hooks](https://nodejs.org/api/esm.html#esm_experimental_loaders) are [**experimental**](https://nodejs.org/api/documentation.html#documentation_stability_index) and subject to change. `ts-node`'s ESM support is also experimental. They may have -breaking changes in minor and patch releases and are not recommended for production. +[Node's ESM loader hooks](https://nodejs.org/api/esm.html#esm_experimental_loaders) are [**experimental**](https://nodejs.org/api/documentation.html#documentation_stability_index) and subject to change. `ts-node`'s ESM support is as stable as possible, but it relies on APIs which node can *and will* break in new versions of node. Thus it is not recommended for production. For complete usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007). diff --git a/website/readme-sources/prefix.md b/website/readme-sources/prefix.md index 2b5fe41a..a24738ff 100644 --- a/website/readme-sources/prefix.md +++ b/website/readme-sources/prefix.md @@ -21,12 +21,8 @@ You can build the readme with this command: [![Build status](https://img.shields.io/github/workflow/status/TypeStrong/ts-node/Continuous%20Integration)](https://github.com/TypeStrong/ts-node/actions?query=workflow%3A%22Continuous+Integration%22) [![Test coverage](https://codecov.io/gh/TypeStrong/ts-node/branch/main/graph/badge.svg)](https://codecov.io/gh/TypeStrong/ts-node) -> TypeScript execution and REPL for node.js, with source map support. **Works with `typescript@>=2.7`**. +> TypeScript execution and REPL for node.js, with source map and native ESM support. The latest documentation can also be found on our website: [https://typestrong.org/ts-node](https://typestrong.org/ts-node) -### *Experimental ESM support* - -Native ESM support is currently experimental. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007). - # Table of Contents