Docs: babel-present-env and stage-x proposals
See original GitHub issueFeature Request
Is your feature request related to a problem? Reading https://babeljs.io/docs/en/babel-preset-env it says:
We leverage these data sources to maintain mappings of which version 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.
The note about stage-x
plugins makes it sound like no plugins of e.g. stage 3 would exist in present-env
. Yet looking at the linked docs at https://github.com/babel/babel/blob/master/packages/babel-compat-data/data/plugins.json shows proposal-class-properties
which is only in stage 3, see https://github.com/tc39/proposal-class-fields, is a supported stage 3 plugin.
Describe the solution you’d like
The docs should be updated to not make a note about “does not support stage-x
plugins” to say “not all”. Or something else. In addition, stage 4 are supported, but yet they fall under stage-x
, so saying “not stage-x” seems overall to be incorrect.
In addition https://babeljs.io/docs/en/babel-plugin-proposal-class-properties does not mention it is in @babel/preset-env
but many others do just that, like https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread (at the top of the docs).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top GitHub Comments
I did find
shippedProposals
when reading further at https://babeljs.io/docs/en/babel-preset-env#shippedproposalsSo that comment about “does not support stage-x plugins” is not entirely true then.
Yeah looks like I missed one or two, sorry for the confusion!