From 70e3ceabd41030658581f9c802ab58a74c030927 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 12 Apr 2021 15:19:50 -0400 Subject: [PATCH] add note about preset-env to a few missed plugins (#2485) Fixes #2483 --- docs/plugin-proposal-class-properties.md | 2 ++ docs/plugin-proposal-private-methods.md | 2 ++ docs/plugin-transform-modules-amd.md | 2 ++ docs/plugin-transform-modules-commonjs.md | 2 ++ docs/plugin-transform-modules-systemjs.md | 2 ++ docs/plugin-transform-modules-umd.md | 2 ++ docs/plugin-transform-regenerator.md | 2 ++ docs/preset-env.md | 2 +- 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/plugin-proposal-class-properties.md b/docs/plugin-proposal-class-properties.md index 3de24aefe2..ba077bb47b 100644 --- a/docs/plugin-proposal-class-properties.md +++ b/docs/plugin-proposal-class-properties.md @@ -4,6 +4,8 @@ title: @babel/plugin-proposal-class-properties sidebar_label: class-properties --- +> **NOTE**: This plugin is included in `@babel/preset-env` + ## Example Below is a class with four class properties which will be transformed. diff --git a/docs/plugin-proposal-private-methods.md b/docs/plugin-proposal-private-methods.md index 5720ca3c15..6b1a9eb09b 100644 --- a/docs/plugin-proposal-private-methods.md +++ b/docs/plugin-proposal-private-methods.md @@ -4,6 +4,8 @@ title: @babel/plugin-proposal-private-methods sidebar_label: private-methods --- +> **NOTE**: This plugin is included in `@babel/preset-env` +
History | Version | Changes | diff --git a/docs/plugin-transform-modules-amd.md b/docs/plugin-transform-modules-amd.md index 72185757ae..9ecc7775c9 100644 --- a/docs/plugin-transform-modules-amd.md +++ b/docs/plugin-transform-modules-amd.md @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-amd sidebar_label: AMD --- +> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option + This plugin transforms ECMAScript modules to [AMD](https://github.com/amdjs/amdjs-api/blob/master/AMD.md). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of the different resolution algorithms between implementations of ECMAScript modules and AMD. ## Example diff --git a/docs/plugin-transform-modules-commonjs.md b/docs/plugin-transform-modules-commonjs.md index 2463c7f500..f9fa68c43c 100644 --- a/docs/plugin-transform-modules-commonjs.md +++ b/docs/plugin-transform-modules-commonjs.md @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-commonjs sidebar_label: Common JS --- +> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option + This plugin transforms ECMAScript modules to [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ECMAScript modules and CommonJS. ## Example diff --git a/docs/plugin-transform-modules-systemjs.md b/docs/plugin-transform-modules-systemjs.md index 6a1d3993eb..6fb07dc515 100644 --- a/docs/plugin-transform-modules-systemjs.md +++ b/docs/plugin-transform-modules-systemjs.md @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-systemjs sidebar_label: SystemJS --- +> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option + This plugin transforms ECMAScript modules to [SystemJS](https://github.com/systemjs/systemjs/blob/master/docs/system-register.md). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) and import expressions (`import('./mod.js')`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ECMAScript modules and SystemJS. ## Example diff --git a/docs/plugin-transform-modules-umd.md b/docs/plugin-transform-modules-umd.md index 800351121e..dcb343cac1 100644 --- a/docs/plugin-transform-modules-umd.md +++ b/docs/plugin-transform-modules-umd.md @@ -4,6 +4,8 @@ title: @babel/plugin-transform-modules-umd sidebar_label: UMD --- +> **NOTE**: This plugin is included in `@babel/preset-env` under the `modules` option + This plugin transforms ES2015 modules to [UMD](https://github.com/umdjs/umd). Note that only the _syntax_ of import/export statements (`import "./mod.js"`) is transformed, as Babel is unaware of different resolution algorithms between implementations of ES2015 modules and UMD. ⚠️ This plugin does not support dynamic import (`import('./lazy.js')`). diff --git a/docs/plugin-transform-regenerator.md b/docs/plugin-transform-regenerator.md index eb1a8cf7c1..9f489e745e 100644 --- a/docs/plugin-transform-regenerator.md +++ b/docs/plugin-transform-regenerator.md @@ -4,6 +4,8 @@ title: @babel/plugin-transform-regenerator sidebar_label: regenerator --- +> **NOTE**: This plugin is included in `@babel/preset-env` + ## Example **In** diff --git a/docs/preset-env.md b/docs/preset-env.md index f9eb3c72ad..2fba78b258 100644 --- a/docs/preset-env.md +++ b/docs/preset-env.md @@ -30,7 +30,7 @@ yarn add @babel/preset-env --dev We leverage these data sources to maintain [mappings of which version](https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json) of our supported target environments gained support of a JavaScript syntax or browser feature, as well as a mapping of those syntaxes and features to Babel transform plugins and core-js polyfills. -> It is important to note that `@babel/preset-env` does _not_ support `stage-x` plugins. +> Note: `@babel/preset-env` won't include any JavaScript syntax proposals less than Stage 3 because at that stage in the TC39 process, it wouldn't be implemented by any browsers anyway. Those would need to be included manually. The `shippedProposals` option will include Stage 3 proposals that some browsers have already implemented. `@babel/preset-env` takes any [target environments you've specified](#targets) and checks them against its mappings to compile a list of plugins and passes it to Babel.